Skip to content

Conversation

@xaviernogueira
Copy link
Contributor

@xaviernogueira xaviernogueira commented Aug 29, 2023

Changes:

  • Moved all TSM equations into their own numba JIT functions.
  • Pulled constants out into typed dictionaries in their own module.
  • Wrote a pyproject.toml file that works and allows the modules to be installed via pip install .
  • Separated tests into a directory that should be passing, and a directory to store deprecated tests. All tests in /tests should be passing or in active development (currently empty).
  • Updated the conda environment.yml file to include pytest and pyright, which is what I am using for static analysis.
  • Made all arguments lower case for consistency and improved syntax highlighting (upper case assumes they are types not values).

Note that I implemented the model in another branch XRN_xarray_simlab. There I am exploring refactor design options (see below).

Next steps:

  • @aufdenkampe (anyone can do this) pull out all equations used within other modules (NSM, GSM) into numba JIT functions following the pattern demonstrated in tsm/equations.py. I will loop back to this once figure out the architecture for xarray-simlab, but regardless we will need these functions JITed as I plan on using xarray.apply_ufunc(parallelize=True) where the numba functions are applied across xarray dataarrays.
  • I need to finish implementing xarray-simlab. As I look closer, it is worth using the framework, as the idea I had to work with xarray without it is largely similar.
  • Write tests for TSM. To leverage the existing answers I was thinking of making a 1 cell xarray and testing on that.

@xaviernogueira xaviernogueira merged commit 834c0c9 into main Aug 29, 2023
@xaviernogueira xaviernogueira deleted the XRN_tsm_refactor branch August 29, 2023 20:31
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

Successfully merging this pull request may close these issues.

2 participants