Workspace · Readiness governance

Development docs · 996102e0
View source

Readiness Policy Design Center

Use this center after structural QC has been inspected and before a readiness rule is allowed to change the analysis cohort.

No scientific threshold is pre-filled. Every readiness criterion starts inactive. Enter values only when your acquisition protocol, preregistration, task requirements, device/analysis evidence, or a declared sensitivity design justifies them. GazeAudit does not supply a universal “good data” cutoff.

The builder is local to this documentation page. It does not upload a dataset, inspect your outcomes, infer thresholds, or filter a GazeStudy.

Use a stable project-owned label. The name identifies the policy; it does not establish scientific validity.

Choose only criteria that belong to the declared policy

Activating a criterion makes its value required. Leaving a criterion inactive maps it to `None` in `ReadinessThresholds`.

max_coordinate_issue_fraction

Maximum coordinate-issue fraction

trial + participant

Maximum fraction of rows with a non-finite mapped x or y coordinate.

Runtime comparison
coordinate_issue_fraction ≤ declared value
Interpretation
A trial or participant unit fails when its coordinate-issue fraction is greater than the declared limit.
Boundary

The package does not supply or recommend a universal acceptable fraction.

max_timestamp_issue_fraction

Maximum timestamp-issue fraction

trial + participant

Maximum fraction of rows with a non-finite mapped timestamp.

Runtime comparison
timestamp_issue_fraction ≤ declared value
Interpretation
A trial or participant unit fails when its timestamp-issue fraction is greater than the declared limit.
Boundary

Missing or infinite timestamps are not equivalent to time zero, and the package does not choose a universal limit.

max_identifier_issue_fraction

Maximum identifier-issue fraction

trial + participant

Maximum fraction of rows missing the mapped participant or trial identifier.

Runtime comparison
identifier_issue_fraction ≤ declared value
Interpretation
A trial or participant unit fails when its identifier-issue fraction is greater than the declared limit.
Boundary

The threshold does not authorize inventing missing participant or trial identifiers.

max_duplicate_timestamp_fraction

Maximum duplicate-timestamp fraction

trial + participant

Maximum fraction of rows participating in a repeated finite participant × trial × timestamp key.

Runtime comparison
duplicate_timestamp_fraction ≤ declared value
Interpretation
A trial or participant unit fails when its duplicate-timestamp fraction is greater than the declared limit.
Boundary

Equal timestamps are a representation condition, not automatic proof of duplicated scientific observations.

max_flagged_trial_fraction

Maximum flagged-trial fraction

participant

Maximum fraction of a participant's trial units that fail the active trial-level readiness rules.

Runtime comparison
flagged_trial_fraction ≤ declared value
Interpretation
Participant evaluation uses the fraction of trial units that fail the currently declared trial-level rules.
Boundary

This is downstream of the active trial policy; changing trial rules can change the flagged-trial fraction.

min_rows_per_trial

Minimum rows per trial

trial

Minimum number of rows required in each participant × trial unit.

Runtime comparison
n_rows ≥ declared value
Interpretation
A trial unit fails when its row count is below the declared minimum.
Boundary

Row count is not a device-independent duration or sampling-quality measure.

min_trials_per_participant

Minimum trials per participant

participant

Minimum number of trial units required for each participant.

Runtime comparison
n_trials ≥ declared value
Interpretation
A participant unit fails when its trial count is below the declared minimum.
Boundary

A minimum trial count must come from the study design or analysis rationale, not from this software.

require_monotonic_time

Require monotonic finite time

trial + participant

Require finite timestamps not to decrease in observed row order within trial units.

Runtime comparison
decreasing_time / decreasing_time_trials required declared value
Interpretation
When active, a trial fails if finite time decreases; a participant fails if any of its trial units has decreasing finite time.

When included, this builder emits require_monotonic_time=True. The unchecked state means the criterion is not assessed.

Boundary

Activating this rule does not imply that sorting is the appropriate repair for a decreasing-time condition.

No policy draft generated yet.

Python policy + preview

The generated code evaluates and previews only. It deliberately does not call filter_study_by_readiness().

# Choose a policy name and activate at least one justified criterion.

Descriptive JSON draft

This documentation-side draft mirrors the declared threshold values. It is not a runtime readiness manifest and is not proof that the thresholds are scientifically justified.

{
  "schema": "gazeaudit-readiness-policy-draft-v1",
  "policy_name": "",
  "thresholds": {}
}

What the generated code does

The output follows this sequence:

from gazeaudit import (
    ReadinessThresholds,
    cohort_impact_preview,
    evaluate_analysis_readiness,
)

policy = ReadinessThresholds(
    # only your active, declared criteria appear here
)

readiness = evaluate_analysis_readiness(
    study,
    policy,
    policy_name="your_policy_name",
)

