Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
61e6b11
Expanded the animaltrait system to include fine resolution diet types…
TaranRallings Apr 24, 2025
eee53d6
Reworked the litterpool class to be one litter pool per grid cell to …
TaranRallings Apr 28, 2025
2f0194a
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings Apr 28, 2025
b44fa31
Added get_eaten methods to carcass and excrement pools, added basic w…
TaranRallings May 1, 2025
35a0869
Added trophic methods for detritus, scavanging, and coprophagy, and m…
TaranRallings May 9, 2025
0f78e08
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings May 9, 2025
7a7d1ed
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings May 15, 2025
99b8bbf
Added a testing file for animal_traits to test the classes that now h…
TaranRallings May 15, 2025
1cae849
Debugged tests for decay and cohorts.
TaranRallings May 16, 2025
f88e501
Brought remaining tests from animal model in line with trophic rework.
TaranRallings May 16, 2025
8cee9ed
Added tests for calculating consumed mass methods.
TaranRallings May 19, 2025
c733a97
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings May 20, 2025
76d9f18
Updated existing tests.
TaranRallings May 27, 2025
0084299
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings May 27, 2025
fd04424
Updated prey group selection and cohort initialization processes.
TaranRallings May 29, 2025
831c910
Updated tests for new prey selection structure and fixed bug in diet …
TaranRallings May 29, 2025
a822251
Added missing tests for create_new_cohort and assign_prey_groups.
TaranRallings May 30, 2025
5626d52
Fixed a docs issue.
TaranRallings May 30, 2025
4409bf5
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings Jun 2, 2025
4328e68
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings Jun 4, 2025
2605e86
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings Jun 6, 2025
ff3481c
Removed erroneous mentions of wet mass in comments.
TaranRallings Jun 6, 2025
6ff4d1b
Added missing test for get_little_pools.
TaranRallings Jun 6, 2025
00a8cc9
Merge branch 'develop' into 754-animals---trophic-expansion
TaranRallings Jun 11, 2025
29f2896
Updated logic of animalmodel.forage_community to use specific diet fl…
TaranRallings Jun 12, 2025
63f7873
Replaced the get_eaten methods of carcass and waste pools with a mixi…
TaranRallings Jun 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,54 @@ def fixture_config(microbial_groups_cfg):
birth_mass = 0.0005
adult_mass = 0.005

[[animal.functional_groups]]
name = "dung_beetle"
taxa = "invertebrate"
diet = "waste"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
reproductive_type = "iteroparous"
development_type = "direct"
development_status = "adult"
offspring_functional_group = "dung_beetle"
excretion_type = "uricotelic"
migration_type = "none"
vertical_occupancy = "soil_ground"
birth_mass = 0.0003
adult_mass = 0.003

[[animal.functional_groups]]
name = "scavenging_mammal"
taxa = "mammal"
diet = "carcasses"
metabolic_type = "endothermic"
reproductive_environment = "terrestrial"
reproductive_type = "iteroparous"
development_type = "direct"
development_status = "adult"
offspring_functional_group = "scavenging_mammal"
excretion_type = "ureotelic"
migration_type = "none"
vertical_occupancy = "ground"
birth_mass = 2.0
adult_mass = 20.0

[[animal.functional_groups]]
name = "detritivorous_insect"
taxa = "invertebrate"
diet = "detritus"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
reproductive_type = "iteroparous"
development_type = "direct"
development_status = "adult"
offspring_functional_group = "detritivorous_insect"
excretion_type = "uricotelic"
migration_type = "none"
vertical_occupancy = "soil_ground"
birth_mass = 0.0004
adult_mass = 0.004

