library-evaluation-integration

Create evaluation scripts and integration tests for Python scientific libraries in the digitalmodel package. Follows the established pattern from fluids, ht, meshio, sectionproperties, and pygmt evaluations.

5 stars

Best use case

library-evaluation-integration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create evaluation scripts and integration tests for Python scientific libraries in the digitalmodel package. Follows the established pattern from fluids, ht, meshio, sectionproperties, and pygmt evaluations.

Teams using library-evaluation-integration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/library-evaluation-integration/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.claude/skills/digitalmodel/library-evaluation-integration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/library-evaluation-integration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How library-evaluation-integration Compares

Feature / Agentlibrary-evaluation-integrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create evaluation scripts and integration tests for Python scientific libraries in the digitalmodel package. Follows the established pattern from fluids, ht, meshio, sectionproperties, and pygmt evaluations.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Library Evaluation + Integration Test Pattern

## Context
The digitalmodel repo (a sibling checkout, e.g. `$WORKROOT/digitalmodel` where `$WORKROOT` holds your repo checkouts) has a standard
pattern for evaluating and testing scientific Python library integrations:

- **Evaluation script**: `scripts/integrations/<lib>_evaluation.py`
- **Integration tests**: `tests/test_<lib>_integration.py`

## Workflow (4 phases)

### Phase 1: API Discovery (CRITICAL — don't skip)
Before writing ANY code, probe the actual installed API:

```bash
uv run python -c "import <lib>; print(<lib>.__version__)"
uv run python -c "import <lib>.<submodule>; print(dir(<lib>.<submodule>))"
uv run python -c "help(<lib>.<submodule>.<function>)"
```

**Why**: Library APIs change between versions. The ht.insulation module completely
changed its API surface in v1.2.0 (no more R_value functions, now k_material/nearest_material).
Always verify what's actually importable before writing imports.

### Phase 2: Compute Reference Values
Run each function with representative inputs and record the actual output:

```bash
uv run python -c "
from <lib>.<mod> import <func>
result = <func>(arg1, arg2)
print(f'result = {result}')
"
```

**Why**: Setting test assertions from textbook expectations can fail. Example: a subsea
pipeline U-value calculated to 0.29 W/m²/K which is realistic but was below the initial
bound of 0.5. Always compute first, then set bounds around the computed value.

### Phase 3: Test Edge Cases Interactively
Different functions handle edge cases differently — test before asserting:

```bash
# Test Re=0, Pr=0, T=T2, empty inputs, etc.
uv run python -c "
try:
    result = func(edge_case_args)
    print(f'Returns: {result}')
except Exception as e:
    print(f'Raises: {type(e).__name__}: {e}')
"
```

**Pitfall discovered**: In ht library, `Nu_conv_internal(Re=0)` raises ValueError
but `Nu_cylinder_Churchill_Bernstein(Re=0)` returns 0.3. Can't assume uniform
edge-case behavior across submodules.

### Phase 4: Write Files

#### Evaluation Script Structure
```python
#!/usr/bin/env python3
"""<Library Name> — Evaluation Script.

Demonstrates <lib> integration for offshore/engineering workflows.
Library: <url> (v<version>, <license>)
"""

import <lib>
from <lib>.<submod> import <func>

def demo_capability_1():
    """Description with engineering context."""
    print("=" * 65)
    print("1. CAPABILITY NAME")
    print("=" * 65)
    # Scenario description, calculations, formatted output
    print()

# ... more demo functions ...

def main():
    print("*" * 65)
    print(f"  <Library> — Evaluation Script")
    print(f"  Version: {<lib>.__version__}")
    print("*" * 65)
    demo_capability_1()
    # ...
    print("  Evaluation complete.")

if __name__ == "__main__":
    main()
```

