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

Matplotlib version parsing crashes import #344

Closed
jhtu opened this issue Aug 9, 2024 · 2 comments
Closed

Matplotlib version parsing crashes import #344

jhtu opened this issue Aug 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jhtu
Copy link

jhtu commented Aug 9, 2024

Describe the bug:

If MHKiT happens to be installed in an environment with a version of Matplotlib what contains non-integer characters (e.g., version 3.9.1.post1), then MHKiT will crash on import because it tries to parse the version number by splitting it apart at the decimal places, then casting each part to an int. That leads to ValueError: invalid literal for int() with base 10: 'post1' from line 14 of mhkit/wave/contours.py.

To Reproduce:

$ python3 -m venv mhkit_bug
$ source mhkit_bug/bin/activate
$ pip install mhkit matplotlib==3.9.1.post1
$ python3 -c "from mhkit import contours"

Expected behavior:

It should be possible to import MHKiT without raising a ValueError.

@ssolson ssolson self-assigned this Aug 9, 2024
@ssolson ssolson added the bug Something isn't working label Aug 9, 2024
@ssolson
Copy link
Contributor

ssolson commented Aug 9, 2024

@jhtu thank you for your interest in MHKiT and bringing this to our attention.

I have patched this in #345 which I will get a new release out as soon as the tests pass.

@ssolson ssolson mentioned this issue Aug 13, 2024
@ssolson
Copy link
Contributor

ssolson commented Aug 14, 2024

Fixed in MHKiT v0.8.2 (#347 )

@ssolson ssolson closed this as completed Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants