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

Print settings #137

Merged
merged 1 commit into from
Sep 29, 2021
Merged

Print settings #137

merged 1 commit into from
Sep 29, 2021

Conversation

forsyth2
Copy link
Collaborator

@forsyth2 forsyth2 commented Sep 22, 2021

Print settings in each generated script. Resolves #121

@forsyth2 forsyth2 added semver: new feature New feature (will increment minor version) for next version labels Sep 22, 2021
@forsyth2 forsyth2 requested a review from golaz September 22, 2021 23:34
@forsyth2 forsyth2 self-assigned this Sep 22, 2021
@forsyth2 forsyth2 marked this pull request as draft September 22, 2021 23:35
@forsyth2
Copy link
Collaborator Author

@golaz This code prints the settings for the E3SM Diags tasks. If you like this format, I can implement the same thing for the other tasks and merge.

Example output: e3sm_diags_atm_monthly_180x360_aave_model_vs_obs_1985-2014.settings:

{ 'active': True,
  'backend': 'mpl',
  'case': 'v2.LR.historical_0201',
  'cfg': '',
  'climo_diurnal_subsection': 'atm_monthly_diurnal_8xdaily_180x360_aave',
  'dc_obs_climo': '/lcrc/group/e3sm/public_html/e3sm_diags_test_data/unit_test_complete_run/obs/climatology',
  'debug': False,
  'diff_title': 'Model - Observations',
  'dry_run': False,
  'e3sm_unified': 'latest',
  'environment_commands': 'source '
                          '/home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; '
                          'conda activate e3sm_diags_env_dev_20210827',
  'grid': '180x360_aave',
  'input': '/lcrc/group/e3sm/ac.forsyth2/E3SMv2/v2.LR.historical_0201',
  'input_subdir': 'archive/atm/hist',
  'machine': 'chrysalis',
  'multiprocessing': True,
  'nodes': 1,
  'num_workers': 24,
  'obs_ts': '/lcrc/soft/climate/e3sm_diags_data/obs_for_e3sm_diags/time-series',
  'output': '/lcrc/group/e3sm/ac.forsyth2/zppy_development/issue_121.v2.LR.historical_0201',
  'output_format': ['png'],
  'output_format_subplot': ['pdf'],
  'partition': 'debug',
  'prefix': 'e3sm_diags_atm_monthly_180x360_aave_model_vs_obs_1985-2014',
  'qos': 'regular',
  'ref_final_yr': '2014',
  'ref_start_yr': '1985',
  'reference_data_path': '/lcrc/soft/climate/e3sm_diags_data/obs_for_e3sm_diags/climatology',
  'run_type': 'model_vs_obs',
  'scriptDir': '/lcrc/group/e3sm/ac.forsyth2/zppy_development/issue_121.v2.LR.historical_0201/post/scripts',
  'sets': [ 'lat_lon',
            'zonal_mean_xy',
            'zonal_mean_2d',
            'polar',
            'cosp_histogram',
            'meridional_mean_2d',
            'enso_diags',
            'qbo',
            'diurnal_cycle',
            'annual_cycle_zonal_mean',
            'streamflow'],
  'short_name': 'v2.LR.historical_0201',
  'streamflow_obs_ts': '/lcrc/group/e3sm/public_html/e3sm_diags_test_data/unit_test_complete_run/obs/time-series/',
  'subsection': 'atm_monthly_180x360_aave',
  'tag': 'model_vs_obs',
  'templateDir': '/home/ac.forsyth2/miniconda3/envs/zppy_dev_20210825/lib/python3.7/site-packages/zppy/templates',
  'ts_num_years': 10,
  'vars': 'FSNTOA,FLUT,FSNT,FLNT,FSNS,FLNS,SHFLX,QFLX,TAUX,TAUY,PRECC,PRECL,PRECSC,PRECSL,TS,TREFHT,CLDTOT,CLDHGH,CLDMED,CLDLOW,U',
  'walltime': '02:00:00',
  'www': '/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_development/issue_121/',
  'year1': 1985,
  'year2': 2014,
  'years': ['1985-2014']}
(1985, 2014)

@forsyth2 forsyth2 marked this pull request as ready for review September 23, 2021 22:37
@forsyth2
Copy link
Collaborator Author

forsyth2 commented Sep 23, 2021

Note: If we keep the settings printing outside the if not c["dry_run"]: block (which I think would be useful as it would allow dry-run tests to produce the list of settings), then we'd also need to update the expected files for the zppy/tests/integration/test_bash_generation.py test.

@forsyth2
Copy link
Collaborator Author

Yes, keep the printing outside the if not c["dry_run"]: block, so settings always print.

We may want to create a function for printing the settings at some point, but not necessary now.

zppy/tests/integration/test_bash_generation.py will need to have expected files updated.

Copy link
Collaborator

@golaz golaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@forsyth2 forsyth2 merged commit 9d814ff into E3SM-Project:main Sep 29, 2021
@forsyth2 forsyth2 deleted the print-settings branch September 29, 2021 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: new feature New feature (will increment minor version)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print all settings in each generated script
2 participants