[hydrology]
"""

Expand Down
108 changes: 100 additions & 8 deletions tests/models/animals/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def animal_fixture_config():
adult_mass = 10.0
[[animal.functional_groups]]
name = "carnivorous_insect"
taxa = "insect"
taxa = "invertebrate"
diet = "carnivore"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
Expand All @@ -233,7 +233,7 @@ def animal_fixture_config():
adult_mass = 0.01
[[animal.functional_groups]]
name = "herbivorous_insect"
taxa = "insect"
taxa = "invertebrate"
diet = "herbivore"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
Expand All @@ -248,7 +248,7 @@ def animal_fixture_config():
adult_mass = 0.005
[[animal.functional_groups]]
name = "butterfly"
taxa = "insect"
taxa = "invertebrate"
diet = "herbivore"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
Expand All @@ -263,7 +263,7 @@ def animal_fixture_config():
adult_mass = 0.005
[[animal.functional_groups]]
name = "caterpillar"
taxa = "insect"
taxa = "invertebrate"
diet = "herbivore"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
Expand Down Expand Up @@ -308,7 +308,7 @@ def animal_fixture_config():
adult_mass = 0.2
[[animal.functional_groups]]
name = "earthworm"
taxa = "insect"
taxa = "invertebrate"
diet = "herbivore"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
Expand All @@ -321,6 +321,52 @@ def animal_fixture_config():
vertical_occupancy = "soil"
birth_mass = 0.0005
adult_mass = 0.005
[[animal.functional_groups]]
name = "dung_beetle"
taxa = "invertebrate"
diet = "waste"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
reproductive_type = "iteroparous"
development_type = "direct"
development_status = "adult"
offspring_functional_group = "dung_beetle"
excretion_type = "uricotelic"
migration_type = "none"
vertical_occupancy = "soil_ground"
birth_mass = 0.0003
adult_mass = 0.003
[[animal.functional_groups]]
name = "scavenging_mammal"
taxa = "mammal"
diet = "carcasses"
metabolic_type = "endothermic"
reproductive_environment = "terrestrial"
reproductive_type = "iteroparous"
development_type = "direct"
development_status = "adult"
offspring_functional_group = "scavenging_mammal"
excretion_type = "ureotelic"
migration_type = "none"
vertical_occupancy = "ground"
birth_mass = 2.0
adult_mass = 20.0
[[animal.functional_groups]]
name = "detritivorous_insect"
taxa = "invertebrate"
diet = "detritus"
metabolic_type = "ectothermic"
reproductive_environment = "terrestrial"
reproductive_type = "iteroparous"
development_type = "direct"
development_status = "adult"
offspring_functional_group = "detritivorous_insect"
excretion_type = "uricotelic"
migration_type = "none"
vertical_occupancy = "soil_ground"
birth_mass = 0.0004
adult_mass = 0.004



[hydrology]
Expand Down Expand Up @@ -793,7 +839,7 @@ def excrement_pool_instance():


@pytest.fixture
def excrement_pools_instance():
def excrement_pools_by_cell_instance():
"""Fixture for excrement pools used in tests."""
from virtual_ecosystem.models.animal.cnp import CNP
from virtual_ecosystem.models.animal.decay import ExcrementPool
Expand Down Expand Up @@ -867,7 +913,7 @@ def carcass_pool_instance():


@pytest.fixture
def carcass_pools_instance():
def carcass_pools_by_cell_instance():
"""Fixture for carcass pools used in tests."""
from virtual_ecosystem.models.animal.cnp import CNP
from virtual_ecosystem.models.animal.decay import CarcassPool
Expand Down Expand Up @@ -920,16 +966,62 @@ def litter_data_instance(fixture_core_components):

@pytest.fixture
def litter_pool_instance(litter_data_instance):
"""Fixture for a litter pool class to be used in tests."""
"""Fixture for a single LitterPool instance in cell 0."""
from virtual_ecosystem.models.animal.decay import LitterPool

return LitterPool(
pool_name="above_metabolic",
cell_id=0,
data=litter_data_instance,
cell_area=10000,
)


@pytest.fixture
def litter_pools_by_cell_instance(litter_data_instance):
"""Fixture for litter pools used in tests."""
from virtual_ecosystem.models.animal.decay import LitterPool

return {
cell_id: [
LitterPool(
pool_name="above_metabolic",
cell_id=cell_id,
data=litter_data_instance,
cell_area=10000,
)
]
for cell_id in range(4) # data has 4 valid cells: 0 to 3
}


@pytest.fixture
def litter_pools_dict_by_cell_instance(litter_data_instance):
"""Fixture for litter pools with correct dict[str, Resource] structure."""
from virtual_ecosystem.models.animal.decay import LitterPool

pool_names = [
"above_metabolic",
"above_structural",
"woody",
"below_metabolic",
"below_structural",
]

return {
cell_id: {
name: LitterPool(
pool_name=name,
cell_id=cell_id,
data=litter_data_instance,
cell_area=10000,
)
for name in pool_names
}
for cell_id in range(4)
}


@pytest.fixture
def herbivory_waste_pool_instance():
"""Fixture for a herbivory waste pool class to be used in tests."""
Expand Down
29 changes: 16 additions & 13 deletions tests/models/animals/data/example_functional_group_import.csv
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name,taxa,diet,metabolic_type,reproductive_environment,reproductive_type,development_type,development_status,offspring_functional_group,excretion_type,migration_type,vertical_occupancy,birth_mass,adult_mass
carnivorous_bird,bird,carnivore,endothermic,terrestrial,iteroparous,direct,adult,carnivorous_bird,uricotelic,none,ground_canopy,0.1,1.0
herbivorous_bird,bird,herbivore,endothermic,terrestrial,iteroparous,direct,adult,herbivorous_bird,uricotelic,none,ground_canopy,0.05,0.5
carnivorous_mammal,mammal,carnivore,endothermic,terrestrial,iteroparous,direct,adult,carnivorous_mammal,ureotelic,none,ground,4.0,40.0
herbivorous_mammal,mammal,herbivore,endothermic,terrestrial,iteroparous,direct,adult,herbivorous_mammal,ureotelic,none,ground,1.0,10.0
carnivorous_insect_iteroparous,insect,carnivore,ectothermic,terrestrial,iteroparous,direct,adult,carnivorous_insect_iteroparous,uricotelic,none,soil_ground_canopy,0.001,0.01
herbivorous_insect_iteroparous,insect,herbivore,ectothermic,terrestrial,iteroparous,direct,adult,herbivorous_insect_iteroparous,uricotelic,none,soil_ground_canopy,0.0005,0.005
carnivorous_insect_semelparous,insect,carnivore,ectothermic,terrestrial,semelparous,direct,adult,carnivorous_insect_semelparous,uricotelic,none,soil_ground_canopy,0.001,0.01
herbivorous_insect_semelparous,insect,herbivore,ectothermic,terrestrial,semelparous,direct,adult,herbivorous_insect_semelparous,uricotelic,none,soil_ground_canopy,0.0005,0.005
butterfly,insect,herbivore,ectothermic,terrestrial,semelparous,indirect,adult,caterpillar,uricotelic,none,ground_canopy,0.0005,0.005
caterpillar,insect,herbivore,ectothermic,terrestrial,nonreproductive,indirect,larval,butterfly,uricotelic,none,canopy,0.0005,0.005
frog,amphibian,carnivore,ectothermic,aquatic,iteroparous,direct,adult,frog,ureotelic,none,ground,0.005,0.5
swallow,bird,carnivore,endothermic,terrestrial,iteroparous,direct,adult,swallow,uricotelic,seasonal,canopy,0.005,0.2
earthworm,insect,herbivore,ectothermic,terrestrial,iteroparous,direct,adult,earthworm,uricotelic,none,soil,0.0005,0.005
carnivorous_bird,bird,vertebrates_invertebrates_carcasses,endothermic,terrestrial,iteroparous,direct,adult,carnivorous_bird,uricotelic,none,ground_canopy,0.1,1.0
herbivorous_bird,bird,foliage_fruit,endothermic,terrestrial,iteroparous,direct,adult,herbivorous_bird,uricotelic,none,ground_canopy,0.05,0.5
carnivorous_mammal,mammal,vertebrates_invertebrates_carcasses,endothermic,terrestrial,iteroparous,direct,adult,carnivorous_mammal,ureotelic,none,ground,4.0,40.0
herbivorous_mammal,mammal,foliage_fruit,endothermic,terrestrial,iteroparous,direct,adult,herbivorous_mammal,ureotelic,none,ground,1.0,10.0
carnivorous_insect_iteroparous,invertebrate,invertebrates,ectothermic,terrestrial,iteroparous,direct,adult,carnivorous_insect_iteroparous,uricotelic,none,soil_ground_canopy,0.001,0.01
herbivorous_insect_iteroparous,invertebrate,foliage_fruit,ectothermic,terrestrial,iteroparous,direct,adult,herbivorous_insect_iteroparous,uricotelic,none,soil_ground_canopy,0.0005,0.005
carnivorous_insect_semelparous,invertebrate,invertebrates,ectothermic,terrestrial,semelparous,direct,adult,carnivorous_insect_semelparous,uricotelic,none,soil_ground_canopy,0.001,0.01
herbivorous_insect_semelparous,invertebrate,foliage_fruit,ectothermic,terrestrial,semelparous,direct,adult,herbivorous_insect_semelparous,uricotelic,none,soil_ground_canopy,0.0005,0.005
butterfly,invertebrate,foliage_fruit,ectothermic,terrestrial,semelparous,indirect,adult,caterpillar,uricotelic,none,ground_canopy,0.0005,0.005
caterpillar,invertebrate,foliage_fruit,ectothermic,terrestrial,nonreproductive,indirect,larval,butterfly,uricotelic,none,canopy,0.0005,0.005
frog,amphibian,vertebrates_invertebrates_carcasses,ectothermic,aquatic,iteroparous,direct,adult,frog,ureotelic,none,ground,0.005,0.5
swallow,bird,invertebrates,endothermic,terrestrial,iteroparous,direct,adult,swallow,uricotelic,seasonal,canopy,0.005,0.2
earthworm,invertebrate,detritus,ectothermic,terrestrial,iteroparous,direct,adult,earthworm,uricotelic,none,soil,0.0005,0.005
dung_beetle,invertebrate,waste,ectothermic,terrestrial,iteroparous,direct,adult,dung_beetle,uricotelic,none,soil_ground,0.0003,0.003
scavenging_mammal,mammal,carcasses,endothermic,terrestrial,iteroparous,direct,adult,scavenging_mammal,ureotelic,none,ground,2.0,20.0
detritivorous_insect,invertebrate,detritus,ectothermic,terrestrial,iteroparous,direct,adult,detritivorous_insect,uricotelic,none,soil_ground,0.0004,0.004
Loading