HopkinsIDD / flepiMoP

The Flexible Epidemic Modeling Pipeline
https://flepimop.org
GNU General Public License v3.0
9 stars 4 forks source link

[Bug]: Missing `h5py` Dependency For `gempyor` #315

Closed TimothyWillard closed 2 days ago

TimothyWillard commented 2 months ago

Label

bug, gempyor, quick issue

Priority Label

low priority

Describe the bug/issue

When using the flepimop-calibrate cli tool this error occurs:

ImportError: you must install 'h5py' to use the HDFBackend

Solution should be to just add h5py to gempyor's dependencies.

To Reproduce

With a clean install of gempyor run:

(venv) twillard@epid-iss-mbp ~/D/G/H/flepiMoP (GH-191/longleaf-batch-submission)> flepimop-calibrate --config config_SMH_Rdisparity_phase_one_phase1_blk1_re_npis_CA-NC_emcee.yml --project_path /Users/twillard/Desktop/GitHub/HopkinsIDD/COVID19_Disparities/ --nwalkers 2 --nsamples 30  --jobs 1 --niterations 5 --id calib_local2
/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/venv/lib/python3.11/site-packages/dask/dataframe/__init__.py:42: FutureWarning:
Dask dataframe query planning is disabled because dask-expr is not installed.

You can install it with `pip install dask[dataframe]` or `conda install dask`.
This will raise in a future version.

  warnings.warn(msg, FutureWarning)
  gempyor >> Running ***DETERMINISTIC*** simulation;
  gempyor >> ModelInfo USA_inference_all; index: 1; run_id: calib_local2,
  gempyor >> prefix: USA_inference_all/calib_local2/;
Loaded subpops in loaded relative probablity file: 51 Intersect with seir simulation:  2 kept
Running Gempyor Inference
LogLoss: 5 statistics and 92 data points,number of NA for each statistic:
incidC_latino    62
incidC_other     25
incidC_asian     25
incidC_black     25
incidC_white     25
incidD_latino    46
incidD_other      0
incidD_asian      0
incidD_black      0
incidD_white      0
dtype: int64
InferenceParameters: with 78 parameters:
    seir_modifiers: 68 parameters
    outcome_modifiers: 10 parameters

Number of walkers be run: 2
test run successful 🎉, with logloss=-3946.4 including 0.0 for regularization (-0.0%)
writing to calib_local2_backend.h5
Traceback (most recent call last):
  File "/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/venv/bin/flepimop-calibrate", line 8, in <module>
    sys.exit(calibrate())
             ^^^^^^^^^^^
  File "/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/flepimop/gempyor_pkg/src/gempyor/calibrate.py", line 172, in calibrate
    backend = emcee.backends.HDFBackend(filename)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/twillard/Desktop/GitHub/HopkinsIDD/flepiMoP/venv/lib/python3.11/site-packages/emcee/backends/hdf.py", line 67, in __init__
    raise ImportError("you must install 'h5py' to use the HDFBackend")
ImportError: you must install 'h5py' to use the HDFBackend

Replacing paths/filenames with your relevant paths

Environment, if relevant

macOS 14.6.1, Python 3.11.9, last commit from main (on a branch): fb5a9c517f77ddfb0a734ff18e2404e94a546d7e