General utility scripts for Quetzal projects
Project description
Quetzal-CRUMBS
General utility scripts for the Quetzal framework projects
Usage in bash
At the present moment the python interfaces are not very stable, and are not really meant to be used directly. I prefer to use Quetzal-CRUMBS in bash scripts when I'm doing ABC-inference or when I'm calibrating my simulations.
Sampling parameters in prior distribution
- Sampling integers (e.g., population size):
N=$(python3 -m crumbs.sample "uniform_integer" 10 1000)
- Sampling double (e.g., probability):
p=$(python3 -m crumbs.sample "uniform_real" 0.0001 0.1)
- Sampling a coordinate uniformly at random in a geotiff file:
latlon=($(python3 -m crumbs.sample "uniform_latlon" "file.tif" | tr -d '[],'))
- get latitude with
${latlon[0]}
- get longitude with
${latlon[1]}
Visualizing demographic history:
- If you chose to log the demographic history from Quetzal-EGGS programs (option
log-history=history.tif
in the EGG configuration file), then you can convert it into an animation using CRUMBS. It is quite handy to check the impact of parameters or suitability on the simulation. Theanimate
function can be called with the following:- Default settings (generates an animated gif):
python3 animate.py --input "animation.tif"
- Change the output format (detects the mp4 extension and converts accordingly):
python3 animate.py --input "animation.tif" --output "animation.mp4"
- Change the colorbar cap value (if none is given then the max value is inferred from the multiband raster):
python3 animate.py --input "animation.tif" --vmax 100
- Combination of the previous:
python3 animate.py --input "animation.tif" --output "animation.mp4" --vmax 100
- Default settings (generates an animated gif):
Updating the package (tip note for the dev)
- Create a
feature
branch, make updates to it. - Test the feature
- Bump the version in
setup.cfg
- Bump the version of the
whl
file in.circleci/config.yml
- Update the ChangeLog
- Push to GitHub
When you have a successful build on https://app.circleci.com/pipelines/github/Becheler/quetzal-CRUMBS:
- create a Pull Request (PR) to the develop branch
- Merge the PR if it looks good.
- When that build succeeds, create a PR to the main branch, review it, and merge.
- Go get a beer and bless this new version with some luuuv.
Workflow from https://circleci.com/blog/publishing-a-python-package/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
quetzal_crumbs-0.0.15.tar.gz
(22.2 kB
view hashes)
Built Distribution
Close
Hashes for quetzal_crumbs-0.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc64fd637c88358b9a9db6024b2dba0a605788193314ef6c832183ae11b2a2d0 |
|
MD5 | 998fad3a1e4f6fa3c53e11e6a1f3b6f5 |
|
BLAKE2b-256 | 6d653e4969b75fae9a14c4af11c8756a2fc061e775fe1c310a9fd812ff4378dd |