semvec/pypi-packages huggingface dataset:
cdef-pil-090126-1420 0.1.0
Parental income loss analysis pipeline.
Requires Python: >=3.9

# Parental Income Loss

## Stacked Event-Study Outputs
The stacked example writes results to:
- `output/stacked_event_study/stacked_results.csv`
- `output/stacked_event_study/stacked_results.parquet`

Each row contains:
- `sample`, `chapter`, `component` (event_time or horizon_*),
- `reference_year`, `target_year`, `event_time`,
- `att`, `se`, `conf_low`, `conf_high`,
- `n_pairs`, `n_treated`, `n_control`, `convergence`,
- `bucket_periods`, `horizon_start`, `horizon_end`, `horizon_label`, `bucket_weight`.

Bucket weighting defaults to treated-weighted (`n_treated`). Override with:
- `STACKED_BUCKET_WEIGHT=pairs`

## Quickstart: Custom Components
- Implement one or more of: `PopulationAssembler`, `CohortSelector`, `ExposureDetector`, `MatchingEngine`.
- Wire them into the pipeline with `CohortWorkflow::with_components`.
- Use `docs/component_contracts.md` to ensure required columns are present.

Example wiring:
```rust
let workflow = CohortWorkflow::with_components(builder, selector, matcher);
let outputs = workflow.run(sources, &detector, &registries, &plan, None)?;
```

## Stacked Event Study CLI
- Run the standalone stacked event-study on a parquet file:
  `cargo run -- --stacked-input path/to/stacked_inputs.parquet --did-outcome perindkialt13`
- Optional flags: `--stacked-samples`, `--stacked-chapter-col`, `--stacked-icd-col`,
  `--stacked-output-dir`, plus the existing `--stacked-*` config flags.

## Config Path Aliases
You can reference `[paths]` entries directly from `registry_pattern` to avoid repeating paths.
When a pattern equals a `*_path` key, it expands to that path and automatically appends
`/*.parquet` if no glob or `.parquet` suffix is provided. You can also set `base_path`
to resolve `/path/to/...` placeholders or relative patterns in covariates.

Example:
```toml
[paths]
base_path = "E:/workdata/708245/data/registers"
bef_path = "E:/workdata/708245/data/registers/bef"
akm_path = "E:/workdata/708245/data/registers/akm"

[[covariates]]
label = "employment"
registry_pattern = "akm_path"
column = "SOCIO13"

[[covariates]]
label = "education"
registry_pattern = "/path/to/uddf/*.parquet"
column = "HFAUDD"
```

## Pipeline Cache
To speed repeat runs, cache each phase under `[output]` and enable resume:
```toml
[output]
output_dir = "output"
cache_dir = "output/cache"
resume = true
# clean_cache = true
```

CLI equivalents: `--resume`, `--clean-cache`, `--cache-dir`.

## Docs
- Component contracts: `docs/component_contracts.md`
- Custom component example: `crates/pil/examples/custom_components.rs`
- Custom selector example: `crates/pil/examples/custom_selector.rs`
- Custom matcher example: `crates/pil/examples/custom_matcher.rs`
- Custom detector example: `crates/pil/examples/custom_detector.rs`
cdef-pil-090126-1400 0.1.0
Parental income loss analysis pipeline.
Requires Python: >=3.9

# Parental Income Loss

## Stacked Event-Study Outputs
The stacked example writes results to:
- `output/stacked_event_study/stacked_results.csv`
- `output/stacked_event_study/stacked_results.parquet`

Each row contains:
- `sample`, `chapter`, `component` (event_time or horizon_*),
- `reference_year`, `target_year`, `event_time`,
- `att`, `se`, `conf_low`, `conf_high`,
- `n_pairs`, `n_treated`, `n_control`, `convergence`,
- `bucket_periods`, `horizon_start`, `horizon_end`, `horizon_label`, `bucket_weight`.

Bucket weighting defaults to treated-weighted (`n_treated`). Override with:
- `STACKED_BUCKET_WEIGHT=pairs`

## Quickstart: Custom Components
- Implement one or more of: `PopulationAssembler`, `CohortSelector`, `ExposureDetector`, `MatchingEngine`.
- Wire them into the pipeline with `CohortWorkflow::with_components`.
- Use `docs/component_contracts.md` to ensure required columns are present.

Example wiring:
```rust
let workflow = CohortWorkflow::with_components(builder, selector, matcher);
let outputs = workflow.run(sources, &detector, &registries, &plan, None)?;
```

## Stacked Event Study CLI
- Run the standalone stacked event-study on a parquet file:
  `cargo run -- --stacked-input path/to/stacked_inputs.parquet --did-outcome perindkialt13`
- Optional flags: `--stacked-samples`, `--stacked-chapter-col`, `--stacked-icd-col`,
  `--stacked-output-dir`, plus the existing `--stacked-*` config flags.

## Config Path Aliases
You can reference `[paths]` entries directly from `registry_pattern` to avoid repeating paths.
When a pattern equals a `*_path` key, it expands to that path and automatically appends
`/*.parquet` if no glob or `.parquet` suffix is provided. You can also set `base_path`
to resolve `/path/to/...` placeholders or relative patterns in covariates.

Example:
```toml
[paths]
base_path = "E:/workdata/708245/data/registers"
bef_path = "E:/workdata/708245/data/registers/bef"
akm_path = "E:/workdata/708245/data/registers/akm"

[[covariates]]
label = "employment"
registry_pattern = "akm_path"
column = "SOCIO13"

[[covariates]]
label = "education"
registry_pattern = "/path/to/uddf/*.parquet"
column = "HFAUDD"
```

## Pipeline Cache
To speed repeat runs, cache each phase under `[output]` and enable resume:
```toml
[output]
output_dir = "output"
cache_dir = "output/cache"
resume = true
# clean_cache = true
```

CLI equivalents: `--resume`, `--clean-cache`, `--cache-dir`.

## Docs
- Component contracts: `docs/component_contracts.md`
- Custom component example: `crates/pil/examples/custom_components.rs`
- Custom selector example: `crates/pil/examples/custom_selector.rs`
- Custom matcher example: `crates/pil/examples/custom_matcher.rs`
- Custom detector example: `crates/pil/examples/custom_detector.rs`