print(readiness.status)
print(cohort_impact_preview(readiness))

This produces a policy-relative assessment and no-mutation cohort preview.

It does not remove rows, trials, or participants.

Understand the eight criteria before declaring them

Criterion Scope Observed metric Runtime rule Scientific boundary
max_coordinate_issue_fraction trial + participant coordinate_issue_fraction A trial or participant unit fails when its coordinate-issue fraction is greater than the declared limit. The package does not supply or recommend a universal acceptable fraction.
max_timestamp_issue_fraction trial + participant timestamp_issue_fraction A trial or participant unit fails when its timestamp-issue fraction is greater than the declared limit. Missing or infinite timestamps are not equivalent to time zero, and the package does not choose a universal limit.
max_identifier_issue_fraction trial + participant identifier_issue_fraction A trial or participant unit fails when its identifier-issue fraction is greater than the declared limit. The threshold does not authorize inventing missing participant or trial identifiers.
max_duplicate_timestamp_fraction trial + participant duplicate_timestamp_fraction A trial or participant unit fails when its duplicate-timestamp fraction is greater than the declared limit. Equal timestamps are a representation condition, not automatic proof of duplicated scientific observations.
max_flagged_trial_fraction participant flagged_trial_fraction Participant evaluation uses the fraction of trial units that fail the currently declared trial-level rules. This is downstream of the active trial policy; changing trial rules can change the flagged-trial fraction.
min_rows_per_trial trial n_rows A trial unit fails when its row count is below the declared minimum. Row count is not a device-independent duration or sampling-quality measure.
min_trials_per_participant participant n_trials A participant unit fails when its trial count is below the declared minimum. A minimum trial count must come from the study design or analysis rationale, not from this software.
require_monotonic_time trial + participant decreasing_time / decreasing_time_trials When active, a trial fails if finite time decreases; a participant fails if any of its trial units has decreasing finite time. Activating this rule does not imply that sorting is the appropriate repair for a decreasing-time condition.

Scope matters

Trial-level evaluation can fail:

  • coordinate, timestamp, identifier, or duplicate-timestamp fractions;
  • min_rows_per_trial;
  • require_monotonic_time=True.

Participant-level evaluation can fail:

  • the four aggregate issue fractions;
  • max_flagged_trial_fraction;
  • min_trials_per_participant;
  • require_monotonic_time=True when any trial unit has decreasing time.

max_flagged_trial_fraction is downstream of the active trial policy. Changing the trial rules can therefore change the participant-level flagged-trial fraction even when the source table is unchanged.

Read readiness status conservatively

Status Meaning Do not interpret it as
unassessed no active readiness rule participated in the policy “all data passed”
ready_under_policy all evaluated trial and participant units satisfy the declared active rules universal data validity
review_under_policy at least one evaluated unit fails one or more declared active rules automatic exclusion

The status is always relative to the declared policy.

Preview before applying

Inspect:

readiness.trial_summary
readiness.participant_summary
readiness.cohort_impact

The cohort preview preserves three denominators:

  • rows;
  • participant × trial units;
  • participant units.

Do not report only a retained percentage without stating which denominator and filter scope produced it.

Only after the policy and its cohort consequence have been justified should filtering be considered:

from gazeaudit import filter_study_by_readiness

analysis_study = filter_study_by_readiness(
    study,
    readiness,
    scope="trial",  # or "participant"; this is a separate scientific decision
)

The scope above is intentionally not selected by this builder.

Methodological guidance

Before activating a threshold, record:

  1. criterion — which runtime rule is being used;
  2. rationale source — preregistration, protocol, device evidence, task demand, prior validation, or sensitivity plan;
  3. timing — whether the value was fixed before observing outcome results;
  4. scope — trial or participant consequence;
  5. cohort impact — rows/trials/participants retained under the policy;
  6. alternative policies — whether nearby defensible policies materially alter the cohort or endpoint;
  7. deviation — whether the final policy differs from the originally declared rule.

The Design and audit readiness policies guide develops each step.

Reporting examples

Methods

Analysis readiness was evaluated using a predeclared structural policy comprising [criteria and values]. GazeAudit first generated trial- and participant-level summaries and a no-mutation cohort-impact preview. Filtering was applied only after the declared policy and filter scope were fixed; omitted readiness criteria were not evaluated.

Results

Under the declared [policy name] policy, readiness status was [status]. Trial-level application retained [rows/trials/participants and denominators], whereas participant-level preview retained [corresponding denominators]. The analysis used the predeclared [trial/participant] scope.

Limitation

Readiness status is policy-relative and reflects the declared structural criteria only. It does not establish calibration accuracy, event-detector validity, AOI validity, missingness ignorability, or inferential robustness.

Replace every bracketed field with the actual project record.

Continue from here

Documentation search

Find the right documentation

↑↓ navigateEnter openEsc close