VerFishD is a library for simulating vertical fish distribution under the influence of physical stimuli.
Concept
VerFishD uses PhysicalFactor objects to influence fish movement. You can implement this base class to define your own physical factors, such as temperature, light, oxygen, etc. The next step is to load a StimuliProfile, which represents a collection of specific stimulus values. The migration speed function determines the final vertical movement of the fish. The sign of this function determines the movement direction, while the absolute value indicates the percentage of fish that will move. These values are combined to simulate the vertical distribution of fish over time.
Installation
VerFishD is available on PyPI and can be installed using Poetry or pip:
poetry add verfishd
or with pip:
pip install verfishd
Usage
Here is a simple example of how to use VerFishD:
# Define a custom PhysicalFactor
class Temperature(PhysicalFactor):
"""
A class representing a temperature factor.
Parameters
----------
weight : float
The weight is used to scale the factor's contribution to the evaluation function E.
"""
def __init__(self, weight: float):
super().__init__("temperature", weight)
def _calculate(self, value: float) -> float:
match value:
case _ if value > 5:
return 0.0
case _ if value < 4:
return -1.0
case _:
return value - 5.0
# Create a Stimuli Profile including depth and temperature
stimule_dataframe = pd.DataFrame({
'depth': [0.0, 1.0, 2.0, 3.0, 4.0, 5.0],
'temperature': [7.0, 6.0, 5.0, 5.4, 4.0, 3.9]
})
stimuli = StimuliProfile(stimule_dataframe)
# Create the temperature factor
temperature_factor = Temperature(1.0)
# Define a very simple migration speed function
migration_speed = lambda x: x
# Create the model
model = VerFishDModel('Example', stimuli, migration_speed, [temperature_factor])
# Simulate the model for 30 steps
model.simulate(800)
model.plot()
plt.show()
This example defines a temperature factor, creates a stimuli profile with temperature data over depth, initializes the model with this profile and factor, runs a simulation over 800 time steps, and finally plots the results.
Features
- Modularity: Implement custom physical factors that influence fish movement.
- Flexibility: Load different stimuli profiles to simulate various environmental conditions.
- Visualization: Plot functions to display simulation results.
Example Plot
Running Tests
To run tests, use:
pytest
Ideas for the future
- Combine multiple Stimuli Profiles to do a simulation for a whole day
- Algorithm to determine if simulation can end?
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for verfishd 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| verfishd-0.2.5.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| verfishd-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / verfishd-0.2.5.tar.gz
| Download URL | verfishd-0.2.5.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
678c610265926403a31af3cae7a31f73327737d4b2609c10cd7ffa0ef0dc63ac
|
|
BLAKE2b-256 checksum How to use checksums |
750f52f1038b0d0b495ccf737dcc00556333746d97592f4d2c1ddbe2b754f932
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.
Transparency logRelease files / verfishd-0.2.5-py3-none-any.whl
| Download URL | verfishd-0.2.5-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
edef26548011124cb9834595a8af53d887f9677421a29a9f383c900cb9033e4f
|
|
BLAKE2b-256 checksum How to use checksums |
a6a9ab9db08824fa4ca63949a2df41361fc2226868ec70780d68f57570f5a343
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.
Transparency log