Skip to content

Commit e308287

Browse files
committed
Level the ecosystem docs: cross-module topic pages linking module details, campaign and data-analysis notebooks, tutorial drift repair, aggregate reference sync, and submodules at current mains
1 parent 919426d commit e308287

33 files changed

Lines changed: 753 additions & 46 deletions

docs/analysis.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Analysis
2+
3+
Analysis starts with collected records, not with a new storage layer. Query a
4+
local store using its search DSL, pass compositions and energies to
5+
*httk-analyse*, and keep the returned hull or phase diagram as the immutable
6+
analysis snapshot. For a binary phase diagram, the documented API is:
7+
8+
```python
9+
from httk.analyse.matsci import PhaseDiagram
10+
11+
diagram = PhaseDiagram.from_compositions(
12+
[{"A": 1}, {"B": 1}, {"A": 1, "B": 1}],
13+
[0.0, 0.0, -2.0],
14+
ids=["A", "B", "AB"],
15+
)
16+
assert tuple(diagram.hull_indices) == (0, 1, 2)
17+
assert diagram.energy_above_hull[2] == 0.0
18+
```
19+
20+
`energy_above_hull` identifies entries above the stable lower envelope, while
21+
`phase_lines` exposes the supported boundaries. Query stores before building a
22+
diagram so the analysis input is explicit and reproducible. For data outside
23+
your local store, `OptimadeStore` is the synchronous read-only OPTIMADE client;
24+
discover an endpoint, query it, and save any resources you want to analyze
25+
locally.
26+
27+
## Read next
28+
29+
- [Generic lower hulls](https://docs.httk.org/httk-analyse/dev/main/generic-hulls/) and [phase diagrams](https://docs.httk.org/httk-analyse/dev/main/phase-diagrams/).
30+
- [OPTIMADE client](https://docs.httk.org/httk-serve/dev/main/optimade/client/), [data queries](https://docs.httk.org/httk-data/dev/main/db/), and [database details](https://docs.httk.org/httk-data/dev/main/details/db/).

docs/architecture.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ storage backend instead of leaking into the models or their callers.
7373
Most views convert from their backend only when data is actually requested.
7474
Constructing a view does not eagerly convert the underlying data, which avoids
7575
unnecessary conversions when a view is only passed along or partially used.
76+
77+
Read next: {doc}`structures`, {doc}`data`, {doc}`campaigns`, and {doc}`analysis`.

docs/campaigns.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Compute campaigns, small and large
2+
3+
Start locally with the four-command cycle: initialize a workspace, create a
4+
job, run its manager, and collect the result. The packaged `vasp-relax`
5+
workflow accepts a POSCAR and needs no runner authoring:
6+
7+
```console
8+
$ httk workflow workspace init . --name default
9+
$ httk workflow job new --workflow vasp-relax --input structure=POSCAR
10+
$ httk workflow run
11+
$ httk workflow collect --into results.sqlite
12+
```
13+
14+
The workspace holds durable state and provenance; collection is the boundary
15+
where finished jobs become records in *httk-data*. Re-collecting is safe and
16+
deduplicated. Run `httk workflow precheck WORKSPACE` before starting managers
17+
to report missing settings, runner references, and machine readiness.
18+
19+
For a remote, add and configure the machine, initialize its workspace, then
20+
transfer jobs and run a manager there:
21+
22+
```console
23+
httk workflow remote add kappa --template ssh-slurm
24+
httk workflow remote configure kappa \
25+
--set host=kappa.example.org --set username=rar \
26+
--set check_connectivity=yes
27+
httk workflow remote install kappa
28+
httk workflow workspace init kappa:/scratch/rar/httk/runs
29+
httk workflow workspace settings set kappa:runs slurm.partition batch
30+
httk workflow workspace settings set kappa:runs vasp.command "srun -n 32 vasp_std"
31+
httk workflow transfer default kappa:runs --job JOB-ID
32+
httk workflow precheck kappa:runs
33+
httk workflow run kappa:runs --workers 8
34+
httk workflow transfer kappa:runs default --state succeeded --state failed
35+
```
36+
37+
The remote workspace owns scheduler settings. A large campaign partitions
38+
ordinary workspaces, assigns root jobs by hash, round-robin, or explicit name,
39+
and keeps spawned children with their parent's partition. Use
40+
`campaign init`, `campaign submit`, `campaign start-managers`, and
41+
`campaign collect` to manage those partitions one at a time or together.
42+
43+
Author reusable workflows as packages with an `httk_workflow.toml` manifest.
44+
The nine-language SDK family gives the same runner surface from Python, Bash,
45+
C, Fortran, Rust, Perl, Ada, C++, and Java. jobflow/atomate2, CWL, PWD, and
46+
httk-v1 documents are also normal workflow language realizations.
47+
48+
Compiled packages declare `[workflow.build]`. Publication carries sources-only
49+
digests; `httk workflow build` builds and registers a binary per machine, so
50+
managers execute registered artifacts and never compile jobs themselves.
51+
52+
## Read next
53+
54+
- [Workflow quickstart](https://docs.httk.org/httk-workflow/dev/main/quickstart/), [campaigns](https://docs.httk.org/httk-workflow/dev/main/campaigns/), [collecting](https://docs.httk.org/httk-workflow/dev/main/collecting/), and [CLI](https://docs.httk.org/httk-workflow/dev/main/workflow_cli/).
55+
- [Workflow package authoring](https://docs.httk.org/httk-workflow/dev/main/workflow_packages/), [languages](https://docs.httk.org/httk-workflow/dev/main/workflow_languages/), and [SDKs](https://docs.httk.org/httk-workflow/dev/main/sdks/).
56+
- [CLI details](https://docs.httk.org/httk-workflow/dev/main/details/workflow_cli/), [package details](https://docs.httk.org/httk-workflow/dev/main/details/workflow_packages/), and [task-manager details](https://docs.httk.org/httk-workflow/dev/main/details/taskmanager/).

docs/conf.py

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@
142142
("py:obj", "ase.Atoms"),
143143
# The workflow CLI exposes argparse's private parser-action type.
144144
("py:class", "argparse._SubParsersAction"),
145+
# pymatgen is an optional dependency surfaced by the integrations layer.
146+
("py:class", "pymatgen.core.Structure"),
147+
("py:obj", "pymatgen.core.Structure"),
148+
# AutoAPI renders this TYPE_CHECKING-only record annotation without its
149+
# module qualification; the concrete record remains documented in the
150+
# storage records module.
151+
("py:class", "NormalizedCompositionRecord"),
145152
# SQLAlchemy is optional, and these internal-facing signatures have no vendored
146153
# external inventory.
147154
("py:class", "sqlalchemy.Engine"),
@@ -163,6 +170,13 @@
163170
("py:class", "FilterAst"),
164171
("py:class", "_Context"),
165172
("py:class", "_BackingPlan"),
173+
# PyMongo publishes no usable intersphinx target for its client class; this
174+
# targeted ignore follows the sanctioned external-type precedent in httk-core.
175+
("py:class", "pymongo.MongoClient"),
176+
# The parallel bulk-ingest merge entry points (bulk_parallel.merge and
177+
# ParallelController) carry the module-private worker-manifest type in their
178+
# signatures; AutoAPI intentionally omits that implementation dataclass.
179+
("py:class", "_WorkerManifest"),
166180
# StoredEntrySource is lazily re-exported from httk.data.db; AutoAPI keeps
167181
# the public annotation but indexes its defining module instead.
168182
("py:class", "httk.data.db.StoredEntrySource"),
@@ -193,19 +207,18 @@
193207
"adapter_runtime",
194208
"cli",
195209
"workflow_cli",
196-
# Compatibility internals: the engines are public, their runners and the
197-
# v1 CLI alias and shared import tail are not.
198-
"compat._integration",
199-
"compat.cwl.cwl_runner",
200-
"compat.pwd.pwd_runner",
201-
"compat.v1._runner",
202-
"compat.v1.cli",
210+
# Language runners are internal; the language registration modules are
211+
# public.
212+
"languages.cwl.cwl_runner",
213+
"languages.pwd.pwd_runner",
214+
"languages.jobflow.jobflow_runner",
215+
"languages.httk_v1.v1_runner",
203216
# The VASP facade is public; the cohesive modules it re-exports are not.
204217
"vasp.inputs",
205218
"vasp.diagnostics",
206219
"vasp.remedies",
207220
"vasp.reports",
208-
"vasp.templates",
221+
"vasp.workflows",
209222
)
210223
nitpick_ignore_regex = [
211224
# AutoAPI renders these imported helper names as bare _common.* targets in
@@ -255,10 +268,12 @@
255268
"httk.workflow.sdk",
256269
"httk.workflow.runtime",
257270
"httk.workflow.runtime_utils",
271+
"httk.workflow.hookapi",
258272
"httk.workflow.scaffold",
259-
"httk.workflow.backends",
273+
"httk.workflow.executors",
260274
"httk.workflow.shell_bridge",
261-
"httk.workflow.harvesting",
275+
"httk.workflow.collecting",
276+
"httk.workflow.provenance",
262277
"httk.workflow.supervision",
263278
"httk.workflow.transfers",
264279
"httk.workflow.manifests",
@@ -270,8 +285,11 @@
270285
"httk.workflow.vasp",
271286
"httk.workflow.compat",
272287
"httk.workflow.compat.v1",
273-
"httk.workflow.compat.cwl",
274-
"httk.workflow.compat.pwd",
288+
"httk.workflow.languages",
289+
"httk.workflow.languages.cwl",
290+
"httk.workflow.languages.pwd",
291+
"httk.workflow.languages.jobflow",
292+
"httk.workflow.languages.httk_v1",
275293
}
276294
)
277295
_workflow_exports_cache: dict[str, frozenset[str] | None] = {}

docs/data.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Storing, querying, and serving data
2+
3+
*httk₂* keeps data models separate from storage. Plain frozen dataclasses can
4+
be stored in SQLite or DuckDB through `SqlStore`, or in MongoDB through
5+
`MongoStore`; the same records and neutral query protocols travel across those
6+
backends. Content addressing deduplicates equal records while a local `sid`
7+
identifies a row in one store.
8+
9+
```python
10+
from dataclasses import dataclass
11+
from tempfile import TemporaryDirectory
12+
13+
from httk.data.db import Database, SqlStore
14+
15+
@dataclass(frozen=True)
16+
class Result:
17+
formula: str
18+
19+
record = Result("NaCl")
20+
with TemporaryDirectory() as directory:
21+
db = Database.sqlite(f"{directory}/results.sqlite")
22+
store = SqlStore(db, entry_records={})
23+
with store.transaction():
24+
sid = store.save(record)
25+
assert store.fetch(type(record), sid) == record
26+
```
27+
28+
The search DSL binds a record class to a variable, adds comparisons or
29+
collection predicates such as `has`, `has_any`, and `has_only`, then returns a
30+
lazy result set. `bulk_ingest(workers=N)` is the faster path for building a
31+
large store; use ordinary `save()` for a small increment.
32+
33+
MongoDB uses the same model and store surface when MongoDB is already the
34+
operational data service:
35+
36+
```python
37+
from httk.data.mongo import MongoDatabase, MongoStore
38+
39+
with MongoDatabase.connect(uri, database="materials") as database:
40+
store = MongoStore(database, entry_records={})
41+
```
42+
43+
Federation presents existing stores as one read-only, source-major union. A
44+
provider turns a store or in-memory records into the neutral entry-provider
45+
contract, and *httk-serve* can expose one or more providers through OPTIMADE:
46+
47+
```python
48+
from httk.serve.optimade import adapter_from_providers, serve
49+
50+
serve(adapter_from_providers([provider]), port=8080)
51+
```
52+
53+
Construct `adapter_from_providers([provider])` first when testing or embedding the adapter; `serve(...)` is the quick development-server path.
54+
For deployment, use `create_asgi_app` as the interface to any ASGI server.
55+
56+
## Read next
57+
58+
- [Data management](https://docs.httk.org/httk-data/dev/main/data/), [database storage](https://docs.httk.org/httk-data/dev/main/db/), [MongoDB](https://docs.httk.org/httk-data/dev/main/mongo/), and [federation](https://docs.httk.org/httk-data/dev/main/federation/).
59+
- [Database details](https://docs.httk.org/httk-data/dev/main/details/db/) and [MongoDB details](https://docs.httk.org/httk-data/dev/main/details/mongo/).
60+
- [OPTIMADE serving](https://docs.httk.org/httk-serve/dev/main/optimade/serving_providers/) and [core definition details](https://docs.httk.org/httk-core/dev/main/details/optimade_definitions/).

docs/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ publishes its own subsite under [docs.httk.org](https://docs.httk.org); the
2020
```{admonition} Quick links
2121
:class: tip
2222
23+
- **Working with httk₂**:
24+
{doc}`structures`, {doc}`data`, {doc}`campaigns`, and {doc}`analysis` — the
25+
ecosystem-level path from input files to results and analysis.
2326
- **Module directory**: {doc}`modules` — every *httk₂* module and where its docs live.
2427
- **API reference**: {doc}`reference/index` — the aggregate reference for the published modules on this site.
2528
- **Tutorial**: {doc}`tutorial/index` — the original short
2629
example sequence translated to current APIs, including the remaining gaps.
2730
- **Example notebooks**: {doc}`notebooks/index` — runnable tours of the core and cross-module APIs.
2831
```
2932

33+
The topic pages are short and practical; they link onward to the module
34+
documentation for the complete guides and API details.
35+
3036
## Install
3137

3238
Preferably work in a Python virtual environment.
@@ -80,6 +86,10 @@ The public namespace is split across independently installable distributions:
8086
8187
modules
8288
architecture
89+
structures
90+
data
91+
campaigns
92+
analysis
8393
authoring
8494
tutorial/index
8595
reference/index

docs/modules.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Shared contracts, exact vector and datastream models, OPTIMADE definitions,
1212
registries, and dependency-free record models. Import path: `httk.core`.
1313

1414
- API reference: {doc}`httk.core </reference/autoapi/httk/core/index>`
15+
- Module documentation: <https://docs.httk.org/httk-core/dev/main/>
1516
- Repository: <https://github.com/httk/httk-core>
1617

1718
### httk-atomistic
@@ -20,6 +21,7 @@ Exact crystal-structure and symmetry representations. Import path:
2021
`httk.atomistic`.
2122

2223
- API reference: {doc}`httk.atomistic </reference/autoapi/httk/atomistic/index>`
24+
- Module documentation: <https://docs.httk.org/httk-atomistic/dev/main/>
2325
- Repository: <https://github.com/httk/httk-atomistic>
2426

2527
### httk-analyse
@@ -28,6 +30,7 @@ Generic lower-convex-hull construction and materials-science phase-diagram
2830
analysis. Import path: `httk.analyse`.
2931

3032
- API reference: {doc}`httk.analyse </reference/autoapi/httk/analyse/index>`
33+
- Module documentation: <https://docs.httk.org/httk-analyse/dev/main/>
3134
- Repository: <https://github.com/httk/httk-analyse>
3235

3336
### httk-io
@@ -36,6 +39,7 @@ File-format parsing and writing capabilities, including CIF and POSCAR. Import
3639
path: `httk.io`.
3740

3841
- API reference: {doc}`httk.io </reference/autoapi/httk/io/index>`
42+
- Module documentation: <https://docs.httk.org/httk-io/dev/main/>
3943
- Repository: <https://github.com/httk/httk-io>
4044

4145
### httk-data
@@ -44,6 +48,7 @@ Data-management capabilities and validation over core's provider and definition
4448
contracts. Import path: `httk.data`.
4549

4650
- API reference: {doc}`httk.data </reference/autoapi/httk/data/index>`
51+
- Module documentation: <https://docs.httk.org/httk-data/dev/main/>
4752
- Repository: <https://github.com/httk/httk-data>
4853

4954
### httk-serve
@@ -52,6 +57,7 @@ Web-facing application and OPTIMADE protocol serving capabilities. Import paths:
5257
`httk.serve.web` and `httk.serve.optimade`.
5358

5459
- API reference: {doc}`httk.serve </reference/autoapi/httk/serve/index>`
60+
- Module documentation: <https://docs.httk.org/httk-serve/dev/main/>
5561
- Repository: <https://github.com/httk/httk-serve>
5662

5763
### httk-workflow
@@ -60,6 +66,7 @@ Workflow and calculation orchestration capabilities. Import path:
6066
`httk.workflow`.
6167

6268
- API reference: {doc}`httk.workflow </reference/autoapi/httk/workflow/index>`
69+
- Module documentation: <https://docs.httk.org/httk-workflow/dev/main/>
6370
- Repository: <https://github.com/httk/httk-workflow>
6471

6572
## Selected snapshot versions

0 commit comments

Comments
 (0)