#### Integration Test Structure
```python
"""<Library> integration tests.

Library: <url> (v<version>, <license>)
Tests: import checks, known-value verification, edge cases, physics sanity.
All values in SI units.
"""
import math
import pytest

<lib> = pytest.importorskip("<lib>")
from <lib>.<submod> import <func>

class TestImportAndVersion:
    def test_import(self): ...
    def test_version(self): ...
    def test_submodules_importable(self): ...

class TestCapability1:
    def test_known_value(self):
        """Compare against pre-computed reference value."""
        result = func(args)
        assert result == pytest.approx(REFERENCE, rel=1e-2)

    def test_monotonicity(self):
        """Physical quantity increases/decreases with parameter."""

    def test_edge_case(self):
        """Re=0, T=0, empty input, etc."""

    def test_physics_sanity(self):
        """Nu > 0, 0 <= eff <= 1, R > 0, etc."""
```

## Test Categories (aim for 15+ tests)
1. **Import/version** (2-3 tests): importorskip, version check, submodules
2. **Known-value verification** (1 per capability): pre-computed reference values
3. **Monotonicity/physics** (1-2 per capability): Nu increases with Re, etc.
4. **Edge cases** (2-3 total): zero inputs, extreme values, domain errors
5. **Unit consistency** (1-2): dimensional analysis checks
6. **Integration/end-to-end** (1-2): combine multiple functions into realistic workflow

## Pitfalls
- **Always use `uv run`** — never bare `python3` (project policy)
- **pytest.approx with rel tolerance** — use rel=1e-2 for engineering correlations,
  rel=1e-6 for analytical formulas, abs for zero-valued results
- **Don't guess assertion bounds** — compute the value first, then verify it makes
  physical sense, THEN set the test bounds around it
- **API drift** — when user says "check what's available", always probe with dir()
  and help() before writing imports
- **Randomized test ordering** — the repo uses pytest-randomly; tests must be independent

Related Skills

clean-worktree-integration-from-dirty-main

5
from vamseeachanta/workspace-hub

Land validated issue work from isolated worktrees when the main checkout is dirty by creating a fresh integration worktree, cherry-picking only implementation commits, re-running combined validation, and preparing push/closeout artifacts.

hermes-ecosystem-integration

5
from vamseeachanta/workspace-hub

Wire Hermes into workspace-hub ecosystem — multi-repo skills, config sync, session export to learning pipeline, memory cross-pollination, skill patch tracking, and cross-machine health checks.

api-integration

5
from vamseeachanta/workspace-hub

Integrate offshore engineering software APIs with mock testing for OrcaFlex, AQWA, and WAMIT

llm-wiki-roadmap-integration

5
from vamseeachanta/workspace-hub

Integrate repo-ecosystem work into an existing llm-wiki / knowledge-roadmap issue without creating duplicate GitHub issues.

mkdocs-integration-with-python-package

5
from vamseeachanta/workspace-hub

Sub-skill of mkdocs: Integration with Python Package (+2).

improve-integration

5
from vamseeachanta/workspace-hub

Sub-skill of improve: Integration.

clean-code-pre-commit-integration

5
from vamseeachanta/workspace-hub

Sub-skill of clean-code: Pre-commit Integration.

agent-teams-work-queue-integration

5
from vamseeachanta/workspace-hub

Sub-skill of agent-teams: Work Queue Integration.

vscode-extensions-git-workflow-integration

5
from vamseeachanta/workspace-hub

Sub-skill of vscode-extensions: Git Workflow Integration (+1).

raycast-alfred-project-switcher-integration

5
from vamseeachanta/workspace-hub

Sub-skill of raycast-alfred: Project Switcher Integration.

raycast-alfred-5-raycast-extension-api-integration

5
from vamseeachanta/workspace-hub

Sub-skill of raycast-alfred: 5. Raycast Extension - API Integration.

docker-1-cicd-pipeline-integration

5
from vamseeachanta/workspace-hub

Sub-skill of docker: 1. CI/CD Pipeline Integration (+2).