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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

pyfvs-0.3.5-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.5.tar.gz.

File metadata

  • Download URL: pyfvs-0.3.5.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.5.tar.gz
Algorithm Hash digest
SHA256 126ee8fc4ef7fc76df172d8f09599ec2842a5d705a997be7b75caac9af3f2731
MD5 1e981b04dd6ea727d695e46643bdab0c
BLAKE2b-256 97f656064df85ed02b3c4ea5575e8ddb6408719b84780b55d289ed902b3277f8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyfvs-0.3.5-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.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 fff4ac86707714218dd7e53eb25a0e09987c5d14bc3579f1ac5eeb54cdf2ad73
MD5 93a0e52900bd54667af904b332465b36
BLAKE2b-256 e52bc9e350bb4dd0d0fd427fc99ffaff570fb08bddf858da31687cd5612c8959

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyfvs-0.3.5-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1875fe26cb36fc716f3cd289fde61109c0e636066f1e393854dd6ae4fcdb8bc7
MD5 c378f647e40c87ff1b336c717fac5ed3
BLAKE2b-256 a1b18f3ee3045834a148c7f17bb9492cf2b53cc1b53ee9d6c936fe459be5846f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyfvs-0.3.5-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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 62833234b91b294615da1b04f6e1a81fbe4ebfb133aa0f1b67781fb5270d16b0
MD5 960d7ca7f400aa6aa5fdb72cc69669c1
BLAKE2b-256 475f5162dda60c4fe0d1b6700157a4884411796d7b6834c039155bf5648c24ab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyfvs-0.3.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b32c69a9f5962144a646ec30c2ac1bd295182142ce60923ad0d3ba9fa641b36a
MD5 b04cb6dac945129ef3b0f34dae8b669a
BLAKE2b-256 19277a8f1310fdcc32894f2c1dd59779f9a11066e5f6822f8acba517194f24f1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyfvs-0.3.5-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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 38c99bc165111fb6fd03671205ad11b587d6393ee23002e03420c6f7ff52333d
MD5 726823c7943e80f25d0b48b1742e694e
BLAKE2b-256 32dfb0f58206a1b19e13543389ed5ba72d8b54449feeddc532e22e601bbc6334

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyfvs-0.3.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1f3161d0e1e33a2749571a30074fe67a961d6f7894b44a8601ad3507d03582bd
MD5 29acdf31b83d8f849cb268aa3cbbf6e4
BLAKE2b-256 31a53bd30ffb1e525059a3b3f311a20fb4d531642cec66fad35488a500e537fe

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyfvs-0.3.5-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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0e186b89782b775cf16a66c6c0a3125db5c39e7343df4bec91906c98350fcc78
MD5 76df0202da9c5af1db16f357bbedc47a
BLAKE2b-256 70900fef6f3ebe9a0c2d7c36a00ce897e219f007df845cc0109574fb481e894a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyfvs-0.3.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef58202ce77ecb69a3098652c145150e855888f40e0418916725011b89498b63
MD5 6eca90c34eb8780ada1780c2addb13e4
BLAKE2b-256 ce51e80c9aaf15b78971131d895ea5566b3ebeeefaca0592af6027418493e511

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyfvs-0.3.5-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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c29a28c0a7d1ddf4a031202ca80c5e7cc6eb5c03b831540f7f4054e6b6d16036
MD5 7c6da389e7e98da25014e4a3f7b54cca
BLAKE2b-256 34ba7386ddbb448a9732e9d8c4888d980add0b36c733ad46640493ef21cc973a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyfvs-0.3.5-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 60c3e305dc26b6555fcd9c427ced5b38289300c8a1dd33115d4c7cae8a00c29d
MD5 644c1475d3d3b0edd6ddc1acc479fe84
BLAKE2b-256 362319d65906cab157318fa5cd7e1f7e2811445fa97e64cbca1bb15bd16c3cd0

See more details on using hashes here.

Provenance

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