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

Cleanup of error logging in gold_master.py and Galileo SSI #132

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

markshowalter
Copy link
Collaborator

@markshowalter markshowalter commented Jun 11, 2024

This pull request contains fixes to how errors are logged. It was part of the previous pull request but that one got merged before I had pushed these changes.

In the LOGGING methods in oops/config.py:

  • Add counter that records how many lines a logger has printed.
  • In print(), literal messages no longer get counted as warnings or errors, even if the level is WARN or ERROR. This is consistent with the point of literal messages, which is to add supplementary info to the log. Supplementary info about a warning or error should not increment the count.

In oops/gold_master/__init__.py:

  • Add sensible default values to define_standard_obs().
  • Force the planets, moons, and rings inputs to be tuples, never lists.
  • Bugfix: "info" was not a recognized input for --level.
  • Force a log message to be printed identifying the observation in which an error is logged. Previously, if the logging level was set to something higher than INFO and the test was being run on multiple observations, an error would be logged without identifying which of multiple observations triggered the error.
  • There is now a blank line in the log between multiple observations tested when the level is INFO.
  • When multiple observations were tested, the log ends with INFO messages indicating the total warnings, total errors, and total elapsed time.
  • When logging internals, I now ensure that LOGGING.pop() is always called after LOGGING.push() using try/finally.

For Galileo SSI:

  • I removed the "extraneous byte" warning because it seems to be a common issue in the data files and we really don't care.
  • I simplified the calls to define_standard_obs(), taking advantage of the new input defaults.

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

Attention: Patch coverage is 34.31373% with 67 lines in your changes missing coverage. Please review.

Project coverage is 75.39%. Comparing base (27afe87) to head (ba9ff90).

Files Patch % Lines
oops/gold_master/__init__.py 34.09% 52 Missing and 6 partials ⚠️
oops/config.py 30.76% 4 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
- Coverage   75.44%   75.39%   -0.05%     
==========================================
  Files         192      192              
  Lines       24078    24082       +4     
  Branches     2900     2906       +6     
==========================================
- Hits        18165    18156       -9     
- Misses       5079     5088       +9     
- Partials      834      838       +4     

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

Copy link
Collaborator

@jnspitale jnspitale left a comment

Choose a reason for hiding this comment

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

Loosk good, all unit test pass. It looks like I miust have had some extraneous overrides in the galileo ssi standard_obs file.

@markshowalter
Copy link
Collaborator Author

Loosk good, all unit test pass. It looks like I miust have had some extraneous overrides in the galileo ssi standard_obs file.

In the third test, there were a bunch of Europa overrides, but they were applied to an Earth observation so they never got used. The Europa overrides were only needed for the fourth test.

@rfrenchseti rfrenchseti merged commit bef63e7 into main Jun 17, 2024
14 checks passed
@rfrenchseti rfrenchseti deleted the test_log_cleanup branch June 17, 2024 19:39
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.

3 participants