Skip to main content

Python wrappers and utilities for using the Forest Vegetation Simulator

Project description

PyFVS

Python wrappers and utilities for using the Forest Vegetation Simulator

  _____            ______ __      __  _____ 
 |  __ \          |  ____|\ \    / / / ____|
 | |__) | _    _  | |__    \ \  / / | (____  
 |  ___/ | |  | | |  __|    \ \/ /   \___  \ 
 | |     | |__| | | |        \  /    ____) |
 |_|      \____ | |_|         \/    |______/ 
            __/ |                            
           |___/

Project Status

  • GitHub Tag

  • Github Actions

  • PyPI-Server

  • Monthly Downloads

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.

Documentation

Check out the AI generated documentation wiki.

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
  • Keyword Generator:

    • Object oriented FVS keyword file generation
    • Automates keyword file formatting and runtime handling
  • Command line interface

Variants

Not all FVS variants are currently implement. 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

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 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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfvs-0.3.7.tar.gz (19.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyfvs-0.3.7-cp314-cp314-win_amd64.whl (38.0 MB view details)

Uploaded CPython 3.14Windows x86-64

pyfvs-0.3.7-cp314-cp314-manylinux_2_28_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

pyfvs-0.3.7-cp313-cp313-win_amd64.whl (36.9 MB view details)

Uploaded CPython 3.13Windows x86-64

pyfvs-0.3.7-cp313-cp313-manylinux_2_28_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pyfvs-0.3.7-cp312-cp312-win_amd64.whl (36.9 MB view details)

Uploaded CPython 3.12Windows x86-64

pyfvs-0.3.7-cp312-cp312-manylinux_2_28_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyfvs-0.3.7-cp311-cp311-win_amd64.whl (36.9 MB view details)

Uploaded CPython 3.11Windows x86-64

pyfvs-0.3.7-cp311-cp311-manylinux_2_28_x86_64.whl (34.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyfvs-0.3.7-cp310-cp310-win_amd64.whl (36.9 MB view details)

Uploaded CPython 3.10Windows x86-64

pyfvs-0.3.7-cp310-cp310-manylinux_2_28_x86_64.whl (34.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

File details

Details for the file pyfvs-0.3.7.tar.gz.

File metadata

  • Download URL: pyfvs-0.3.7.tar.gz
  • Upload date:
  • Size: 19.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfvs-0.3.7.tar.gz
Algorithm Hash digest
SHA256 43afe8edd712a5e76c261a047c8329ebc554dffa60b3de568beee068f485c639
MD5 89120cfa4566ffa5b6bf51cba5cc740d
BLAKE2b-256 dde1979eaa1cb6e4b4986ba1d2114efd46647382c2ba85321be59b5ddeac530d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7.tar.gz:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.7-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 38.0 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfvs-0.3.7-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b19f8d760e98eb6ece7528d37e71142c6f8197057f0a8e683c9656713e545cd4
MD5 35f09ccc258f3ba63a9231bcc91c79fc
BLAKE2b-256 66ebd2fd466922c404d731f0451e9d5d8e9393211b7cd05ceb6434b953a4ac22

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp314-cp314-win_amd64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.7-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d1569193da0b0f739c93ca49efc45878d013f4e4e70257400978627619062e9d
MD5 bb6c66dd9f4c31b41cff54712536959f
BLAKE2b-256 48e8e38c9b4b4b3a1a183f79a17bdec57d6181698641c3abf494012d48adee2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp314-cp314-manylinux_2_28_x86_64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.7-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 36.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfvs-0.3.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7e9359280baf4263e1df6bdb64916c16172197fa33aa177ff2bef1ad7e4fe227
MD5 038ba2c9d1edccfd79c1b1320068f5db
BLAKE2b-256 d33984b19ea9584d1a48feec22a66cd9754df34ab84fc756cfe36e5ca1d516de

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp313-cp313-win_amd64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c6b1cadfcb3e6bb95b8e6e502c5f68dcd72a16f84a2099f42ee5c1923a09dec6
MD5 3da4e5ac7a518480fa39102d8bacc2cf
BLAKE2b-256 2ed216f4e016c1e7f8c0585675aa09687136a8c3629202b85b38972d2982f906

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 36.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfvs-0.3.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 02f1583f4ff3a34518bb2c6d15c9064da49672cae5d3fc80cb94b765de4510e8
MD5 03ba86bf21fda820317db794bbbe3caf
BLAKE2b-256 8ffe2c3696a4b143432e2bcea8043975830828ebb7fe8924a9bd365c72c2801a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp312-cp312-win_amd64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 52233140d97280313daf164967bd4ba69e4969f762cccfaae4b948f2d83cae7a
MD5 cb16da97b8b66162e42317b8359efe53
BLAKE2b-256 339507216f26bf78f8e6bac91cc060f8a9b560cf14d147ea5ed73b40e55321de

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 36.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfvs-0.3.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bffe2c32d9c4a6bbbf61dbe822e13a95ffb2bd6e2f5878ad05276d8c5a4cd94f
MD5 0b4c3e2f49c966838f8b7d88390649e4
BLAKE2b-256 f0fecaa31f319f03a64184c44b083763448de7b8c58207c9ed909a84490d363a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp311-cp311-win_amd64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 559edab3cc50b96a85ec4a65378f029a0c8858c7f5d1443585bb686db553eb33
MD5 b2e70d2ffa4c2fe820b61e23be72f84f
BLAKE2b-256 575ffd8d9cd5fc1cbe25846f1d4427ef0b81a5d28f9065fe9122a5e06996327f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 36.9 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfvs-0.3.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f5e687cd98f4d5b4044971b4ea4c9c657ace335bc07fa4be928cffcfb5dd592f
MD5 37e796e87371c9d3b0237fbd8216af26
BLAKE2b-256 1a2b362617a3ff8072e963ee8657766c2d53c55912be22047179076fa3b27a4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp310-cp310-win_amd64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfvs-0.3.7-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.7-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 83c833e00b0e9f334497a93b6ab4665ae08ee2a58ca18f526b1e1f9120f798d7
MD5 823ec9e1e40083af03e6966d2cf2ff6f
BLAKE2b-256 0e924e6ab7868a847de7b23a8223b215f307a3c63f08406ab40a87980241f180

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.7-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: python-package.yml on forest-modeling/PyFVS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page