I've noticed this in the places where the various JSON schemas are being loaded, but this may be a problem elsewhere in the code. For example, see here: https://github.com/ImperialCollegeLondon/virtual_rainforest/blob/7f445d9e6fd729c7f398576ba51c30b5efda0e55/virtual_rainforest/models/plants/__init__.py#L11
The code looks something like this:
schema_file = Path(__file__).parent.resolve() / "plants_schema.json"
Intuitively, this should be correct, but unfortunately it doesn't work with all the weird and wonderful ways Python code can be packaged, so technically you should always use the importlib.resources module: https://docs.python.org/3/library/importlib.resources.html
I've noticed this in the places where the various JSON schemas are being loaded, but this may be a problem elsewhere in the code. For example, see here: https://github.com/ImperialCollegeLondon/virtual_rainforest/blob/7f445d9e6fd729c7f398576ba51c30b5efda0e55/virtual_rainforest/models/plants/__init__.py#L11
The code looks something like this:
Intuitively, this should be correct, but unfortunately it doesn't work with all the weird and wonderful ways Python code can be packaged, so technically you should always use the
importlib.resourcesmodule: https://docs.python.org/3/library/importlib.resources.html