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

Feature 1630 point2grid hang #1660

Merged
merged 4 commits into from
Feb 9, 2021
Merged

Feature 1630 point2grid hang #1660

merged 4 commits into from
Feb 9, 2021

Conversation

hsoh-u
Copy link
Collaborator

@hsoh-u hsoh-u commented Feb 9, 2021

Pull Request Testing

  • Describe testing already performed for these changes:
point2grid empty_obs.nc G211 empty_grid.nc -field 'name="TMP"; level="Z2";' -v 10
  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
MET_BIN=/Volumes/d1/projects/MET/MET_development/MET-develop/met/bin
touch empty_obs.txt
$MET_BIN/ascii2nc empty_obs.txt empty_obs.nc -format met_point
$MET_BIN/point2grid empty_obs.nc G211 empty_grid.nc -field 'name="Fscale";
level="";'
OR 
$MET_BIN/point2grid empty_obs.nc G211 empty_grid.nc -config Point2GridConfig_grib -field 'name="Fscale";
level="";'

Add following three lines to Point2GridConfig_grib
var_name_map = [
   { key = "Fscale";    val = "Fscale"; }          // GRIB: 
];

  • Do these changes include sufficient documentation and testing updates? [Yes]

  • Will this PR result in changes to the test suite? [No]

    If yes, describe the new output and/or changes to the existing output:

Pull Request Checklist

See the METplus Workflow for details.

  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s), Project(s), and Milestone
  • After submitting the PR, select Linked Issues with the original issue number.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

The fix is changing error message to warning message and continue instead of stopping if the input data is empty. If empty input (the number of header is 0 and the number of obs data is1, skip reading header variables and obs variables.

Warning message instead of an error message:

$MET_BIN/point2grid empty_obs.nc G211 empty_grid.nc -field 'name="Fscale"; level="";' -v 4

WARNING:
WARNING: process_point_file() -> Invalid GRIB code [Fscale]
WARNING:        But ignored because of empty input

JohnHalleyGotway and others added 4 commits February 1, 2021 12:25
…For example, replace double ;; with single ;'
…p.end() that should be def_var_name_map.end(). Fixing that gets rid of the runtime hang.'
@hsoh-u hsoh-u added this to the MET 10.0.0 milestone Feb 9, 2021
@JohnHalleyGotway JohnHalleyGotway self-requested a review February 9, 2021 17:11
@JohnHalleyGotway JohnHalleyGotway linked an issue Feb 9, 2021 that may be closed by this pull request
20 tasks
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway left a comment

Choose a reason for hiding this comment

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

Changes look fine to me. I like having triggering the warning instead of error when the input file has 0 observations. I ran the tests recommended and see the behavior that Howard describes. Howard, please go ahead and merge these changes into develop.

@hsoh-u hsoh-u merged commit 68e7389 into develop Feb 9, 2021
@hsoh-u hsoh-u deleted the feature_1630_point2grid_hang branch February 10, 2021 04:41
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.

Handle expected no input for ascii2nc and point2grid
2 participants