icubam / icubam

ICU Bed Activity Monitor
Apache License 2.0
32 stars 11 forks source link

Language dependent resources #296

Open rth opened 4 years ago

rth commented 4 years ago

To keep ICUBAM generic and not specific to France we should avoid any hard-coded ressources. In particular, we should move icubam/predicu/data maybe to some language specific path.

One thing I don't understand about the current resources folder, is that tests use relative paths e.g. resources/test.toml meaning that if python is started from a different folder than ICUBAM root directory, it will not work.

For instance,

cd /tmp/
pytest --pyargs icubam -k config

currently fails with

E       Exception: Couldn't find INI file: resources/test.toml

That's OK as long as it's only test config files, but that would not be acceptable with actual data ressources.

I think we might want to have,

WDYT? cc @olivierteboul

dulacarnold commented 4 years ago

Yeah, I'm not sure how to set test resource file paths otherwise, any suggestions?

rth commented 4 years ago

For test data, I think we should put it under icubam/resources/test or icubam/data/test, define e.g. TEST_DATA_PATH with respect to __file__ in icubam/data/__init__.py and use paths with respect to this base directory in tests.