-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature #2924 parse_config #2963
Conversation
…eparately from each obs.field entry because the obs dictionary does not exist in the GenEnsProd config file.
…can perform lookups for the parent.
…s that retrieve the climatology data. Rather than requiring all the climo_mean and climo_stdev dictionary entries to be defined at the same config file context level, parse each one individually. This enables the METplus wrappers to only partially override this dictionary and still rely on the default values provided in MET's default configuration files.
…d on the new function signature. Also update the tools to check the number of climo fields separately for the forecast and observation climos.
Converting this PR to a draft to investigate unexpected differences flagged by the GHA testing workflow. |
…nary. Use config.fcst.climo_mean.regrid first, config.fcst.regrid second, and config.climo_mean.regrid third. Notably, DO NOT use config.regrid. This is definitely the problem with having regrid specified at mutliple config file context levels. It makes the logic for which to use when very messy.
… the climatology regridding logic inside fcst is problematic because it applies to the forecast data as well and you end up with the verification grid being undefined. So the climo regridding logic must be defined in 'climo_mean.regrid' either within the 'fcst' and 'obs' dictionaries or at the top-level config context.
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've reviewed the changed files, as well as performed the tests indicated in the PR. I confirmed that the various settings of climo_mean and climo_stdev libraries are now pulled independently, ignoring the levels at which the other settings appear. This logic should now allow users to take advantage of the new read-in abilities for climatology while removing the requirement to adjust all configuration files to a certain style (i.e. the climo dictionaries are moved to the fcst and obs dictionaries).
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'm getting some errors that I didn't expect when running your tests after modifying the config file. The changes below are in seneca:/d1/projects/MET/MET_pull_requests/met-12.0.0/beta6/MET-feature_2924_parse_config/internal/test_unit/config/GridStatConfig_climo_FCST_NCEP_1.0DEG_OBS_WMO_1.5DEG
I would expect to be able to set fcst.climo_mean.regrid.method without any of the other fcst.climo_mean.regrid values. If I set:
regrid = {
method = UPPER_LEFT;
}
I get:
ERROR : Dictionary::lookup_int() -> lookup failed for name "width"
If I add, width:
regrid = {
method = UPPER_LEFT;
width = 3;
}
I get:
ERROR : met_regrid() -> bad interpolation method ... UPPER_LEFT
but I see UPPER_LEFT as a valid regrid.method in the documentation.
…t, Upper_Right, Lower_Right, and Lower_Left interpolation methods to the list of valid options for regridding, as already indicated in the MET User's Guide.
…e it work the way @georgemccabe expects it to. It now uses pointers to both the primary and default dictionaries and parses each entry individually.
Thanks for the feedback @georgemccabe. I did update the logic in I do understand why you're getting the other error based on the current set of changes. While I had updated the logic for parsing the |
@georgemccabe thanks for your review. I've finished addressing the issues you've raised and re-requested your review on this PR. I'd like to point you to:
|
@georgemccabe OK I pushed more changes to this
|
…ing' log message to avoid confusion.
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 reviewed the test log after more changes were made and everything looks good. Thanks for iterating on this!
Thanks @georgemccabe and @j-opatz for the feedback on this PR. I'll proceed with merging and will monitor the downstream METplus Use Case runs to see if any output unexpectedly changes. |
Expected Differences
This pull request changes the logic for how the
climo_mean
andclimo_stdev
dictionaries are parsed. These dictionaries consist of several entries (file_name, field, regrid, time_interp_method, day_interval, hour_interval). Currently all of these entries must be defined within the same dictionary at the same config file context level.This pull request modifies the logic so that each entry is parsed separately. So while the
field
information may be parsed from config file contextfcst.climo_mean.field
, iffcst.climo_mean.day_interval
is not defined, the default value inclimo_mean.day_interval
will be used instead.This change simplifies the logic for the METplus wrappers. Instead of needing to override ALL climo settings, it now only needs to override the ones explicitly set in the METplus configuration file. And if left unspecified, the default values defined in the default MET configuration file for each tool will be used instead.
Do these changes introduce new tools, command line arguments, or configuration file options? [No]
If yes, please describe:
Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [No]
If yes, please describe:
Pull Request Testing
Describe testing already performed for these changes:
Please note that I added a
DEBUG(5)
log message to report the criteria used when searching for climatology data. I reran thexml/unit_climatology_mixed.xml
test several times manually, increasing the verbosity level to 5, writing to a log file, and manually modifying theclimo_mean
andclimo_stdev
settings inGridStatConfig_climo_FCST_NCEP_1.0DEG_OBS_WMO_1.5DEG
and confirming the expected changes appear in that log message.Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
Please find this code compiled by the
met_test
user inseneca:/d1/projects/MET/MET_pull_requests/met-12.0.0/beta6/MET-feature_2924_parse_config
. Recommend testing in a similar way as described above:Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [No]
None needed.
Do these changes include sufficient testing updates? [No]
None needed.
Will this PR result in changes to the MET test suite? [No]
If yes, describe the new output and/or changes to the existing output:
Will this PR result in changes to existing METplus Use Cases? [No]
If yes, create a new Update Truth METplus issue to describe them.
Do these changes introduce new SonarQube findings? [TBD]
If yes, please describe:
Please complete this pull request review by [Monday, 9/9/24].
Pull Request Checklist
See the METplus Workflow for details.
Select: Reviewer(s) and Development issue
Select: Milestone as the version that will include these changes
Select: Coordinated METplus-X.Y Support project for bugfix releases or MET-X.Y.Z Development project for official releases