Metadata-Version: 2.4
Name: valence-domains
Version: 0.4.1
Summary: ADCIRC mesh registry - domain management and validation for mesh data
Author-email: Dominik Mattioli <iqh766c2@duck.com>
License: PolyForm Noncommercial License 1.0.0
        
        <https://polyformproject.org/licenses/noncommercial/1.0.0>
        
        Required Notice: Copyright (c) 2026 Dominik Mattioli
        
        ## Acceptance
        
        In order to get any license under these terms, you must agree to them as both
        strict obligations and conditions to all your licenses.
        
        ## Copyright License
        
        The licensor grants you a copyright license for the software to do everything
        you might do with the software that would otherwise infringe the licensor's
        copyright in it for any permitted purpose. However, you may only distribute the
        software according to Distribution License and make changes or new works based
        on the software according to Changes and New Works License.
        
        ## Distribution License
        
        The licensor grants you an additional copyright license to distribute copies of
        the software. Your license to distribute covers distributing the software with
        changes and new works permitted by Changes and New Works License.
        
        ## Notices
        
        You must ensure that anyone who gets a copy of any part of the software from you
        also gets a copy of these terms or the URL for them above, as well as copies of
        any plain-text lines beginning with Required Notice: that the licensor provided
        with the software. For example:
        
        Required Notice: Copyright (c) 2026 Dominik Mattioli
        
        ## Changes and New Works License
        
        The licensor grants you an additional copyright license to make changes and new
        works based on the software for any permitted purpose.
        
        ## Patent License
        
        The licensor grants you a patent license for the software that covers patent
        claims the licensor can license, or becomes able to license, that you would
        infringe by using the software.
        
        ## Noncommercial Purposes
        
        Any noncommercial purpose is a permitted purpose.
        
        ## Personal Uses
        
        Personal use for research, experiment, and testing for the benefit of public
        knowledge, personal study, private entertainment, hobby projects, amateur
        pursuits, or religious observance, without any anticipated commercial
        application, is use for a permitted purpose.
        
        ## Noncommercial Organizations
        
        Use by any charitable organization, educational institution, public research
        organization, public safety or health organization, environmental protection
        organization, or government institution is use for a permitted purpose
        regardless of the source of funding or obligations resulting from the funding.
        
        ## Fair Use
        
        You may have "fair use" rights for the software under the law. These terms do
        not limit them.
        
        ## No Other Rights
        
        These terms do not allow you to sublicense or transfer any of your licenses to
        anyone else, or prevent the licensor from granting licenses to anyone else.
        These terms do not imply any other licenses.
        
        ## Patent Defense
        
        If you make any written claim that the software infringes or contributes to
        infringement of any patent, your patent license for the software granted under
        these terms ends immediately. If your company makes such a claim, your patent
        license ends immediately for work on behalf of your company.
        
        ## Violations
        
        The first time you are notified in writing that you have violated any of these
        terms, or done anything with the software not covered by your licenses, your
        licenses can nonetheless continue if you come into full compliance with these
        terms, and take practical steps to correct past violations, within 32 days of
        receiving notice. Otherwise, all your licenses end immediately.
        
        ## No Liability
        
        As far as the law allows, the software comes as is, without any warranty or
        condition, and the licensor will not be liable to you for any damages arising
        out of these terms or the use or nature of the software, under any kind of legal
        claim.
        
        ## Definitions
        
        The licensor is the individual or entity offering these terms, and the software
        is the software the licensor makes available under these terms.
        
        You refers to the individual or entity agreeing to these terms.
        
        Your company is any legal entity, sole proprietorship, or other kind of
        organization that you work for, plus all organizations that have control over,
        are under the control of, or are under common control with that organization.
        Control means ownership of substantially all the assets of an entity, or the
        power to direct its management and policies by vote, contract, or otherwise.
        Control can be direct or indirect.
        
        Your licenses are all the licenses granted to you for the software under these
        terms.
        
        Use means anything you do with the software requiring one of your licenses.
        
        ----------------------------------------------------------------------------
        
        ADDITIONAL RESTRICTION — NO AI/ML TRAINING (licensor-added term)
        
        This is an additional term layered on top of the PolyForm Noncommercial License
        1.0.0 above. Because of it, this combined document is NOT the unmodified
        PolyForm Noncommercial License 1.0.0.
        
        Notwithstanding any permitted purpose above, you may NOT, without a separate
        written license from the licensor, use the software or any part of it:
        
          (a) as training data, fine-tuning data, evaluation data, or other input for
              any machine-learning or artificial-intelligence model, system, or
              dataset; or
        
          (b) for automated code generation, model distillation, or the construction of
              embeddings, indexes, or retrieval corpora derived from the software.
        
        This restriction applies even to otherwise-permitted noncommercial use.
        
        COMMERCIAL AND AI-TRAINING LICENSES
        
        For commercial use, or for AI/ML training rights, contact: domburner@duck.com
        
