Provenance
Machine-readable provenance for one joint realization.
JointRealization.provenance is, in the public protocol, an
implementation-defined dict[str, Any]. This module gives this package's
own realizations a versioned, typed shape instead of an ad hoc mapping, so a
downstream consumer (or this project's own pipeline) can parse it reliably.
JointRealizationProvenance
¶
Bases: BaseModel
Structured, JSON-serializable provenance for one physical joint realization.
Records everything a realization depends on: the package version and the source tree's commit and dirty state, the seeded segmented process (root entropy, segment length and the samples drawn), and fingerprints of the per-mode response and analytic covariance the realization was synthesized from. Only scalars and short name lists appear; no channel data does.
Source code in src/gwmock_newtonian_noise/provenance.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
to_dict()
¶
Return a plain, JSON-serializable dict for JointRealization.provenance.
Source code in src/gwmock_newtonian_noise/provenance.py
171 172 173 | |
RealizationProvenance
¶
Bases: BaseModel
Structured, JSON-serializable provenance for one joint realization.
channel_order is tuple[str, ...], not list[str]: frozen=True
only blocks field reassignment, not in-place mutation of a mutable
container a frozen field happens to hold. A tuple has no mutating
methods, so the frozen contract holds for the container itself.
Source code in src/gwmock_newtonian_noise/provenance.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
to_dict()
¶
Return a plain, JSON-serializable dict for JointRealization.provenance.
Source code in src/gwmock_newtonian_noise/provenance.py
55 56 57 | |
SourceState
dataclass
¶
Version-control state of the source tree the package was imported from.
The installed package_version is fixed when the package is installed;
an editable install keeps reporting it after the tree has moved on or been
edited. This records the tree itself at the time it is queried.
Attributes:
| Name | Type | Description |
|---|---|---|
commit |
str | None
|
The checked-out commit, or |
dirty |
bool | None
|
Whether the checkout has uncommitted changes to tracked files or
untracked, non-ignored files; |
Source code in src/gwmock_newtonian_noise/provenance.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
source_state(package_dir=None)
¶
Return the git commit and dirty flag of the tree this package lives in.
The tree is identified as this package's own checkout only when its
top level contains src/gwmock_newtonian_noise at package_dir; an
installed copy that happens to sit inside some other repository reports
SourceState(None, None) rather than that repository's state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_dir
|
Path | None
|
The package directory to inspect; defaults to the directory
of the imported :mod: |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
The |
SourceState
|
class: |
Source code in src/gwmock_newtonian_noise/provenance.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |