Metadata-Version: 2.4
Name: valence-domains
Version: 0.4.2
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/Valence
Project-URL: Documentation, https://github.com/domattioli/Valence/blob/main/docs
Project-URL: Issues, https://github.com/domattioli/Valence/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>=1.2.1; extra == "gen"
Requires-Dist: numpy>=1.20; extra == "gen"
Requires-Dist: scipy>=1.7; extra == "gen"
Provides-Extra: viz
Requires-Dist: chilmesh>=1.2.1; 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>A curated registry of hydrodynamic domains and meshes — one canonical <code>manifest.toml</code>, with mesh files fetched on demand from a HuggingFace mirror.</strong>
</p>

<p align="center">
  <a href="https://github.com/thomas-estep">Thomas Estep</a> &amp; <a href="https://scholar.google.com/citations?user=IBFSkOcAAAAJ&hl=en">Dominik Mattioli</a><br>
  <sup>Unaffiliated</sup>
</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://pypi.org/project/valence-domains/"><img src="https://img.shields.io/badge/python-3.9-blue?style=flat-square" alt="Python 3.9"></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://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>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-PolyForm%20NC%20%2B%20No--AI-red.svg?style=flat-square" alt="License"></a>
</p>

---

## Table of Contents

- [Why Valence](#why-valence)
- [Installation](#installation)
- [Quickstart](#quickstart)
- [Examples](#examples)
- [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(derived at publish)"]
    B --> D["HuggingFace Hub\ndomattioli/Valence"]
    C --> D
    D -->|"Mesh.load()\non demand"| E["chilmesh.Mesh"]
```

## Why Valence

Hydrodynamic mesh data is scattered across papers, lab drives, and agency portals, and rarely reproducible. Valence consolidates it into one catalog of **13 Domains and 40 Meshes (~59 MB)**, addressable by composite ID (`WNAT/hagen@v1`):

- **One canonical `manifest.toml`** is the single source of truth for every mesh's metadata — provenance, element type, lineage. The Parquet sidecar is derived from it at publish time, never authoritative.
- **Mesh files load on demand.** `Mesh.load()` pulls a `.14`/`.2dm` from the HuggingFace mirror and caches it; the base wheel ships no mesh bytes (~50 KB install).
- **Contribution is a validated pull request.** The PR validator runs on every push; provenance is mandatory, so a generated stand-in cannot masquerade as a published mesh.
- **Code and data release on separate tracks.** Code/API/schema changes tag `vX.Y.Z` → PyPI + HF; mesh add/edit publishes to HF only (`data-YYYY-MM-DD-<sha7>`), leaving the PyPI version untouched.

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

| Surface | Contents |
|---|---|
| [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 + dataset card |

This repository holds the data, schema, publisher pipeline, and CI for **contributors and maintainers**. End users do not clone it — `pip install valence-domains[hf]` is enough.

## Installation

```bash
pip install valence-domains          # bundled manifest only (~50 KB, no mesh downloads)
pip install valence-domains[hf]      # + Mesh.load() — fetches mesh files from the HF mirror
pip install valence-domains[gen]     # + the synthetic-mesh generator (numpy + scipy)
```

The query API (`find_domains`, `find_meshes`, `get_mesh`, `test_meshes`, `Mesh.load`) is documented on the HF dataset card. For pytest fixtures, `from valence_domains import test_meshes` returns every registry mesh flagged for testing.

## Quickstart

The generator writes deterministic `fort.14` meshes for tests, docs, and comparison fixtures:

```bash
valence-domains generate --output mesh.14 --seed 42 --node-count 500
valence-domains generate --output tri.14  --element-type triangle --seed 1
valence-domains generate --output quad.14 --element-type quad     --seed 1
```

Identical `--seed` + `--node-count` + `--element-type` produce byte-identical output. Requires the `[gen]` extra.

## 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

find_domains()                      # every domain in the manifest
find_meshes(domain="WNAT")          # meshes within a domain

mesh = get_mesh("WNAT/hagen@v1")    # fetches from the HF mirror, cached
nodes, elements = mesh.load()       # fort.14 contents

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

Full API reference: the [HuggingFace dataset card](https://huggingface.co/datasets/domattioli/Valence).

## Registry

```
src/valence_domains/      Python package — schema, manifest loader, query API,
                          CLI, HF publisher, dataset-card template
src/valence_domains/data/ Bundled manifest.toml shipped in the 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) | Triangle mesh generator this registry complements; `WNAT_Hagen.14` is its 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 |

## Status & roadmap

- **Shipped** — `valence-domains` 0.4.1 on PyPI (renamed from `admesh-domains`, which remains a stub that redirects to it). Registry holds 13 Domains + 40 Meshes (~59 MB), mirrored to `domattioli/Valence` on HuggingFace.
- **Next** — content-UID identity for deduplication, domain lineage graph, expanded test-suite coverage.

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

## Citation

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

## Contact

- **Thomas Estep** — [github.com/thomas-estep](https://github.com/thomas-estep)
- **Dominik Mattioli** — [github.com/domattioli](https://github.com/domattioli)

## License

**Noncommercial / research use only.** 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; for either, contact Dominik Mattioli at mango-kooky-okay@duck.com.
