Skip to content

Commit

Permalink
CDAT Migration Phase 2: Regression testing for lat_lon, `lat_lon_la…
Browse files Browse the repository at this point in the history
…nd`, and `lat_lon_river` (#744)

- Add Makefile that simplifies common development commands (building and installing, testing, etc.)
- Write unit tests to cover all new code for utility functions
  - `dataset_xr.py`, `metrics.py`, `climo_xr.py`, `io.py`, `regrid.py`
- Metrics comparison for  `cdat-migration-fy24` `lat_lon` and `main` branch of `lat_lon` -- `NET_FLUX_SRF` and `RESTOM` have the highest spatial average diffs
- Test run with 3D variables (`_run_3d_diags()`)
  - Fix Python 3.9 bug with using pipe command to represent Union -- doesn't work with `from __future__ import annotations` still
  - Fix subsetting syntax bug using ilev
  - Fix regridding bug where a single plev is passed and xCDAT does not allow generating bounds for coordinates of len <= 1 -- add conditional that just ignores adding new bounds for regridded output datasets, fix related tests
  - Fix accidentally calling save plots and metrics twice in `_get_metrics_by_region()`
- Fix failing integration tests pass in CI/CD
  - Refactor `test_diags.py` -- replace unittest with pytest
  - Refactor `test_all_sets.py` -- replace unittest with pytest
  - Test climatology datasets -- tested with 3d variables using `test_all_sets.py`
  • Loading branch information
tomvothecoder committed Nov 29, 2023
1 parent 5000150 commit ce8810b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion e3sm_diags/driver/lat_lon_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
# type of metrics and the value is a sub-dictionary of metrics (key is metrics
# type and value is float). There is also a "unit" key representing the
# units for the variable.
MetricsDict = Dict[str, str | Dict[str, float | None | List[float]]]
UnitAttr = str
MetricsSubDict = Dict[str, Union[float, None, List[float]]]
MetricsDict = Dict[str, Union[UnitAttr, MetricsSubDict]]

if TYPE_CHECKING:
from e3sm_diags.parameter.core_parameter import CoreParameter
Expand Down

0 comments on commit ce8810b

Please sign in to comment.