Project-URL: Repository, https://github.com/domattioli/ADMESH-Domains
Project-URL: Documentation, https://github.com/domattioli/ADMESH-Domains/blob/main/docs
Project-URL: Issues, https://github.com/domattioli/ADMESH-Domains/issues
Keywords: adcirc,mesh,registry,coastal,simulation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tomli>=1.1.0; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=22.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: shapely>=2.0; extra == "dev"
Provides-Extra: hf
Requires-Dist: huggingface_hub>=0.20; extra == "hf"
Provides-Extra: suggest
Requires-Dist: shapely>=2.0; extra == "suggest"
Provides-Extra: publish
Requires-Dist: huggingface_hub>=0.20; extra == "publish"
Requires-Dist: pyarrow>=14.0; extra == "publish"
Requires-Dist: jinja2>=3.0; extra == "publish"
Requires-Dist: twine>=4.0; extra == "publish"
Requires-Dist: build>=1.0; extra == "publish"
Requires-Dist: matplotlib>=3.5; extra == "publish"
Requires-Dist: tomlkit>=0.12; extra == "publish"
Provides-Extra: gen
Requires-Dist: chilmesh>=0.2.0; extra == "gen"
Requires-Dist: numpy>=1.20; extra == "gen"
Requires-Dist: scipy>=1.7; extra == "gen"
Provides-Extra: viz
Requires-Dist: chilmesh>=0.2.0; extra == "viz"
Requires-Dist: matplotlib>=3.5; extra == "viz"
Requires-Dist: pillow>=9.0; extra == "viz"
Dynamic: license-file

<h1 align="center">Valence</h1>

<p align="center">
  <strong>Curated registry of hydrodyanmic domain and meshes — a canonical `manifest.toml` with on-demand mesh fetch from the HuggingFace mirror.
</p>

<p align="center">
  <strong><a href="">Thomas Estep</a><sup>1†</sup> & <strong><a href="https://scholar.google.com/citations?user=IBFSkOcAAAAJ&hl=en">Dominik Mattioli</a><sup>1†</sup>,
  <sup>†</sup>Corresponding author | <sup>1</sup>Unaffiliated | <sup>2</sup>Ohio State University (CHIL)
</p>

<p align="center">
  <a href="https://pypi.org/project/valence-domains/">
    <img src="https://img.shields.io/pypi/v/valence-domains?style=flat-square&logo=python&logoColor=white" alt="PyPI">
  </a>
  <a href="https://github.com/domattioli/Valence/actions/workflows/tests.yml"><img src="https://github.com/domattioli/Valence/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
  <a href="https://doi.org/10.5281/zenodo.20519657"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.20519657.svg" alt="DOI"></a>
  <a href="https://github.com/domattioli/Valence/issues"><img src="https://img.shields.io/github/issues/domattioli/Valence" alt="Open issues"></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-PolyForm%20NC%20%2B%20No--AI-red.svg" alt="License"></a>
  <a href="https://huggingface.co/datasets/domattioli/Valence">
    <img src="https://img.shields.io/badge/HuggingFace-dataset-yellow.svg?style=flat-square&logo=huggingface" alt="HuggingFace Dataset">
  </a>
</p>

---

## Table of Contents

