Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mikeio1d.open #160

Open
BjoerndalM opened this issue Feb 14, 2025 · 11 comments
Open

mikeio1d.open #160

BjoerndalM opened this issue Feb 14, 2025 · 11 comments

Comments

@BjoerndalM
Copy link

Am i doing something absolutely wrong here, or did mikeio1d suddenly lose the open function?

Image

@ryan-kipawa
Copy link
Collaborator

ryan-kipawa commented Feb 14, 2025

Hi @BjoerndalM

Hmm, our CI tests are passing for this. Could you check which version of mikeio1d you have installed with mikeio1d.__version__? If it's an older version, then try upgrading to a later version since mikeio1d.open() was only introduced some time around 0.9

@BjoerndalM
Copy link
Author

You were correct regarding the version part. I was running 0.3.0, but since upgrading i am having issues even import the mikeio1d libary. Apperently due to incompatibility with the numpy libary

Image

@BjoerndalM
Copy link
Author

I will try reinstalling numpy to a version earlier than 2.0.0

@ryan-kipawa
Copy link
Collaborator

Which version of numpy were you using? Could you print out your pip list?

@BjoerndalM
Copy link
Author

Numpy 2.0..2

Image

Image

@ryan-kipawa
Copy link
Collaborator

ryan-kipawa commented Feb 14, 2025

You could try installing mikeio1d with a fresh environment. If you want to keep your environment now, maybe also try upgrading your pandas version. It'd be useful to know which versions of these you were using so that I can mark them as incompatible.

Edit: sent this before your message came in. Thanks for the logs, I'll take a look

@BjoerndalM
Copy link
Author

I can add that once you import mikeplus (before importing mikeio1d of course), using the mikeio1d.Res1D(filename.res1d).read() function is no longer possible.

Image

This may be down to the fact that i am using an older version of mikeio1d (0.3.0), but i thought i would mention it.
I havent updated mikeio1d yet, since it gave complications with numpy, like i previously mentioned.

@ryan-kipawa
Copy link
Collaborator

Unfortunately I couldn't replicate your issue. I tried installing the latest version of mikeio1d, along this the specific pandas and numpy versions you have, and was able to import mikeio1d.

I see you have some other old packages installed (e.g. mikeio v1.0.3). I think this is not related to mikeio1d actually, but rather one of the existing packages you have installed that are imposing this constraint. My suggestion would be to try starting with a fresh virtual environment and installing the latest versions of packages that you need. Also, if you haven't upgraded Python lately, try using a version of 3.10 of greater.

Also, regarding the error in your last comment, please try this with the latest version of mikeio1d. The version you have installed (0.3.0) was not setup to check for mikeplus for compatibility, since that package actually didn't even exist then 😛

@BjoerndalM
Copy link
Author

Hey @ryan-kipawa, well thats quite interresting, and also kinda hope inducing.
Ill try updating python and mikeio1d as well as a fresh enviroment. ill let you know how it goes.
Thanks

@BjoerndalM
Copy link
Author

This may have done the trick.
So far i havent had a consistent result, but ive managed to run functions from both mikepyplus and mikeio1d in the same script run.
I had some issues with the clr import, but after i uninstalled clr and pythonnet and reinstalled pythonnet, i was able to get the correct clr import, which allowed for the use om the addReference function.
On one occasion, i would get the intended clr module on the first instance of the import clr, but if import clr was called again, it would import a different clr (the style version one i guess), and i would not be able to import the datatable access from mikeplus.

So nothing is super consistent yet, but like i said, i was just able to run the entire thing which is a first.
So all in all lets hope it stays that way

@ryan-kipawa
Copy link
Collaborator

Okay that's a positive step then. I'll leave this issue open for a while - feel free to add any additional details you think could help. I hope we're able to get a consistent result, especially with freshly installed environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants