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.run()
# 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.6.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.6-cp314-cp314-win_amd64.whl (38.0 MB view details)

Uploaded CPython 3.14Windows x86-64

pyfvs-0.3.6-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.6-cp313-cp313-win_amd64.whl (36.9 MB view details)

Uploaded CPython 3.13Windows x86-64

pyfvs-0.3.6-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.6-cp312-cp312-win_amd64.whl (36.9 MB view details)

Uploaded CPython 3.12Windows x86-64

pyfvs-0.3.6-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.6-cp311-cp311-win_amd64.whl (36.9 MB view details)

Uploaded CPython 3.11Windows x86-64

pyfvs-0.3.6-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.6-cp310-cp310-win_amd64.whl (36.9 MB view details)

Uploaded CPython 3.10Windows x86-64

pyfvs-0.3.6-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.6.tar.gz.

File metadata

  • Download URL: pyfvs-0.3.6.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.6.tar.gz
Algorithm Hash digest
SHA256 e3e02b82c0f65cc35b54d609d8660bb0532187efe90cb4ba1c260f6706b65fdc
MD5 bf2c9adae1cfef830d55ec5f363fe031
BLAKE2b-256 9422472cc99a1dd975ef6a4b9d12c419a2720aebbc4a97ab82f439e949c09550

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6.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.6-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.6-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.6-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a82964657492a1f04e1ea962a95b996339551196a43644ab1493550a3f22c80c
MD5 320778f6802655e788be5f8392f74644
BLAKE2b-256 e0ba421bd76259b49881e55111f0eb5ad67c5ee189accd454e8462f8d6f5488a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.6-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 65c7f37dabcd846fdc0c3620a52d281414de0da5c9ba714381b44e3d69c4b61d
MD5 9b7004a83290afad0777e4a6b942728b
BLAKE2b-256 74a85f031fbe47a095a9f33cb1d0fe7af05bd6187edc4cb22477eb638b3d01de

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.6-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.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 633de00434e8b16c251fb6d3ce61daa2012a9456a2379215014aa668f8114624
MD5 c043e973a5dff648db71772991832577
BLAKE2b-256 86664a9499ee6a8701269f717ff6c14cf675f14fcb09e377958810e54b8dcc90

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.6-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0aee397bdab3f9cb88f4c14b548087129b10e606495078b2ba068f8639905427
MD5 5e764355bf3e1e4c228aeb1e779f2e91
BLAKE2b-256 5fa6b6ea38d3a9a1dcdd3d6489eed29adb79a7dbd227bd86e012bfa2729e86c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.6-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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 468bba0f24f7ba21cfb621a7312713b04354aedcd5c5695f4e205de47b2663fb
MD5 238055e9b24d0e2a1c8af90057d3530f
BLAKE2b-256 b3286894fb3b55d8cb329f37d55ca9e0ce545f27f678cfd48e5fb24f40d89bf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.6-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f9eda6632e846dfcdae89b02a5438cb7b8ac4c819ed9c7d54ba56af03e9d8b3a
MD5 e6bc2a85f7ebaf765de3f1537e468f0a
BLAKE2b-256 d3c336a73df15b38094233f2fa1b0052c2c20d33f0f072cd730b14d7bff46680

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.6-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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 354d0fa0b6f7129574f38eec036de095e4c1eddc3b797ddec1ef58e52c60b7f6
MD5 130fc998388c092d4e948a79bd1716b6
BLAKE2b-256 81d37ee8029fa709f167c237bd62815475e17a42c9127e2c9882b01d1dca201b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.6-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 547a0f0229fd3db2018e9060ea3ce09745a56d411b55ddd8a193f0a193c0567b
MD5 fd1bdd49f519510a64326b63100577b0
BLAKE2b-256 1d21bac4f65cf263806375921e4dfcb5622c110b0b5ec92bd66e08d71cacfa4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyfvs-0.3.6-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.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6de77e177346dc1dce1275bf6638a9e0beeb802844630a31f3d08cbba15294b7
MD5 cd5f2efecbb34294cf2d8a6afefe7fbd
BLAKE2b-256 0242018207da3942c866dd333cbccdbf0160aa6b8cf6d48e3fe703ac06797a68

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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.6-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyfvs-0.3.6-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2230196bd28f05a4ff88a6c187720817e0380ec0dd1366dcbccec54a254c001d
MD5 9c710ae43e401d9d4928a0385e48ec0e
BLAKE2b-256 c6e041a67e08d1dabefa968bbc1fa22536ebdbb49678bebdb5e34683b16257b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfvs-0.3.6-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