Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spadesCBM-Python #16

Open
cboisvenue opened this issue Sep 24, 2024 · 1 comment
Open

spadesCBM-Python #16

cboisvenue opened this issue Sep 24, 2024 · 1 comment

Comments

@cboisvenue
Copy link
Contributor

cboisvenue commented Sep 24, 2024

Problems:
a. Users have to install Python: need to decide where to load Python, reticulate, and libcbm (Python package). Users without any Python installation will present a different solution to the ones that have one or multiple installations.
b. Users have to setup Python environments to work with R environments correctly - where we decide to load a., will determine what we do here.
c. Accessing the functions is slow - need to check this.
d. The functions add a layer of opacity to the code - documentation on the Python side for all libcbm calls needed.

@cboisvenue
Copy link
Contributor Author

There is some documentation that could be useful on the Python side:
https://cat-cfs.github.io/libcbm_py/index.html
with these two being more relevant to us: cbm_exn.html, Fully dynamic modelling with cbm_exn

these are all of the libcbm requirements so it may require a few more tweaks
https://github.com/cat-cfs/libcbm_py/blob/main/requirements.txt
requirements.txt
cat-cfs/libcbm_py
looks like this is still an issue related to that recent numpy2.0 release , it may be a bit of time before things fully stabilize around that version as far as other packages.

we will have to tweak the package versions until we find ones taht work...can we try to tweak package versions like this:

#install the latest numpy < 2.0
reticulate::py_install("numpy==1.26.4", envname = "r-reticulate")
reticulate::py_install("pandas==2.2.2", envname = "r-reticulate")

the entire script to pull out those CSV files that get used by cbm_exn is here. Is that what you mean?
https://github.com/cat-cfs/libcbm_py/blob/main/libcbm/model/cbm_exn/parameters/parameter_extraction.py
this script queries the cbm_defaults db and drops references to softwood and hardwood specific pools and fluxes and expands to hardwood/softwood specific disturbance matrices, decay rates, turnover parameters
cat-cfs/libcbm_py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant