Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

tests codecov DOI

ws3 - Wood Supply Simulation System

ws3 (Wood Supply Simulation System) is a Python package for modeling landscape-level wood supply planning problems.

Read the tutorial here.

Table of Contents


Installation

We recommend installing ws3 package into a Python venv (virtual environment) to minimize interactions with system-level packages.

Optional CBM support available via pip install libcbm.

Optional Gurobi support available via pip install ws3[gurobi] or conda install -c gurobi gurobi.

Optional PuLP support available via pip install pulp.

In 000_venv_python_kernel_setup.ipynb we provide the instructions for how to set up a new venv-sandboxed Python kernel and make it available in your JupyterLab environment, assuming that you are running this notebook in a standard linux-based environment and a regular (non-root) using running commands in a bash terminal.

Modules

ws3 consists of the following main modules:

  • common.py: Contains definitions for global attributes, functions, and classes that might be used anywhere in the package.
  • core.py: Contains Interpolator class used by Curve class to interpolate between real data points.
  • forest.py: Implements functions for building and running wood supply simulation models.
  • opt.py: Implements functions for formulating and solving optimization problems.
  • spatial.py: Implements the ForestRaster class, which can be used to allocate an aspatial disturbance schedule (for example, an optimal solution to a wood supply problem generated by an instance of the forest.ForestModel class) to a rasterized representation of the forest inventory.

Usage

Multiple examples are available to demonstrate the utilization of ws3. Below is an overview explaining each of these examples:

Agent capabilities (optional)

ws3 ships a small set of operations designed to be driven by an AI coding agent, where the output is validated against real model state before it is returned.

Capability Oracle
build_mask The proposed mask resolves against the ForestModel to ≥1 development type
explain_exception Every ws3 symbol the explanation cites actually exists
diagnose_import The suggested fix is applied to a scratch copy and the section genuinely re-imports
rtfm The capability name returned is real; cited doc URLs return HTTP 200
ws3_hint Every cited ws3 symbol exists in the package; every cited doc URL returns HTTP 200
inspect_model Live ForestModel metadata (base year, horizon/periods, period length, theme/action/dtype counts, total area at period 1) — read-only, validated against the actual in-memory model object

A capability returns validated output or nothing at all — never a plausible guess. The design rule is no oracle, no capability: if a proposal cannot be checked against real state, it does not become a capability.

pip install ws3[agent]
ws3-agent-mcp --model-path path/to/model --model-name my_model
import ws3.agent

if ws3.agent.available():
    result = ws3.agent.run('build_mask', 'mature spruce stands', context=fm)
    print(result.value if result.ok else result.errors)

In IPython / Jupyter, magics operate on a ForestModel named fm in scope:

%ws3_capabilities              # list all registered capabilities
%ws3_inspect_model             # metadata snapshot of `fm`
%ws3_hint "how do I add a theme"

Entirely optional. Core modelling never requires it, and import ws3 never loads it. Built on fresh-agent-core.

License

MIT License Copyright (c) 2025 Gregory Paradis.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  • The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  • The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.

Authors and Contributors

Primary Author:
Gregory Paradis — Lead developer and architect of the ws3 framework.

Additional Contributors:
Elaheh Ghasemi
Kathleen Coupland
Salar Ghotb

For full contribution history, see GitHub Contributors.

Getting Help

Download files

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

Source Distribution

ws3-1.1.0a5.tar.gz (165.2 kB view details)

Uploaded Source

Built Distribution

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

ws3-1.1.0a5-py3-none-any.whl (180.6 kB view details)

Uploaded Python 3

File details

Details for the file ws3-1.1.0a5.tar.gz.

File metadata

  • Download URL: ws3-1.1.0a5.tar.gz
  • Upload date:
  • Size: 165.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ws3-1.1.0a5.tar.gz
Algorithm Hash digest
SHA256 0ce0845515a2806a96d2cb04c264087ab1c39daca149fdeebc21ea18cfed7581
MD5 04aa856d1347ce03f5030e353ff25894
BLAKE2b-256 a8f8702d98aac72944cf08f0e11b63804977027cbc30c6abbec30fd6b686105b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ws3-1.1.0a5.tar.gz:

Publisher: release.yml on UBC-FRESH/ws3

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

File details

Details for the file ws3-1.1.0a5-py3-none-any.whl.

File metadata

  • Download URL: ws3-1.1.0a5-py3-none-any.whl
  • Upload date:
  • Size: 180.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ws3-1.1.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 e70d53d366841311c654327fd716f0b9f6cabdc082e97083effa5685cae7c74b
MD5 9eaf5eb7719205b4039257316988567c
BLAKE2b-256 fbecbb06ce3e362fba762ca73e90cfc75dd5baeae676b06b53fe3dff0d23cc88

See more details on using hashes here.

Provenance

The following attestation bundles were made for ws3-1.1.0a5-py3-none-any.whl:

Publisher: release.yml on UBC-FRESH/ws3

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

Release history Release notifications | RSS feed

This release

1.1.0a5 This release

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.0.1.post3

2 files

0.0.1.post2

2 files

0.0.1.post1

2 files

0.0.1.post0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page