PyFVS
Python wrappers and utilities for using the Forest Vegetation Simulator
_____ ______ __ __ _____
| __ \ | ____|\ \ / / / ____|
| |__) | _ _ | |__ \ \ / / | (____
| ___/ | | | | | __| \ \/ / \___ \
| | | |__| | | | \ / ____) |
|_| \____ | |_| \/ |______/
__/ |
|___/
Project Status
PyFVS wraps a fork of the official FVS code with minimal, non-core, modifications.
PyFVS currently supports Windows and Linux using the GCC family of compilers.
Disclaimer PyFVS is an independent project. It is not affiliated with or supported by the USFS staff or service center.
Features
-
FVS Class
- FVS Step API
- Growth cycle interation
- Within-cycle blocking callbacks for fine-grained inspection and sub-model interaction
- Initialize inventory trees from arrays and dataframes
- Runtime interaction with FVS internal arrays and variables
- Facilitates out-of-core event logic
- Sub-cycle analysis of model components and data
- FVS Step API
-
Keyword Generator:
- Object oriented FVS keyword file generation
- Automates keyword file formatting and runtime handling
-
Command line interface
Variants
Currently PyFVS supports a subset of FVS variants. More will be added as time allows.
- PN - Pacific Northwest Coast
- WC - Westside Cascades
- SO - South Central Oregon and Northeast California
- OP - ORGANON Pacific Northwest
- OC - ORGANON Southwest
- EC - East Cascades
- CA - Inland California and Southern Cascades
- NC - Klamath Mountains (Northern California)
- BM - Blue Mountains
- IE - Inland Empire (Northern Idaho)
- CI - Central Idaho
- AK - Alaska
- WS - Western Sierra Nevada
Parity with Official Binaries
PyFVS is designed to be consistent with the official FVS binaries. Before a release all variants are run through a series of unit test to ensure functionality and equivalence with official FVS binaries.
- Variant specific unit tests from official FVS releases
- Additional unit tests for specific functionality
Documentation
Check out the AI generated documentation wiki.
Installation
PyFVS is available through PyPI for Windows and Linux. In addition, packages for OS X are available through conda-forge.
PyPI
>python -m pip install pyfvs
or with Pixi
>pixi add --pypi pyfvs
conda-forge
NOTE: Releases to conda-forge may lag behind PyPI
>conda install pyfvs
or with Pixi
pixi add pyfvs
Usage
NOTE: The PyFVS API is beta. Names and arguments may change as features evolve. Deprecation warnings will be raised when possible. However, there is guarantee of backward compatibility.
Command Line
>pyfvs --help
>pyfvs list-variants
>pyfvs run PN -k path/to/keywords.key
Run a simulation using an existing keyword file and treelist
from pyfvs import fvs
f = fvs.FVS('PN')
kwds = 'path/to/keywords.key'
f.init_projection(kwds)
# Iterate through the simulation cycles
for cycle in f:
print(f.year)
# Do something interesting
# Closeout the simulation
f.end_projection()
Genarate keywords for a bareground simulation
from pyfvs import fvs,keywords
f = fvs.FVS('PN')
# Setup the KeywordSet for the simulation
kw = f.keywords
# Grow for 20 periods
kw += keywords.NUMCYCLE(20)
# Add default STDINFO keyword
kw += keywords.STDINFO()
# This is a bareground simulation, so no treelist
kw += keywords.NOTREES()
# Initialize the ESTAB keywordset
est = keywords.ESTAB()
# Add 350 planted DF seedlings to the ESTAB
est += keywords.PLANT(1,'DF',350)
# Add the ESTAB keywordset to the simulation
kw += est
# Execute the simulation
f.grow_all()
# Print the summary table
print(f.summary)
Development
Clone the 'dev' branch, including all submodules
git clone --branch dev --recurse-submodules https://github.com/forest-modeling/PyFVS.git
For local development a Pixi environment is included in pyproject.toml.
# Install Pixi on Linux
curl -fsSL https://pixi.sh/install.sh | sh
# Install Pixi on Windows
powershell -ExecutionPolicy Bypass -c "irm -useb https://pixi.sh/install.ps1 | iex"
Initialize the environment in the root of the project
pixi init --pyproject
pixi shell
Local Development Build
The Pixi environment includes GCC and GFortran compilers from Conda-Forge. Use the included Pixi task to install PyFVS in the current environment in development mode. Pass an optional comma separated list of lower case variant abbreviations to restrict the build to target variants. Additionally, an optional build mode can be passed, debug or release.
pixi run dev "pn,wc" debug
Development mode in Pixi is consistent with Pip. Additionally, PyFVS is built with Meson and Meson-Python. Changes to source files, Python or Fortran, will trigger a recompile on the next import. Alternatively, you can trigger a build by calling the dev task again.
Run Tests
pixi run test
Build Wheels
Wheel files for the current system will be placed in the dist folder along with an sdist source archive.
pixi run build "pn,wc"
Metadata
Release files for fresh-fvsbc-pyfvs 0.3.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| fresh_fvsbc_pyfvs-0.3.13-cp313-cp313-manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64 | Details for fresh_fvsbc_pyfvs-0.3.13-cp313-cp313-manylinux_2_28_x86_64.whl |
| fresh_fvsbc_pyfvs-0.3.13-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details for fresh_fvsbc_pyfvs-0.3.13-cp312-cp312-manylinux_2_28_x86_64.whl |
| fresh_fvsbc_pyfvs-0.3.13-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details for fresh_fvsbc_pyfvs-0.3.13-cp311-cp311-manylinux_2_28_x86_64.whl |
| fresh_fvsbc_pyfvs-0.3.13-cp310-cp310-manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64 | Details for fresh_fvsbc_pyfvs-0.3.13-cp310-cp310-manylinux_2_28_x86_64.whl |
Total release size: 12.1 MB
Release files / fresh_fvsbc_pyfvs-0.3.13-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | fresh_fvsbc_pyfvs-0.3.13-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0901dd8b88f5c9105e44865a171a11580b7555e357ca8e006c3ec0b2981e3a23
|
|
BLAKE2b-256 checksum How to use checksums |
f05b6df7932ea1dd3c72723df67306fecfd5b208e73bee0f3bf12e1e676f4910
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 3, 2026.
Transparency logRelease files / fresh_fvsbc_pyfvs-0.3.13-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | fresh_fvsbc_pyfvs-0.3.13-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e0b2fa0a1058a95bc125005852d9b49486801e7b740fd8763969cb36bb217d71
|
|
BLAKE2b-256 checksum How to use checksums |
92e110a1e3d02706d745a0bd0e3b1813b619b5d29d5a723631a0912013b6f2cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 3, 2026.
Transparency logRelease files / fresh_fvsbc_pyfvs-0.3.13-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | fresh_fvsbc_pyfvs-0.3.13-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2cf95fbb05011de1572941d02bb49dfd15503019e4f781ef2991218e6509bca6
|
|
BLAKE2b-256 checksum How to use checksums |
8d2e7b33a929ef08effd594635d734a4ab6bcab1ce57cb60caced8b043f652d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 3, 2026.
Transparency logRelease files / fresh_fvsbc_pyfvs-0.3.13-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | fresh_fvsbc_pyfvs-0.3.13-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
3794abaf0d856d61255930c5e1dd2f3a7164fd1b14b90531d3f81f4b606bafff
|
|
BLAKE2b-256 checksum How to use checksums |
a01459e0f96448f8fd9db73a37f3216ccbc455ada2a9894471315a676a75b6bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 3, 2026.
Transparency logSecurity for fresh-fvsbc-pyfvs 0.3.13
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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for fresh_fvsbc_pyfvs-0.3.13-cp313-cp313-manylinux_2_28_x86_64.whl
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 Nov 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.