lifewatch / pypam

Python Passive Acoustic Analysis tool for Passive Acoustic Monitoring (PAM)
GNU General Public License v3.0
41 stars 8 forks source link

Explicit h5netcdf dependency needed? #52

Closed carueda closed 1 year ago

carueda commented 1 year ago

In general, I've been having trouble making tests pass as they used to on my local environment. Don't get me wrong; I know lots of updates have been happening arising from the migration to poetry and associated cleanup (which is great).

Anyway, here's the situation, with tests/test_dataset.py as an example:

poetry run pytest tests/test_dataset.py

fails with:

ValueError: found the following matches with the input file in xarray's IO backends: 
  ['netcdf4', 'h5netcdf']. But their dependencies may not be installed, see: ...

But if I install h5netcdf:

poetry run pip install h5netcdf

then the test completes ok.

cparcerisas commented 1 year ago

Yes usually netcdf4 was a dependency which should be installed, and it is the package I use for testing. Does the problem also solve if you install netcdf4?

carueda commented 1 year ago

@cparcerisas Yes, the test also passes if I install netcdf4 instead:

poetry run pip uninstall h5netcdf
poetry run pip install netcdf4
PYPAM_TEST_NO_PLOTS= poetry run pytest tests/test_dataset.py
...
collected 1 item

tests/test_dataset.py .                                                                                                                                                                                                         [100%]

============================ warnings summary =====================
...
================= 1 passed, 6 warnings in 4.66s ==========
cparcerisas commented 1 year ago

ok I will add netcdf4 as a needed dependency