marivo.analysis#
Marivo’s typed analysis runtime.
At qualifying catalog-bound runtime parameters, analysis accepts an exact
current marivo.semantic.CatalogEntry or its exact
marivo.semantic.Ref. The boundary validates ownership, kind, and current
membership, then normalizes immediately to the ref. Bare semantic strings,
stale or cross-catalog entries, arbitrary entry subclasses, and duck-typed
.ref objects are rejected. Runtime metric constructors and nested Event
handles retain their existing exact input contracts.
Typed regression is not part of the current analysis operator surface. Work
that requires it remains explicit terminal custom analysis through
frame.to_pandas() or md.raw_sql(...); neither terminal result can
re-enter typed Marivo analysis.
Help and agent surface#
At analysis entry, use the project interpreter to run
python -m marivo help once and verify the environment fingerprint.
After entry, use the public object already in hand: show() reports current
state, while contract() describes mechanically valid next actions. Open
focused marivo.help("analysis.<target>") only when that object contract is
insufficient or before first use of an unfamiliar capability. After a failure,
follow the structured repair. Focused help is not required before every API
call.
Live help owns callable signatures, accepted input families, constraints, and recovery guidance.
Frames#
Public artifacts expose ref, kind, shape, row_count,
columns, show(), contract(),
quality_summary, evidence_status, evidence_digest, lineage,
state, and to_pandas(). row_count == shape[0].
contract().issues contains typed issues; role-preserving affordances
describe mechanical compatibility only. A multi-metric contract exposes one
exact full-id frame.metric(...) projection repair per carried metric when a
consumer requires arity 1; it never selects one.
Every public value returned by .contract() has bounded repr,
render(), and show() while retaining its structured fields. This is
structural conformance, not a shared public contract base class.
Call marivo.help(BaseFrame) for its public consumption contract. |
|
Shared ownership and provenance fields for every frame family. |
|
Metric artifact; call marivo.help(MetricFrame) for its public contract. |
|
Canonical materialized Event analysis artifact. |
|
Canonical materialized replay history or pure Lifecycle reduction. |
|
Persisted exact subject identities for typed cohort composition. |
|
Call marivo.help(ComponentFrame) for its public consumption contract. |
|
Call marivo.help(DeltaFrame) for its public consumption contract. |
|
Call marivo.help(CoverageFrame) for its public consumption contract. |
|
Call marivo.help(AttributionFrame) for its public consumption contract. |
|
Call marivo.help(ForecastFrame) for its public consumption contract. |
|
Mechanical compatibility entry, not a recommendation. |
|
One public input role preserved from the capability registry. |
|
Column-level schema fact for an analysis artifact. |
|
Mechanical consumption contract for an artifact. |
|
Mechanical precondition attached to an affordance. |
|
Bounded deterministic schema descriptor embedded in an artifact contract. |
|
Baseline runtime facts for a materialized artifact. |
Analysis results and selections#
Call marivo.help(AssociationResult) for its public consumption contract. |
|
Call marivo.help(HypothesisTestResult) for its public consumption contract. |
|
Call marivo.help(QualityReport) for its public consumption contract. |
|
Call marivo.help(CandidateSet) for its public consumption contract. |
|
One selected, unscored ontology candidate ready for explicit observation. |
|
Non-evidentiary lineage from one explicitly observed ontology candidate. |
Evidence#
Finding is the typed audit record. ArtifactDigest is the bounded
operator-local read model; it never performs cross-artifact judgment.
Metric-shaped scope for one artifact and its evidence projection. |
|
Repairable analysis-artifact issue for one excluded ontology path. |
Bounded pages#
Pages expose immutable items, limit, has_more, and opaque
next_cursor. They use ordinary newest-first keyset semantics, not snapshot
isolation.
Bounded newest-first page of persisted frame summaries. |
|
Bounded newest-first page of persisted artifact digests. |
|
Bounded newest-first page of canonical typed findings. |
Scopes and windows#
One immutable public selection window shared by semantic and analysis. |
|
Call marivo.help(AbsoluteWindow) for its public consumption contract. |
|
One closed aggregation grain, created through public helpers only. |
- marivo.analysis.grain(unit, *, count=1)[source]#
Construct one builtin aggregation grain.
- Parameters:
unit (Literal['second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year']) – One builtin unit from second through year.
count (int) – Positive sub-day width; calendar-variable units require one.
- Returns:
The immutable public Grain value.
- Return type:
Example
>>> import marivo.analysis as mv >>> mv.grain("month")
- Constraints:
Semantic calendar levels are constructed by
ms.calendar_grain(...).
Event Journey, Lifecycle replay, and typed cohorts#
session.events.match(...) consumes typed participant roles and a closed
EventPattern. The first step uses the half-open TimeScope cohort
window; completion_through is an inclusive follow-up bound.
session.events.funnel(...) and session.events.time_to_event(...) reduce
the persisted journey assignment without rematching Events.
session.select_subjects(...) materializes the closed
dropped_before(...) selection as a persisted SubjectSet. A ready
SubjectSet may scope observe(..., cohort=...) and
events.match(..., cohort=...).
session.lifecycle.replay(...) consumes one exact current StateModel
entry/ref, an explicit timezone-aware half-open window, and the explicit
from_inception() seed. It returns LifecycleFrame[history]. Lifecycle
reducers consume that persisted history without querying Event sources or
replaying the StateModel again. in_state(...) is the closed Lifecycle
selection used by session.select_subjects(...); a resulting ready
SubjectSet may scope later metric, Event, or Lifecycle materialization.
Use focused marivo.help("analysis.lifecycle.replay") and the returned
artifact contract() for the current mechanical contract and continuations.
Before selecting a window, session.events.occurrence_bounds(...) returns
the observed earliest/latest occurrences of one exact Event or StateModel as
EventOccurrenceBounds; it does not establish completeness.
One typed Event role in an ordered journey pattern. |
|
Closed ordered sequence of typed PatternSteps. |
|
Explicit caller assertion for exact Event inputs. |
|
Observed occurrence-time bounds for one exact Event or StateModel. |
|
Select subjects that resolved as lost before one exact Event step. |
|
Required Phase 3 replay seed using the first qualifying inception. |
|
Select subjects whose replayed state is established at one instant. |
|
Target one PatternStep's loss from its immediately preceding step. |
|
Target the loss into one exact funnel PatternStep for attribution. |
|
Exact request passed to a backend completeness provider. |
|
Provider-owned authoritative Event completeness receipt. |
|
Build one typed Event Journey step. |
|
Build one ordered EventPattern. |
|
Choose one journey at the earliest first-step occurrence per subject. |
|
Choose one journey attempt per first-step occurrence. |
|
Declare exact Event inputs complete through one governed bound. |
|
Build a typed selection for resolved loss before an Event step. |
|
Return the only Phase 3 Lifecycle replay seed. |
|
Build an exact typed Lifecycle state selection. |
Policies#
Closed public alignment protocol; construct values with one helper. |
|
Call marivo.help(SamplingPolicy) for its public consumption contract. |
Refs and lineage#
Session-local analysis artifact ref. |
|
Session and jobs#
Call marivo.help(Session) for its public consumption contract. |
|
Lightweight session metadata returned by page_sessions / session_summary. |
|
Alignment and window helpers#
Construct a request-window bucket alignment policy. |
|
Construct same-weekday-occurrence alignment inside one target period. |
|
Construct same-progress alignment inside one certified target period. |
|
Construct alignment through one certified named period correspondence. |
|
Construct relative-local-day alignment inside two exact occurrences. |
|
Construct same-working-day ordinal alignment under one exact schedule. |
Slices#
Submodules#
|
Typed analysis errors and local repair contracts. |
|
Typed findings, bounded digests, issues, pages, and derivation traces. |
|
Frame classes and metadata companions. |
|
Session lifecycle helpers ( |
Type aliases#
Represent a PEP 604 union type |
|
Represent a PEP 604 union type |
|
Represent a PEP 604 union type |