-
Notifications
You must be signed in to change notification settings - Fork 15
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
zppy-interfaces refactor #642
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xylar @chengzhuzhang Following up from E3SM-Project/zppy-interfaces#1 (review), the major changes on the zppy
side so far are:
- Better organization of the
zppy/templates
directory:.bash
files remain inzppy/templates
.- Defaults (
default.ini
, campaigncfg
s) are now inzppy/defaults
. - The
global_time_series
.py
files have been moved tozppy-interfaces/global-time-series
, outside of this repo entirely. e3sm_diags/lat_lon_conus.cfg
didn't appear to be used anywhere, so I createdzppy/examples
to house that.- Some files are included into the bash templates, so I've placed these in
zppy/templates/inclusions
- As mentioned in Initial implementation zppy-interfaces#1 (comment), the
.bash
template for Global Time Series has been greatly simplified by moving much of that code over to Python inzppy-interfaces
.
exit 6 | ||
fi | ||
|
||
zppy-interfaces global-time-series --use_ocn={{ use_ocn }} --global_ts_dir={{ global_time_series_dir }} --input={{ input }} --input_subdir={{ input_subdir }} --moc_file={{ moc_file }} --case_dir={{ output }} --experiment_name={{ experiment_name }} --figstr={{ figstr }} --color={{ color }} --ts_num_years={{ ts_num_years }} --plots_original={{ plots_original }} --atmosphere_only={{ atmosphere_only }} --plots_atm={{ plots_atm }} --plots_ice={{ plots_ice }} --plots_lnd={{ plots_lnd }} --plots_ocn={{ plots_ocn }} --regions={{ regions }} --start_yr={{ year1 }} --end_yr={{ year2 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your idea of a config file instead of this. It would be good to break the command into multiple lines with \
for better readability if you do keep this approach.
Yep, so far, I like the changes you're proposing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! Just a few comments that don't need addressing in this PR.
@@ -0,0 +1,67 @@ | |||
"""Logger module for setting up a logger. Based on xcdat/xcdat/_logger.py""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant with https://github.com/E3SM-Project/zppy-interfaces/blob/initial-implementation/zppy_interfaces/multi_utils/logger.py but I think that's pretty hard to avoid.
Still, worth keeping an eye on this kind of redundancy and having a backup plan if it gets bad.
@@ -34,6 +34,7 @@ years = "1985:1995:5", | |||
|
|||
[global_time_series] | |||
active = True | |||
environment_commands = "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zppy_interfaces_dev_pr_1_20241121v4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably, this will be removed once there are shared environments that support zppy-interfaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, realistically this will remain because we'll always want to test zppy
with the latest zppy-interfaces
code, not whatever the last release was. But yes, for cfg
s written by users they could rely on Unified having zppy-interfaces
in it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I see is that this environment is only on Chrysalis (or Anvil). What if you want to test somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is this just a placeholder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think it is a little odd to have machine and user specific path here, but don't know how to get around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we could use $USER
to get my name out of it but ultimately whoever runs this cfg will need to create their own conda environment for the latest developments or else use Unified.
I think maybe the best solution is to always keep the environment_commands
lines on the main
branch filled in as <path to YOUR conda>; conda activate <environment YOU create>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, the commit dbd74f3 implements the idea I mentioned in the previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like it would be better to have some examples somewhere but not to update them very often. This is the approach we use in MPAS-Analysis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with that is I fear they will very quickly go out-of-date. This approach (the auto-generation of scripts from templates) updates everything together.
@forsyth2 this .cfg file is actually referenced here: https://github.com/E3SM-Project/zppy/blob/408e9ade87db8d0d5322c01186564df1392282be/docs/source/post.rrm_simulation.cfg#L59C1-L62C39 |
@chengzhuzhang Ah thank you. Ok, so this should actually be included under |
@chengzhuzhang The commit be06191 addresses your comment. |
Issue resolution