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

Perf: Better error report for failed parsing #596

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

marshallward
Copy link
Member

Print the line and its tokenization in parse_perf.py if the tokenization fails for any reason. This is most likely to occur if the fourth token is not an integer.

This is possibly a platform-dependent issue, and not something easily replicated on any machine we are using, so it is easier to simply integrate it into the codebase.

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.12%. Comparing base (6c44c5f) to head (e811635).

❗ Current head e811635 differs from pull request most recent head 0dd57f6. Consider uploading reports for the commit 0dd57f6 to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##           dev/gfdl     #596       +/-   ##
=============================================
+ Coverage          0   37.12%   +37.12%     
=============================================
  Files             0      271      +271     
  Lines             0    80797    +80797     
  Branches          0    15082    +15082     
=============================================
+ Hits              0    29999    +29999     
- Misses            0    45198    +45198     
- Partials          0     5600     +5600     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marshallward
Copy link
Member Author

This did not appear to catch and report the error as hoped, although we did git a bit more information about the problem (ValueError: invalid literal for int() with base 10: 'long)@plt').

Trying a slight modification.

Print the line and its tokenization in parse_perf.py if the tokenization
fails for any reason.  This is most likely to occur if the fourth token
is not an integer.

This is possibly a platform-dependent issue, and not something easily
replicated on any machine we are using, so it is easier to simply
integrate it into the codebase.
@marshallward
Copy link
Member Author

I was writing the error to stdout which was being piped to a file 🤦. The error is now piped to stderr (or at least that is the intention).

@marshallward marshallward merged commit f7a4491 into NOAA-GFDL:dev/gfdl Apr 19, 2024
12 checks passed
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.

2 participants