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

Feature/juvenile dispersal - Adding juvenile dispersal to the Animal Module #419

Merged
merged 16 commits into from
May 15, 2024

Conversation

TaranRallings
Copy link
Collaborator

Description

Following Madingley, this builds on previous starvation-induced dispersal to add a dispersal check immediately after a cohort is born. When migrate_community is called during the normal flow of model execution there is a secondary check to see if the cohort is newly created. If the cohort is new, it creates a probability of dispersal based on allometric movement speed and grid size.

Currently, this only works for 'rook move' dispersal. The logic can be expanded for diagonal movement and multi-grid occupancy but we can leave that for a little later.

Fixes # (issue)

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

Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

I've a couple of comments related to the naming or interpretation of the probability. But otherwise looks good.

@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.62%. Comparing base (88a6de3) to head (af0f340).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #419      +/-   ##
===========================================
+ Coverage    94.59%   94.62%   +0.02%     
===========================================
  Files           69       69              
  Lines         3648     3666      +18     
===========================================
+ Hits          3451     3469      +18     
  Misses         197      197              

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

Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

A couple of suggestions for the probability part, but looks good otherwise.

virtual_ecosystem/models/animals/animal_cohorts.py Outdated Show resolved Hide resolved
virtual_ecosystem/models/animals/animal_cohorts.py Outdated Show resolved Hide resolved
@TaranRallings TaranRallings merged commit 626476b into develop May 15, 2024
9 checks passed
@TaranRallings TaranRallings deleted the feature/juvenile_dispersal branch May 15, 2024 13:11
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