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

Make bypass setup and run update invalid in static models #693

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

Conversation

dalonsoa
Copy link
Collaborator

Description

This PR removes the possibility of skipping running the _setup method but still running _update once, which is an invalid configuration for static models.

As an extra, a bug is fixed by which the _update method was run in static models if no variables were present and None were required. If None are required, then the updated method should not run. Granted that is unlikely to happen in a real scenario, yet it should not happen ever.

Fixes #687

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
  • Relevant documentation reviewed and updated

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.75%. Comparing base (8aa5af7) to head (fbd6bdb).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #693      +/-   ##
===========================================
+ Coverage    94.74%   94.75%   +0.01%     
===========================================
  Files           73       73              
  Lines         4984     4995      +11     
===========================================
+ Hits          4722     4733      +11     
  Misses         262      262              

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

Copy link
Collaborator

@sallymatson sallymatson left a comment

Choose a reason for hiding this comment

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

Great - I'll add this specification in the docs as well.

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.

Looks fine to me

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.

The logic looks solid but a couple of things I'm not so clear on.

tests/conftest.py Outdated Show resolved Hide resolved
tests/models/abiotic/test_abiotic_model.py Outdated Show resolved Hide resolved
tests/models/abiotic/test_abiotic_model.py Show resolved Hide resolved
@dalonsoa dalonsoa requested a review from davidorme February 3, 2025 14:17
@dalonsoa
Copy link
Collaborator Author

@davidorme , I think I implemented all the changes requested here. Shall we merge, so it does not become stalled?

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

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.

Prevent not running _setup but running _update from happening in static models
5 participants