Skip to main content

simplesoilprofile

Release Build status codecov Commit activity License

A Python package for working with soil profile data in hydrological modeling applications, particularly focused on SWAP model integration.

Features

  • Object-oriented representation of soil layers and profiles with Pydantic validation
  • Support for van Genuchten parameters and physical soil properties
  • Integration with the SWAP model input format
  • API integration framework with example implementation for Belgian DOV
  • Visualization tools for soil profile display

Quick Start

Creating a Soil Profile

from simplesoilprofile import SoilLayer, SoilProfile

# Create soil layers
topsoil = SoilLayer(
    name="Topsoil",
    description="Sandy loam topsoil",
    theta_res=0.02,
    theta_sat=0.4,
    alpha=0.02,
    n=1.5,
    k_sat=10.0,
    texture_class="sandy loam",
    clay_content=10.0,
    silt_content=20.0,
    sand_content=70.0,
)

subsoil = SoilLayer(
    name="Subsoil",
    description="Clay loam subsoil",
    theta_res=0.05,
    theta_sat=0.45,
    alpha=0.01,
    n=1.3,
    k_sat=5.0,
    texture_class="clay loam",
    clay_content=30.0,
    silt_content=35.0,
    sand_content=35.0,
)

# Create a profile
profile = SoilProfile(
    name="Test Profile",
    layers=[topsoil, subsoil],
    layer_depths={
        0: (0, 30),    # Topsoil from 0-30 cm
        1: (30, 100),  # Subsoil from 30-100 cm
    },
    x=100.0,
    y=200.0,
    z=5.0,
)

Generating SWAP Input

from simplesoilprofile.models.swap import write_swap_soil_file

# Write to a SWAP soil file
with open("soil.swp", "w") as f:
    write_swap_soil_file(profile, f)

Visualizing a Profile

import matplotlib.pyplot as plt
from simplesoilprofile.plotting import plot_profile

# Create a new figure
fig, ax = plt.subplots(figsize=(8, 12))

# Plot the profile
plot_profile(profile, ax=ax, show_properties=True)
plt.show()

Metadata

Release files for simplesoilprofile 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplesoilprofile 0.0.9
File Size Uploaded
simplesoilprofile-0.0.9.tar.gz 91.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simplesoilprofile 0.0.9
File Interpreter ABI Platform
simplesoilprofile-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 109.8 kB

Release files / simplesoilprofile-0.0.9.tar.gz

Download URL simplesoilprofile-0.0.9.tar.gz
Size 91.0 kB
Tags Source
SHA-256 checksum
How to use checksums
51e434be415670077fa7f5cd930f2f71a585a990c9326e4ea8b18b6f975169e2
BLAKE2b-256 checksum
How to use checksums
9acb3189f12453410b180c421b44c32f5014032de4135c60d82a430697656d12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / simplesoilprofile-0.0.9-py3-none-any.whl

Download URL simplesoilprofile-0.0.9-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c5fadcbac08dd0c3c8d4876a8e07cfc6a9900acb9a4e3f2ca8dc32e652498ca
BLAKE2b-256 checksum
How to use checksums
1d03577058625b1b00ad3c3ab9f4ad1a77cb8d6850884838252af4e9004ff200
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release 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