cryotools / cosipy

Coupled snowpack and ice surface energy and mass balance model in Python
GNU General Public License v3.0
52 stars 30 forks source link

Release 2.0 #68

Closed gampnico closed 3 days ago

gampnico commented 5 months ago

This release is not backwards-compatible with previous versions of COSIPY!

Tested on Ubuntu 22.04 & 24.04, Python 3.9 to 3.12, with and without Slurm.

Main Features:

Breaking Changes:

Details

Critical Bug Fixes

Configuration

Configuration system now uses .toml files. You can now run multiple simulations from the same root directory. You can now select from multiple configuration files in any directory via optional user arguments:

python COSIPY.py -c <config.toml> -x <constants.toml> -s <slurm_config.toml>

This system is not backwards-compatible, but you can convert your existing configuration files:

git fetch --all
git checkout master -- convert_config.py
python convert_config.py  # generate .toml files

If you have custom scripts importing constants or config variables, these will break. Look at densification.py to see how these are now implemented: if you want to access constants or config variables within an njitted function, these must be declared at the module level. Otherwise, replace import constants with from cosipy.constants import Constants.

Packaging

COSIPY now supports pip installation as a package or editable. This centralises the file hierarchy, so utilities and postprocessing are now under cosipy. Installing COSIPY as a package or editable adds entry points to simplify your workflow. View these using cosipy-shortcuts.

When running COSIPY from source, you will need to modify your commands, e.g.:

python -m cosipy.utilities.create_static.create_static_file

Optimisations

Documentation

CI workflow

Code pushed to master or release branches is automatically tested with python 3.9-3.12 on Ubuntu.

Fixes #8, fixes #9, fixes #42, fixes #64. Closes #59, closes #66.