fixing GLC jupyter notebook#398
Conversation
- in config.yml, add the option for the init_file - in the jupyter notebook, removed the hard coded dependency on the init_file, and fixed the range for plotting the time series.
|
@gunterl -- Do you mind if I push some changes to your branch just to get it to pass the automated testing done by github? |
|
@mnlevy1981 not at all, thanks for looking at this. |
Needed to pass the CI testing on github
mnlevy1981
left a comment
There was a problem hiding this comment.
The update to add init_file is great; I have some comments about how you modified the plot limits, but the only important point is the one about what happens when base_case_name = None.
| "print(f\"avg_smb_case_climo, has shape {np.shape(avg_smb_case_climo)}\")\n", | ||
| "print(f\"avg_smb_case_timeseries has shape {np.shape(avg_smb_case_timeseries)}\")\n", | ||
| "print(f\"avg_smb_base_case_climo has shape {np.shape(avg_smb_base_case_climo)}\")\n", | ||
| "print(f\"avg_smb_base_timeseries has shape {np.shape(avg_smb_base_timeseries)}\")\n", | ||
| "print(f\"avg_smb_obs_timeseries has shape {np.shape(avg_smb_obs_timeseries)}\")\n", |
There was a problem hiding this comment.
@gunterl do you want these print statements to remain, or were they just part of some debugging while you set up numpy calls to compute ymin1, ymin2, ymax1, and ymax2?
| "ymin1 = np.array(\n", | ||
| " [avg_smb_base_case_climo, avg_smb_base_timeseries, avg_smb_obs_timeseries]\n", | ||
| ").min()\n", | ||
| "ymin2 = np.array([avg_smb_case_climo, avg_smb_case_timeseries]).min()\n", | ||
| "ymax1 = np.array(\n", | ||
| " [avg_smb_base_case_climo, avg_smb_base_timeseries, avg_smb_obs_timeseries]\n", | ||
| ").max()\n", | ||
| "ymax2 = np.array([avg_smb_case_climo, avg_smb_case_timeseries]).max()\n", | ||
| "\n", | ||
| "ymin = np.array([ymin1, ymin2]).min() - 50\n", | ||
| "ymax = np.array([ymax1, ymax2]).max() + 50\n", |
There was a problem hiding this comment.
I think you're going to run into problems with ymin1 and ymax2 if base_case_name is None; also, if you just want biggest / smallest values from three (or five) arrays, you can do something like
all_data = np.concatenate([avg_smb_case_climo, avg_smb_case_timeseries, avg_smb_obs_timeseries])
if base_case_name:
all_data = np.concatenate([all_data, avg_smb_base_case_climo, avg_smb_base_timeseries])
ymin = all_data.min() - 50.
ymax = all_data.max() + 50.|
@gunterl there are two outstanding comments to address -- should we keep the print statements, and can we clean up the logic behind |
Description of changes:
All PRs Checklist:
pre-commitchecks passed (#8 in Adding Notebooks Guide)?New notebook PR Additional Checklist (if these do not apply, feel free to remove this section):
parameters? These can cause confusing warnings that show up asDAG build with warnings./glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_dataand ensured that it follows this format within that directory:COMPONENT/analysis_datasets/RESOLUTION/PROCESSED_FIELD_TYPE?