Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDAT Migration Phase: Refactor cosp_histogram set #748

Merged
merged 34 commits into from
Jan 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3f22786
Add initial `cosp_histogram` refactor updates
tomvothecoder Oct 10, 2023
d21010c
Update Dataset derivation methods to support dataset-based funcs
tomvothecoder Dec 6, 2023
79f053e
Update e3sm_diags/derivations/formulas_cosp.py
tomvothecoder Dec 7, 2023
3964170
Fix cosp histogram funcs to add target var key to dataset
tomvothecoder Dec 7, 2023
b8c117d
Initial code for refactoring `cosp_bin_sum()`
tomvothecoder Dec 7, 2023
54a6ce4
Refactor `cosp_bin_sum()` function and variable names
tomvothecoder Dec 8, 2023
9e1eefe
Refactor common logic into `_get_dataset_with_derivation_func()`
tomvothecoder Dec 8, 2023
049537e
Update `cosp_bin_sum()` function args and type annotations
tomvothecoder Dec 9, 2023
eccbace
Fix incorrect arg passed to sim and cloud level funcs
tomvothecoder Dec 14, 2023
f18ed06
Update order of functions
tomvothecoder Dec 14, 2023
fff4c2e
Start refactoring `cosp_histogram_plot.py`
tomvothecoder Dec 14, 2023
a0212a8
Fix type annotation for `fig` arg
tomvothecoder Dec 14, 2023
5d7611f
Add FIXME comment to plot
tomvothecoder Dec 18, 2023
ae64002
Get plot function working
tomvothecoder Dec 21, 2023
3e23116
Fix unit tests failures
tomvothecoder Jan 3, 2024
4dfec98
Fix mypy errors
tomvothecoder Jan 3, 2024
3697374
Fix incorrect param object reference by copying
tomvothecoder Jan 3, 2024
bc1bc94
Fix type annotation
tomvothecoder Jan 3, 2024
196ae63
Remove unused functions in `utils.py`
tomvothecoder Jan 3, 2024
1b8139b
Remove #type ignore
tomvothecoder Jan 3, 2024
73edf2a
Update test scripts
tomvothecoder Jan 4, 2024
2b5d387
Update notebook and script
tomvothecoder Jan 5, 2024
127c5a9
Add "time" scalar workaround
tomvothecoder Jan 23, 2024
83790bd
Add keys for matching prs axis
tomvothecoder Jan 24, 2024
a89b68f
Set `decode_times=False` when opening climo dataset
tomvothecoder Jan 24, 2024
befd28a
Update regressiong testing notebook and script
tomvothecoder Jan 24, 2024
0b7a18d
Update `_write_vars_to_netcdf` to write individual files
tomvothecoder Jan 25, 2024
0ae2a46
Fix unit tests
tomvothecoder Jan 25, 2024
68f62e0
Update e3sm_diags/driver/cosp_histogram_driver.py
tomvothecoder Jan 29, 2024
091292c
Update template and base run scripts to always generate netCDF files
tomvothecoder Jan 29, 2024
22f7737
Fix incorrect glob in json notebook
tomvothecoder Jan 29, 2024
a314f9a
Update `cosp_histogram_standardize()` args
tomvothecoder Jan 30, 2024
67b1d4e
Apply suggestions from code review
tomvothecoder Jan 30, 2024
883dda4
Apply suggestions from code review
tomvothecoder Jan 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix mypy errors
  • Loading branch information
tomvothecoder committed Jan 24, 2024
commit 4dfec9854335fe2246291302e661441eb498374c
2 changes: 1 addition & 1 deletion e3sm_diags/derivations/formulas_cosp.py
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ def cosp_histogram_standardize(
# returns both objects and element 0 is the xr.Dataset that is needed.
ds_final: xr.Dataset = xr.align(ds_new, var_std)[0] # type: ignore
ds_final[target_var_key] = var_std
ds_final = ds_final.drop_vars(var.name)
ds_final = ds_final.drop_vars(str(var.name))

# TODO: These functions don't actually add missing cloud bounds yet
# because it is based on the logic from the legacy code, which does not