Add dataset_xr.Dataset._open_climo_dataset() method with a catch for dataset quality issues where "time" is a scalar variable that does not match the "time" dimension array length, drops this variable and replaces it with the correct coordinate
Update _get_dataset_with_derivation_func() to handle derivation functions that require the xr.Dataset and target_var_key args (e.g., cosp_histogram_standardize() and cosp_bin_sum())
io.py
Update _write_vars_to_netcdf() to write test, ref, and diff variables to individual netCDF (required for easy comparison to CDAT-based code that does the same thing)
Checklist
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] My changes generate no new warnings
[x] Any dependent changes have been merged and published in downstream modules
If applicable:
[x] New and existing unit tests pass with my changes (locally and CI/CD build)
[x] I have added tests that prove my fix is effective or that my feature works
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)
Moved cosp_histogram_standardize() and cosp_bin_sum() to formulas_cosp.py
Both derivation functions require either/both ds: xr.Dataset and target_var_key: str arguments
Updated Dataset._get_dataset_with_derived_climo_var() and Dataset._get_dataset_with_derived_ts_var() to accomodate derivation functions requiringds and target_var_key args
[x] Add unit tests for 100% coverage for refactored utilities
Description
This PR refactors the
cosp_histogram
set.Summary of Changes
cdat_migration_regression_test_netcdf.ipynb
validation notebook template for comparing.nc
filescosp_histogram_driver.py
andcosp_histogram_plot.py
formulas_cosp.py
(new file)cosp_histogram_standard()
andcosp_bin_sum()
functionsformulas_cosp.py
to clean upderivations.py
and the old equivalent functions inutils.py
derivations.py
,DERIVED_VARIABLES
dictionaryOrderedDict
usage forcosp_histogram
related variables (we should do this for the rest of the variables in in #716)convert_units()
function callsformulas_cosp.CLOUD_BIN_SUM_MAP
utils.py
cosp_histogram
functionsdataset_xr.py
dataset_xr.Dataset._open_climo_dataset()
method with a catch for dataset quality issues where "time" is a scalar variable that does not match the "time" dimension array length, drops this variable and replaces it with the correct coordinate_get_dataset_with_derivation_func()
to handle derivation functions that require thexr.Dataset
andtarget_var_key
args (e.g.,cosp_histogram_standardize()
andcosp_bin_sum()
)io.py
_write_vars_to_netcdf()
to write test, ref, and diff variables to individual netCDF (required for easy comparison to CDAT-based code that does the same thing)Checklist
If applicable:
Implementation TODO List
auxiliary_tools/cdat_regression_testing/660-cosp-histogram
cosp_histogram_driver.py
)derivations/formulas.py
)cosp_histogram_standardize()
andcosp_bin_sum()
toformulas_cosp.py
ds: xr.Dataset
andtarget_var_key: str
argumentsDataset._get_dataset_with_derived_climo_var()
andDataset._get_dataset_with_derived_ts_var()
to accomodate derivation functions requiringds
andtarget_var_key
argscosp_histogram_plot.py
)