Skip to content

bioepic-data/ecosim-agent / .agents/skills/ameriflux-surgo-grid-extract

ameriflux-surgo-grid-extract

Verified

Extract soil profiles for EcoSIM from gSSURGO or FAO HWSD2, compare texture/carbon with site BIF and field evidence, and apply documented grid corrections. Use when deriving soil depth, bulk density, field capacity, wilting point, hydraulic conductivity, texture, rock fraction, pH, CEC, or soil organic carbon; or when converting EcoSIM grid NetCDF files to editable Excel workbooks and back.

test_extract_gssurgo_profile.py

View on GitHub
#!/usr/bin/env python3
"""Tests for gSSURGO water-retention conversion to EcoSIM's fine-earth basis."""

import math
import sys
import unittest
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent))

import extract_gssurgo_profile as gssurgo


class FineEarthWaterContentTests(unittest.TestCase):
    def test_whole_soil_percent_is_volumetric_without_rock(self):
        self.assertAlmostEqual(gssurgo.fine_earth_water_content(10.0, 0.0), 0.10)

    def test_rock_fraction_is_removed_from_volume(self):
        # Spivey (US-xGR) surface horizon: 7.9 % whole soil, 55 % rock
        self.assertAlmostEqual(gssurgo.fine_earth_water_content(7.9, 0.55), 0.079 / 0.45)

    def test_not_multiplied_by_bulk_density(self):
        self.assertLess(gssurgo.fine_earth_water_content(20.0, 0.0), 0.2 + 1e-12)

    def test_missing_rock_and_extreme_rock_leave_whole_soil_value(self):
        self.assertAlmostEqual(gssurgo.fine_earth_water_content(12.0, float("nan")), 0.12)
        self.assertAlmostEqual(gssurgo.fine_earth_water_content(12.0, 0.97), 0.12)

    def test_missing_water_is_nan(self):
        self.assertTrue(math.isnan(gssurgo.fine_earth_water_content(float("nan"), 0.1)))


if __name__ == "__main__":
    unittest.main()
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall