DHI / mikecore-python

MIKE Core in Python
5 stars 0 forks source link

Overflow issue in reading DFS2. #15

Open amit-ramboll opened 2 years ago

amit-ramboll commented 2 years ago

When i read DFS2 file overflow error happened. (ArgumentError: argument 2: <class 'OverflowError'>: int too long to convert) I am using latest mikeio version.

mike_io_dfs2 .

ecomodeller commented 2 years ago

This is the first time I have sen this with a Dfs2 file.

Can you provide some additional info on which tool/engine that produced the file and the dimensions and a few screenshots from Mike zero with item info, dimensions, spatial axis info etc.

amit-ramboll commented 2 years ago

DFS2 files produced from MIKE SHE. Please see attached images. image image image image

amit-ramboll commented 2 years ago

Please find the sample file from that link. https://github.com/amit-ramboll/Python-MIKE/blob/main/Data/BalEge_Ref_2DSZ.dfs2)

amit-ramboll commented 2 years ago

what is the issue, in file or any python library?

ecomodeller commented 2 years ago

The problem is in the decoding it in python.

You can try to use an older version MIKE IO v 0.6.4 which is based on the .NET SDK, and see if this is any different, until @JesperGr have time to look at this file.

pip install mikeio==0.6.4
JesperGr commented 2 years ago

I did try today to reproduce this issue. But I could not. It works all fine to call

'dfs2File = DfsFileFactory.Dfs2FileOpen('BalEge_Ref_2DSZ.dfs2')'

Can you please try with the lastest version of mikeio to see if the problem is still there.

There was a fix on August 27 2021 stating "Fixing reading and writing encoding keys, used by most dfs3 files.". I am suspecting that mikeio did not include that fix at that point in time.