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

Update the PB2NC configuration to correct the obs_prefbufr_map name as obs_prepbufr_map. #2044

Closed
22 tasks
hsoh-u opened this issue Feb 9, 2022 · 3 comments · Fixed by #2050
Closed
22 tasks
Assignees
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue MET: PreProcessing Tools (Point) requestor: METplus Team METplus Development Team required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone type: enhancement Improve something that it is currently doing
Milestone

Comments

@hsoh-u
Copy link
Collaborator

hsoh-u commented Feb 9, 2022

Replace italics below with details for this issue.

Describe the Problem

Provide a clear and concise description of the bug here.

The configuration name "obs_prefbufr_map" should be renamed to "obs_prefbufr_map".

  • update it in all the config file (under the met and test directories)
  • update any "pref" variable names in the MET code base
  • update "pref" in the user's guide
  • print a warning message alerting the user that the name should be changed to "obs_prepbufr_map" If "obs_prefbufr_map" is present in the config file.
  • use it's value instead of "obs_prepbufr_map" if "obs_prefbufr_map" is defined

Will do it for the develop branch, not main_v10.0.

Expected Behavior

Provide a clear and concise description of what you expected to happen here.

For the backward compatibility support both "obs_prefbufr_map" and "obs_prefbufr_map".

Environment

Describe your runtime environment:
1. Machine: (e.g. HPC name, Linux Workstation, Mac Laptop)
2. OS: (e.g. RedHat Linux, MacOS)
3. Software version number(s)

To Reproduce

Describe the steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Post relevant sample data following these instructions:
https://dtcenter.org/community-code/model-evaluation-tools-met/met-help-desk#ftp

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Select Organization level Project for support of the current coordinated release
  • Select Repository level Project for development toward the next official release or add alert: NEED PROJECT ASSIGNMENT label
  • Select Milestone as the next bugfix version

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_<Version>.
    Branch name: bugfix_<Issue Number>_main_<Version>_<Description>
  • Fix the bug and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into main_<Version>.
    Pull request: bugfix <Issue Number> main_<Version> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Linked issues
    Select: Organization level software support Project for the current coordinated release
    Select: Milestone as the next bugfix version
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
    Select: Reviewer(s) and Linked issues
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • Close this issue.
@hsoh-u hsoh-u added type: bug Fix something that is not working alert: NEED MORE DEFINITION Not yet actionable, additional definition required alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle labels Feb 9, 2022
@hsoh-u hsoh-u added this to the MET 10.1.0 milestone Feb 9, 2022
@hsoh-u hsoh-u self-assigned this Feb 9, 2022
@hsoh-u hsoh-u added type: enhancement Improve something that it is currently doing and removed type: bug Fix something that is not working labels Feb 9, 2022
@JohnHalleyGotway JohnHalleyGotway added MET: PreProcessing Tools (Point) priority: high requestor: METplus Team METplus Development Team required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone and removed alert: NEED MORE DEFINITION Not yet actionable, additional definition required alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle labels Feb 9, 2022
hsoh-u pushed a commit that referenced this issue Feb 10, 2022
@hsoh-u
Copy link
Collaborator Author

hsoh-u commented Feb 10, 2022

It's not simple to use it's value instead of "obs_prepbufr_map" if "obs_prefbufr_map" is defined.
The current way is 1) reading the default config and 2) reading the user config (overridding default connfig) . There is no way to figure if "obs_prefbufr_map" or "obs_prepbufr_map" are from the default config or from the user config. So "obs_prepbufr_map" is defined at the default config, the "obs_prefbufr_map" from the user config will be ignored.

So the reading order will be:

  1. obs_prefbufr_map from a default config
  2. obs_prefbufr_map from an user config (overrides the default config)
  3. obs_prepbufr_map from a default config (overrides the user config)
  4. obs_prepbufr_map from an user config (overrides the default config)

@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented Feb 10, 2022

@hsoh-u, I'm moving your email over to the GitHub issue comments section...

Cases to handle the bad key and some questions:

Two questions:

[default configuration]

If bad key (obs_prefbufr_map) exists at the default configuration:

  • if good key (obs_prepbufr_map) does not exist, use it & give a warning
  • Question 1: if good key (obs_prepbufr_map) exists, ignore it and give a warning OR no warning?

[user configuration]

If bad key exist at the user configuration, give a warning to correct key name

  • if good key (obs_prepbufr_map) exist at default config.
    • Question 2: ignore or override to good key from default?
  • if good key (obs_prepbufr_map) does not exist, override it from default

@hsoh-u there is NO distinction between "default configuration" and "user configuration", nor does there need to be. In pb2nc. This line of pb2nc_conf_info.cc calls parse_conf_obs_bufr_map(). And this is the only code that actually needs to change (along with defining conf_key_obs_prepbufr_map)...

Existing:

map<ConcatString,ConcatString> parse_conf_obs_bufr_map(Dictionary *dict) {
   map<ConcatString,ConcatString> m = parse_conf_key_value_map(dict, conf_key_obs_prefbufr_map);
   parse_add_conf_key_value_map(dict, conf_key_obs_bufr_map, &m);
   return m;
}

New:

map<ConcatString,ConcatString> parse_conf_obs_bufr_map(Dictionary *dict) {
   map<ConcatString,ConcatString> m = parse_conf_key_value_map(dict, conf_key_obs_prefbufr_map, false);
   if(dict.last_lookup_status()) {
     // PRINT A WARNING MESSAGE HERE SINCE OBS_PREFBUFR_MAP IS PRESENT
   }
   else {
      m = parse_conf_key_value_map(dict, conf_key_obs_prepbufr_map, false);
   }
   parse_add_conf_key_value_map(dict, conf_key_obs_bufr_map, &m);
   return m;
}

Shoot, looks like I'm wrong. The "parse_add_conf_key_value_map()" does NOT have the optional "error_out" argument. Perhaps you'll need to add that as well. Otherwise, when you lookup "conf_key_obs_prefbufr_map", that lookup will fail and exit. We do not want to exit if its not present.

@hsoh-u
Copy link
Collaborator Author

hsoh-u commented Feb 10, 2022

I'm thinking not to change parse_conf_obs_bufr_map which is in the library code.
The warning will be given at pb2nc_conf_info.cc in order to print out which config file has a bad name. And correct the config key with the proper name.

The code will do following way:

PB2NCConfInfo::read_config

the current way:
   read a default config
   read an user config

new:
  read a default config
  check if warning case
  read an user config
  check if warning case
  if warning case, correct the config key & give warning

hsoh-u pushed a commit that referenced this issue Feb 11, 2022
hsoh-u pushed a commit that referenced this issue Feb 11, 2022
JohnHalleyGotway added a commit that referenced this issue Feb 17, 2022
…ar entry should really be obs_bufr_map and not commented out.
@hsoh-u hsoh-u linked a pull request Feb 17, 2022 that will close this issue
14 tasks
@hsoh-u hsoh-u closed this as completed Feb 17, 2022
@JohnHalleyGotway JohnHalleyGotway changed the title Rename the configuration name "obs_prefbufr_map" to "obs_prepbufr_map" in PB2NC configuration Update the PB2NC configuration to correct the obs_prefbufr_map name as obs_prepbufr_map Mar 2, 2022
@JohnHalleyGotway JohnHalleyGotway changed the title Update the PB2NC configuration to correct the obs_prefbufr_map name as obs_prepbufr_map Update the PB2NC configuration to correct the obs_prefbufr_map name as obs_prepbufr_map. Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue MET: PreProcessing Tools (Point) requestor: METplus Team METplus Development Team required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone type: enhancement Improve something that it is currently doing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants