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

Bugfix #3095 develop ascii2nc_tab_delimited #3102

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

JohnHalleyGotway
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway commented Mar 8, 2025

Expected Differences

These changes include fixes to address issues raised in two discussions:

They include:

  • Update the is_eq() logic in is_bad_data.h to return true if both inputs are bad data, and NaN is already included in the existing logic for determining bad data.

  • Update iabp_handler.cc to use already parsed line of data rather than re-parsing based on spaces (and not including tabs). Also switches a couple == equality tests for floating point numbers to use the is_eq() function instead.

  • Add a new ascii2nc unit test with tab-delimited input.

  • 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:

    Manually tested to confirm ascii2nc now works as expected with tab-delimited inputs and NaN level equality works as expected.

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

    Ensure the only GHA testing diffs are due to the new ascii2nc output file.

  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes]
    None neded.

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

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

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

    Adds 1 new ascii2nc output file.

  • 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? [No]

    If yes, please describe:
    The overall number of code smells remain unchanged at 17,485.

  • Please complete this pull request review by [Wed 3/12/25].

Pull Request Checklist

See the METplus Workflow for details.

  • Review the source issue metadata (required labels, projects, and milestone).
  • 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) 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
  • After submitting the PR, select the ⚙️ icon in the Development section of the right hand sidebar. Search for the issue that this PR will close and select it, if it is not already selected.
  • 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.

…taLine object rather than re-parsing based on whitespace. Also call is_eq() to check for equality of doubles rather than precise equality with ==.
…the is_eq(a,b) logic to return true if both values are NaN.
@JohnHalleyGotway JohnHalleyGotway marked this pull request as ready for review March 10, 2025 15:26
Copy link
Contributor

@davidalbo davidalbo left a comment

Choose a reason for hiding this comment

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

Everything looks good to me. I see how you directly work with a DataLine using operator[], which fixed the tab delimited error from the previous approach of breaking it into tokens using a space separator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔎 In review
Development

Successfully merging this pull request may close these issues.

Bugfix: ASCII2NC fails with tab-delimited input files
2 participants