alexlib / pivpy

PIVPy helps to understand PIV results, inspired by PIVMAT
http://pivpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
11 stars 8 forks source link

Bug: NameError: name 'warnings' is not defined #37

Closed shiba24 closed 2 years ago

shiba24 commented 2 years ago

Hi Alex, thank you for the library.

I'm trying your notebook (https://github.com/alexlib/openpiv_bos_velocimetry/blob/master/1_Example_BOS_PIV.ipynb) and found an error (by the way -- thank you for publishing your code!).

Versions

Log

>> python3 -c 'import pivpy; from pivpy import io'

Traceback (most recent call last):
  File "/Users/shiba24/work/venv_bos/lib/python3.9/site-packages/pivpy/io.py", line 13, in <module>
    import ReadIM
ModuleNotFoundError: No module named 'ReadIM'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/shiba24/work/venv_bos/lib/python3.9/site-packages/pivpy/io.py", line 15, in <module>
    warnings.warn('ReadIM is not available, do not read IM7 these files')
NameError: name 'warnings' is not defined

Can you take a look? For now, I checked that I can fix it by adding import warnings to io.py.

alexlib commented 2 years ago

you're just few days off :)

https://github.com/alexlib/pivpy/blob/6fcb1e2f25974b6930b8b5c1271c578e0c4c11ae/pivpy/io.py#L12

shiba24 commented 2 years ago

Ah thanks! Looking forward the next update.

alexlib commented 2 years ago

Ah thanks! Looking forward the next update.

you can always update using

pip install git+https://github.com/alexlib/pivpy --upgrade

I am not sure the next update is soon ;)

I've found some other work that uses xarray in a smarter way, thinking of some changes. sorry if it breaks your code - it definitely breaks mine :)