Skip to content

Commit

Permalink
BGC boundary and surface forcing + major refactoring (#79)
Browse files Browse the repository at this point in the history
* Extract common parts of initial conditions and boundary forcing and make it mixin class

* Transpose expected test data as a result of refactor

* Update notebook with .ds data_vars moved to attributes

* Minor fixes

* Add more metadata and adapt mixin for atmospheric forcing

* Refactor boundary_forcing to work with BGC

* Mask ERA5 data as part of post processing

* Break mixin functions into smaller pieces and add docstrings

* Make ERA5Correction inherit from Dataset class

* Adapt to changes in ROMSMixin

* Add BGC boundary forcing

* Add BGC boundary forcing tests

* Update notebook that showcases BGC boundary forcing creation

* Rename mixin class

* Refactor AtmosphericForcing and automate SWR correction

* Add xarray-datatree to dependencies

* Adapt SWR tests and move them as fit

* Fix typo

* Add CESMBGCSurfaceForcingDataset and handle adding time info to Dataset

* Default climatology to True for BGC initial condition data

* Reformatting

* Add surface BGC metadata

* Add function that converts from cftime to datetime

* Download CESM surface test data

* Introduce absolute time and handle clim saving separately

* Add BGC surface forcing

* One parent class for CESM

* Surface BGC tests

* Correct filepaths

* Fix issue with time dimension

* Include units in long_name of time variable

* Add regression test for BGC clim data

* Add utils tests to github workflows

* Rename AtmosphericForcing --> SurfaceForcing

* Rename AtmosphericForcing --> SurfaceForcing

* Use tempfile with delete=True to not clutter temp space

* Write physics and BGC fields in parallel

* Change units in long name

* Merge

* Update notebooks

* Update notebooks

* Remove forcing file

* Add more docstrings to plotting function

* Fix typo for test module name
  • Loading branch information
NoraLoose authored Aug 19, 2024
1 parent 53c1c0f commit 6e5dc5b
Show file tree
Hide file tree
Showing 25 changed files with 35,643 additions and 13,463 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
shell: bash -l {0}
run: |
python -V
coverage run --rcfile=coverage.toml -m pytest --verbose roms_tools/tests/test_datasets.py roms_tools/tests/test_grid.py roms_tools/tests/test_topography.py roms_tools/tests/test_tides.py roms_tools/tests/test_atmospheric_forcing.py roms_tools/tests/test_initial_conditions.py roms_tools/tests/test_vertical_coordinate.py roms_tools/tests/test_boundary_forcing.py
coverage run --rcfile=coverage.toml -m pytest --verbose roms_tools/tests/test_datasets.py roms_tools/tests/test_grid.py roms_tools/tests/test_topography.py roms_tools/tests/test_tides.py roms_tools/tests/test_surface_forcing.py roms_tools/tests/test_initial_conditions.py roms_tools/tests/test_vertical_coordinate.py roms_tools/tests/test_boundary_forcing.py roms_tools/tests/test_utils.py
- name: Get coverage report
shell: bash -l {0}
Expand Down
1 change: 1 addition & 0 deletions ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- matplotlib
- cartopy
- xarray
- xarray-datatree
- netcdf4
- pooch
- packaging
Expand Down
7 changes: 3 additions & 4 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ Tidal Forcing

roms_tools.TidalForcing

Atmospheric Forcing
--------------------
Surface Forcing
----------------

.. autosummary::
:toctree: generated/

roms_tools.AtmosphericForcing
roms_tools.SWRCorrection
roms_tools.SurfaceForcing

Initial Conditions
--------------------
Expand Down
Loading

0 comments on commit 6e5dc5b

Please sign in to comment.