- [Why Valence](#why-valence)
- [Install](#install)
- [Quickstart](#quickstart)
- [Registry](#registry)
- [Ecosystem](#ecosystem)
- [Status & roadmap](#status--roadmap)
- [Citation](#citation)
- [Contact](#contact)
- [License](#license)

---


```mermaid
flowchart LR
    A["registry_data/\nmanifest.toml"] --> B["valence_domains/data/\nmanifest.toml\n(bundled in wheel)"]
    A --> C["Parquet sidecar\n(auto-generated)"]
    B --> D["HuggingFace Hub\ndomattioli/Valence"]
    C --> D
    D -->|"Mesh.load()\non demand"| E["chilmesh.Mesh"]
```

## Why Valence

Hydrodynamic mesh data is scattered and hard to reproduce. Valence provides a single curated catalog with:

- **Canonical `manifest.toml`** — one source of truth for mesh metadata (provenance, element type, lineage).
- **On-demand fetch** — `Mesh.load()` pulls from the HuggingFace mirror; no bulk download required.
- **PR-based contribution** — add a new domain mesh through a validated pull request; validator runs on every push.
- **Reproducible data releases** — code changes → PyPI + HF tagged `vX.Y.Z`; data updates → HF tagged `data-YYYY-MM-DD-<sha7>`, PyPI untouched.

**Browse registry: [domattioli.github.io/Valence](https://domattioli.github.io/Valence/)** — interactive map, search, preview, download, contribute.

| Where to go | What you'll find |
|---|---|
| [domattioli.github.io/Valence](https://domattioli.github.io/Valence/) | Website (browse / preview / download / contribute) |
| [pypi.org/project/valence-domains](https://pypi.org/project/valence-domains/) | Python package |
| [huggingface.co/datasets/domattioli/Valence](https://huggingface.co/datasets/domattioli/Valence) | Mesh files + Parquet sidecar + auto-generated dataset card |

This repo is for **contributors and maintainers** — data, schema, publisher pipeline, and CI live here. End users normally don't need to clone; `pip install valence-domains[hf]` is enough.

## Install

```bash
# Read bundled manifest only (no mesh downloads, ~50 KB install)
pip install valence-domains

# Add Mesh.load() — fetches mesh files from HF mirror on demand
pip install valence-domains[hf]

# Add synthetic-mesh generator (numpy + scipy)
pip install valence-domains[gen]
```

User-facing API (`find_domains`, `find_meshes`, `get_mesh`, `test_meshes`, `Mesh.load`) documented on the HF dataset card. For pytest fixtures, use `from valence_domains import test_meshes` — returns all registry meshes marked for testing.

## Quickstart

Deterministic random fort.14 generator for tests, documentation, and mesh-comparison fixtures:

```bash
# Write a single deterministic fort.14
valence-domains generate --output mesh.14 --seed 42 --node-count 500

# Triangle / quad / mixed elements
valence-domains generate --output tri.14  --element-type triangle --seed 1
valence-domains generate --output quad.14 --element-type quad     --seed 1
```

Same `--seed` + `--node-count` + `--element-type` → byte-identical output. Requires the `[gen]` extra (numpy + scipy).

## Examples

Query the registry and load a mesh on demand (requires the `[hf]` extra):

```python
from valence_domains import find_domains, find_meshes, get_mesh, test_meshes

# Discover what's registered
find_domains()                      # all domains in the manifest
find_meshes(domain="WNAT")          # meshes within a domain

# Fetch a specific mesh (downloads from the HuggingFace mirror, cached)
mesh = get_mesh("WNAT/hagen@v1")
nodes, elements = mesh.load()       # fort.14 contents

# Meshes flagged for use as test fixtures
for m in test_meshes():
    ...
```

See the [HuggingFace dataset card](https://huggingface.co/datasets/domattioli/ADMESH-Domains) for the full API reference.

## Registry

### Repo layout

```
valence/                 Python package (schema, manifest loader, query API,
                         CLI, HF publisher, dataset-card template)
valence/data/            Bundled manifest.toml shipped in wheel
registry_data/           Source-of-truth manifest + mesh files (.14, .2dm)
                         excluded from wheel/sdist; mirrored to HF
specs/                   Spec-driven design docs (one folder per feature)
scripts/                 One-shot data tooling (mesh import, bbox extractor)
tests/                   pytest suite (mocked huggingface_hub)
.github/workflows/       release.yml (tag → PyPI + HF) + validate-pr.yml (CI)
```


## Ecosystem

| Repo | Role |
|---|---|
| [CHILmesh](https://github.com/domattioli/CHILmesh) | Core mesh engine; `Mesh.from_admesh_domain()` reads from this registry |
| [ADMESH](https://github.com/domattioli/ADMESH) | Mesh generator this registry complements; WNAT_Hagen.14 is the ADMESH reference domain |
| [QuADMesh](https://github.com/domattioli/QuADMesh) | Quad mesh generator; uses registry domains as test inputs |
| [MADMESHing](https://github.com/domattioli/MADMESHing) | Benchmark harness; pulls Block-O from this registry |

**HuggingFace slug**: [`domattioli/Valence`](https://huggingface.co/datasets/domattioli/Valence).


## Status & Roadmap
Coming soon


See [CHANGELOG.md](CHANGELOG.md) for full release history.

## Citation

**This software** (cite the archived release):

> Mattioli, D. & Estep, T. (2026). *Valence: Curated registry of hydrodynamic domains and meshes.* Zenodo. <https://doi.org/10.5281/zenodo.20519657>


## Contact

#### Thomas Estep     - ([repo co owner](https://github.com/thomas-estep/))
#### Dominik Mattioli - ([repo co owner](https://github.com/domattioli/))

## License

**Noncommercial / research use only.** Licensed under the PolyForm Noncommercial License 1.0.0 **with an additional No-AI/ML-training restriction** — see [LICENSE](LICENSE) and [AI-USAGE.md](AI-USAGE.md). No commercial use and no use as AI/ML training data without a separate written license. Commercial or AI-training licenses: contact domattioli via mango-kooky-okay@duck.com

