Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Python-based interface for the USDA/EPA's honey bee colony model BeePop+.
For more information about BeePop+ see Garber et al. 2022.
Developed by: Jeffrey Minucci
Install the package into your Python environment using pip:
pip install pybeepop-plus
Import the PyBeePop class in your python code, e.g.:
from pybeepop import PyBeePop
Create a BeePop+ object:
beepop = PyBeePop()
Set parameters, weather and pesticide exposure levels (optional).
# define a dictionary of BeePop+ parameters (parameter_name: value)
params = {"ICWorkerAdults": 10000, "ICWorkerBrood": 8000,
"SimStart": "04/13/2015", "SimEnd": "09/15/2015",
"AIAdultLD50: 0.04"}
beepop.set_parameters(params)
# load your weather file by giving its path
weather = '/home/example/test_weather.txt'
beepop.load_weather(weather)
# load your pesticide residue file by giving its path (optional)
pesticide_file = '/home/example/pesticide_residues.txt'
beepop.load_contamination_file(pesticide_file)
Parameters that are not set by the user will take on the BeePop+ default values. For more information see the BeePop+ publication.
For a list of exposed BeePop+ parameters, see docs/BeePop_exposed_parameters.csv.
For an explanation of the weather file format, see docs/weather_readme.txt.
For an explanation of the residue file format, see docs/residue_file_readme.txt.
Example files to run the model can be found at example_files/.
Run the Model and get the results as a pandas DataFrame
results = beepop.run_model()
print(results)
Results from last simulation can also be returned using the get_output function, with options to return a DataFrame or a json string.
output = beepop.get_output() # pandas dataframe
output_json = beepop.get_output(json_str=True) # json string
You can pass new parameters and/or update previously set ones (and optionally set a new weather file), and then run the model again. Parameters that were previously defined will remain set
# update value for ICWorkerAdults, InitColPollen, other values set previously remain
params_new = {"ICWorkerAdults": 22200, "InitColPollen": 4000}
beepop.set_parameters(parameters = params_new)
new_results = beepop.run_model()
You can also set parameters using a .txt file where each line gives a parameter in the format "Parameter=Value".
Example my_parameters.txt:
RQEggLayDelay=10
RQReQueenDate=06/25/2015
RQEnableReQueen=False
In Python:
parameter_file = 'home/example/my_parameters.txt'
my_parameters = beepop.load_input_file()
print(my_parameters)
To get a list of the user-defined parameters:
my_parameters = beepop.get_parameters()
print(my_parameters)
To plot the last output as a time series:
ax = beepop.plot_output() # default columns
cols_to_plot = ["Dead Worker Adults", "Dead Foragers"]
ax = beepop.plot_output(cols_to_plot) # custom columns
A Jupyter notebook with a working example of using pybeepop+
is available here.
Documentation of the pybeepop+ API can be found at: https://usepa.github.io/pybeepop/.
Clone the BeePop+ repo:
git clone https://github.com/quanted/VPopLib.git
Create a build directory:
cd VPopLib
mkdir build
cd build
Build the shared library:
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..
cmake --build . --config Release
Now the .so file liblibvpop.so should have been created inside the /build directory. This shared library can be moved or renamed. You can pass the path to this .so file as lib_path when creating a PyBeePop object:
# pass the path to your previously compiled shared library file
lib_file = '/home/example/liblibvpop.so'
beepop = PyBeePop(lib_file)
For those in the user community wishing to contribute to this project:
FAQs
EPA's Python interface for the EPA/USDA honey bee colony model BeePop+
We found that pybeepop-plus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.