vibesketcher.document.porosity_store¶
Porosity estimates stored on a periodic structure, with undo and stale marking (#206).
store() attaches a reference estimate (vibesketcher.document.porosity.analyse())
to its structure’s provenance["porosity"] as one revision-checked edit. The
record keeps the structure’s content digest (the digest leaves provenance out, so
storing changes no digest). An estimate whose digest no longer matches its
structure is stale: stored() marks it, undo() refuses once the
structure changed, and the publication table writers refuse to write it.
Stored estimates travel with the document: in the .vsk file and in the QVF
document section. QVF has no porosity contract, so the QVF writers also add a
non-critical vendor section x_vibesketch.porosity (QVF_KIND) holding
every stored estimate with its structure digest; from_qvf() reads it.
Every record is labelled a geometric planning estimate: geometric void is not adsorption capacity, and no surface area here is a BET surface area.
Module Attributes
Stored estimates one structure may hold. |
Functions
|
One stored estimate (the latest when |
|
A stored estimate that still matches its structure; a stale one is refused. |
|
The stored estimates of a QVF's |
|
The |
|
Attach |
|
The stored estimates, oldest first, each marked |
|
The stored estimates without their full estimate payload. |
|
Remove the last stored estimate; refused once the structure changed since. |
- vibesketcher.document.porosity_store.MAX_STORED = 16¶
Stored estimates one structure may hold.
- vibesketcher.document.porosity_store.stored(structure)[source]¶
The stored estimates, oldest first, each marked
staleagainst the structure now.- Parameters:
structure (PeriodicStructure)
- Return type:
- vibesketcher.document.porosity_store.summaries(structure)[source]¶
The stored estimates without their full estimate payload.
- Parameters:
structure (PeriodicStructure)
- Return type:
- vibesketcher.document.porosity_store.entry(structure, identifier=None)[source]¶
One stored estimate (the latest when
identifieris None), marked stale or not.- Parameters:
structure (PeriodicStructure)
identifier (str | None)
- Return type:
- vibesketcher.document.porosity_store.fresh(structure, identifier=None)[source]¶
A stored estimate that still matches its structure; a stale one is refused.
- Parameters:
structure (PeriodicStructure)
identifier (str | None)
- Return type:
- vibesketcher.document.porosity_store.store(document, result, *, revision=None, identifier=None)[source]¶
Attach
resultto its structure as one undoable edit; returns (document, entry).Refuses (
PorosityRefused) whenrevisionis not the document’s, when the result belongs to another version of the structure, or when the structure already holdsMAX_STOREDestimates.
- vibesketcher.document.porosity_store.undo(document, structure_id, *, revision=None)[source]¶
Remove the last stored estimate; refused once the structure changed since.
- vibesketcher.document.porosity_store.qvf_members(structures)[source]¶
The
x_vibesketch.porositymembers for these structures, or None when none stores any.- Parameters:
structures (list[PeriodicStructure])
- Return type: