Skip to content

add yaml card management to ease production of full MISOMIP2 data set.#5

Open
pmathiot wants to merge 3 commits into
masterfrom
3-improvement-suggestion-use-a-yml-card-as-script-input-to-manage-processing-of-all-the-simulations
Open

add yaml card management to ease production of full MISOMIP2 data set.#5
pmathiot wants to merge 3 commits into
masterfrom
3-improvement-suggestion-use-a-yml-card-as-script-input-to-manage-processing-of-all-the-simulations

Conversation

@pmathiot

Copy link
Copy Markdown

close issue #3

@pmathiot

Copy link
Copy Markdown
Author

As I updated some identation, you can hide whitespace differences using the web interface (Files changed -> the wheel next to submit review -> hide whitespaces).

@pmathiot pmathiot self-assigned this May 28, 2026
@pmathiot pmathiot requested a review from nicojourdain May 28, 2026 13:48
@pmathiot pmathiot marked this pull request as draft May 28, 2026 14:00
@pmathiot pmathiot marked this pull request as ready for review May 28, 2026 14:18
@dgwyther

Copy link
Copy Markdown
Collaborator

@pmathiot

Just copying across my comments from the issue thread. I'm happy to merge the PR now if you want, or if you agree and want to add these changes before the PR merge I'm happy to merge after that.

  1. if run from the base directory, the yaml is not found.
(devel3.11) gadi-cpu-clx-1110: /g/data/jk72/deg581/amundsen-isom/ana/misomip2$ python examples/interpolate_to_common_grid_oce.py
card test_cases/oce/NEMO_test.yml not found

Maybe a variable can be set for the base directory path location, then update the load_arguments() accordingly:

analysis_path = '/Users/jourdain/MY_SCRIPTS'
sys.path.append(analysis_path)
...
misomip_path = analysis_path+"/misomip2/"
...
parser.add_argument("--config"  , type=str, default=misomip_path+'test_cases/oce/NEMO_test.yml', help="Path to YAML configuration file (optional).")

Alternatively, we could just direct the user to cd misomip2/examples first...

  1. It would be nicer to have a more upfront specification of the config file:
parser.add_argument("--config"  , type=str, default='test_cases/oce/NEMO_test.yml', help="Path to YAML configuration file (optional).")

Setting the default argument earlier on above the function definitions would make it clearer.

  1. The specification of the files looks like its a bit bespoke between models. e.g. NEMO has files as NEMO_m012_psi.nc (for example) while ROMS has files like ROMS_avg_1992.nc (for example). This could be hardcoded into the loading section:
f_ALL  = [data_dir+'/'+test_case+'_m0'+month.astype('str')+'.nc' for month in np.arange(1,4)]

        oce = mp.load_oce_mod_roms( files_M=f_grid, files_T=f_ALL, rho0=1026.0, teos10=False, region=reg )

But it might be nice to expand the yaml settings to specify more of the file name string. I know you have it so that data_dir and test_case are specified in the yaml, but it would be more general if the general format of the filename could be specified in the yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improvement suggestion: use a yml card as script input to manage processing of all the simulations

2 participants