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

Remove unnecessary critical messages in model.py scripts #169

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

jacobcook1995
Copy link
Collaborator

Description

Critical logging messages were being raised by Model __init__'s when the errors they were emitting were being handled by higher level functions in main.py. This is obviously not correct, as it led to multiple CRITICAL messages being logged. I thought it was worth fixing this immediately as the documentation informing people how to setup a model was basically instructing people to make this mistake.

This does not fix #113 or #160, which are much broader discussion. It does however remove an egregious example of the problem.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov-commenter
Copy link

Codecov Report

Merging #169 (d5b1339) into develop (d17cb71) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop     #169   +/-   ##
========================================
  Coverage    95.58%   95.58%           
========================================
  Files           18       18           
  Lines          907      907           
========================================
  Hits           867      867           
  Misses          40       40           
Impacted Files Coverage Δ
virtual_rainforest/models/abiotic/model.py 94.11% <100.00%> (ø)
virtual_rainforest/models/soil/model.py 95.23% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@vgro vgro left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@davidorme davidorme left a comment

Choose a reason for hiding this comment

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

LGTM

@jacobcook1995 jacobcook1995 merged commit 2c5f891 into develop Feb 9, 2023
@jacobcook1995 jacobcook1995 deleted the feature/remove_model_criticals branch February 9, 2023 09:58
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.

Use logger error codes better
4 participants