Skip to main content

CropForge

Open-source, code-first virtual farm runtime for agricultural researchers.

PyPI version Tests Docs License: MIT

CropForge lets you define a crop simulation entirely in Python. You write the model equations; CropForge handles time-stepping, spatial state management, logging, and visual playback.

pip install cropforge

What's New in v0.6.0

3D Topography and Land Preparation

  • Terrain Engine: Supports procedural generation, CSV import, and GeoTIFF ingestion for 3D elevation grids.
  • Land Preparation: Pre-simulation agronomic modifiers (RidgeFurrow, ContourBund, Terrace, DeepTillage, ConservationTillage) shape the land and alter soil physics.
  • D8 Hydrology Coupling: The physics engine natively routes lateral water and nutrient flows across the modified topography using the D8 steepest-descent algorithm.
  • 3D Dashboard Modal: A high-performance WebGL viewport seamlessly transitions from 2D heatmaps to an interactive 3D terrain viewer, letting you map agronomic variables (Nitrogen, Moisture) directly onto physical crop instances.

What's New in v0.5.0

White Minimal Scientific Dashboard

A complete rework of the visualisation layer built on Material Design:

  • Sleek, clean white minimal theme with refined borders and ample whitespace.
  • Persistent Farm Inspector (always visible, no click-to-reveal).
  • Left sidebar with all controls; right sidebar with live charts.
  • Animated preloader with per-field progress tracking.
  • All panels renamed to researcher-facing terminology.

Official Crop Plugins — StandardWheat & StandardMaize

First-party, PRD-verified crop plugins distributed as cropforge.plugins:

from cropforge.plugins import StandardWheat, StandardMaize

field.use_plugin(StandardWheat)    # CERES-Wheat phenology + RUE biomass + grain fill
field.use_plugin(StandardMaize)    # C4 parameters + root impedance + water stress
  • StandardWheat: 6-stage thermal-time phenology, RUE biomass, grain-fill partitioning into plant.custom['grain_biomass_g'].
  • StandardMaize: C4 photosynthesis parameters, hard-pan root clamping, water-stress mortality.
  • Both plugins are fully isolated per field — no cross-talk when running dual-plot comparisons.

Advanced Physics Engines

Two new opt-in physics engines, mathematically verified against PRD Crucible criteria:

Beer-Lambert Radiation Interception

farm.use_physics(radiation=True, k_extinction=0.45)
# Writes plant.custom['intercepted_par_mj'] for every plant every day

Implements: PAR_int = solar_rad × 0.5 × (1 − e^(−k × LAI)) Crucible verified: LAI=3.0, k=0.45, rad=15 MJ → 5.5557 MJ ±0.001.

Wind-driven Anisotropic Disease Spread

farm.use_physics(
    disease=True,
    disease_foci=[(15, 15)],          # Initial outbreak coordinates
    disease_wind_direction_deg=270.0,  # From West → spreads East
    disease_spread_rate=0.20,
    disease_anisotropy=0.80,
)

A spatially explicit SIR grid model where infection probability is heavily weighted by wind direction. Crucible verified: eastern half has 2.5× more infections than western half when wind blows East.


Quick Start

from cropforge import Farm, Field, Crop, Soil, Weather
from cropforge.plugins import StandardWheat

farm  = Farm(name="MyFarm", location=(28.6, 77.2))
field = Field(name="Plot A", rows=20, cols=30, area_ha=2.4)
field.set_crop(Crop(species="wheat"))
field.set_weather(Weather.from_csv("data/weather.csv", ...))
field.set_soil(Soil.from_csv("data/soil.csv", apply="uniform"))
farm.add_field(field)

field.use_plugin(StandardWheat)
farm.use_physics(radiation=True, disease=True, disease_wind_direction_deg=270.0)

farm.run(days=90)

See examples/wheat_basic_v2.py, examples/maize_dual_plot_v2.py, and examples/disease_outbreak_trial.py for complete working scripts.


What's New in v0.4.0

  • Plugin Ecosystem: Extensible architecture for third-party crop models via PyPI.
  • Multi-Season Rotations: Preserve soil state between consecutive runs.
  • Compare Dashboard: Compare multiple farm configs and export to CSV.
  • Spatial Hydrology: D8 lateral surface water routing across gridded fields.

What's New in v0.2.0

  • Opt-In Physics: FAO-56 Penman-Monteith ET0 and Root Impedance models.
  • Multi-Field Dashboard: Field Selector, comparative time-series, GxE analysis.

Documentation

Full documentation at cropforge.readthedocs.io.

Licence

MIT — Saswat Sundar Rath, ICAR-IARI Jharkhand, 2026

Download files

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

Source Distribution

cropforge-0.6.0.tar.gz (171.9 kB view details)

Uploaded Source

Built Distribution

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

cropforge-0.6.0-py3-none-any.whl (106.2 kB view details)

Uploaded Python 3

File details

Details for the file cropforge-0.6.0.tar.gz.

File metadata

  • Download URL: cropforge-0.6.0.tar.gz
  • Upload date:
  • Size: 171.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cropforge-0.6.0.tar.gz
Algorithm Hash digest
SHA256 e992fa6c1e39e107cb89423ec635d41ff6e76a4763b57d9d6fce850b30dfb881
MD5 5814bb7dc36c59df958d4bd40d108329
BLAKE2b-256 d8ab7ffe770f40f8e4e6fbb2e0a965dabfd4d307bfa35b7186944b5b88cf6bb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cropforge-0.6.0.tar.gz:

Publisher: publish.yml on saswatsundar123/CropForge

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

File details

Details for the file cropforge-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: cropforge-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 106.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cropforge-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79a483a721c09aae9e2cc86c9c9ffeb305626bf00800cc82094f086d8a255122
MD5 ebb0160e6ce7dc3a4035d44eec58c35a
BLAKE2b-256 2413deeb4b80bb590065234a337d1412d3c2631bf89db591b16f19ec3a2bf438

See more details on using hashes here.

Provenance

The following attestation bundles were made for cropforge-0.6.0-py3-none-any.whl:

Publisher: publish.yml on saswatsundar123/CropForge

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 Sentry Error logging StatusPage Status page