Skip to content

Expose metabolic constants in Animal model#1135

Merged
davidorme merged 5 commits intodevelopfrom
1134-fix-hard-coded-coefficients-in-metabolic_rate
Nov 13, 2025
Merged

Expose metabolic constants in Animal model#1135
davidorme merged 5 commits intodevelopfrom
1134-fix-hard-coded-coefficients-in-metabolic_rate

Conversation

@davidorme
Copy link
Copy Markdown
Collaborator

@davidorme davidorme commented Nov 6, 2025

This PR:

  • Moves the hard coded values for $E_s, \sigma, E_a$ in models.animals.scaling_functions.metabolic_rate to the new AnimalConstants configuration class.
  • Adds the Bolzmann constant to the core constants.
  • Passes all of these through to the metabolic_rate function via AnimalModel and AnimalCohorts constructors.
  • Turns off parallel building in the docs CI step - crashes way too often to be useful.

Fixes #1134

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

@davidorme davidorme linked an issue Nov 6, 2025 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.35%. Comparing base (3d8ae81) to head (36bd818).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1135   +/-   ##
========================================
  Coverage    94.34%   94.35%           
========================================
  Files           70       70           
  Lines         7044     7051    +7     
========================================
+ Hits          6646     6653    +7     
  Misses         398      398           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@TaranRallings TaranRallings left a comment

Choose a reason for hiding this comment

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

This seems quite straightforward and a good idea for the future of consts. LGTM!

@davidorme davidorme merged commit 18878d7 into develop Nov 13, 2025
13 checks passed
@davidorme davidorme deleted the 1134-fix-hard-coded-coefficients-in-metabolic_rate branch November 13, 2025 15:22
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.

Fix hard-coded coefficients in metabolic_rate

3 participants