paneldx 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- paneldx-0.3.1/.editorconfig +18 -0
- paneldx-0.3.1/.github/ISSUE_TEMPLATE/bug_report.yml +46 -0
- paneldx-0.3.1/.github/ISSUE_TEMPLATE/config.yml +1 -0
- paneldx-0.3.1/.github/ISSUE_TEMPLATE/false_verdict.yml +43 -0
- paneldx-0.3.1/.github/PULL_REQUEST_TEMPLATE.md +22 -0
- paneldx-0.3.1/.github/dependabot.yml +15 -0
- paneldx-0.3.1/.github/workflows/ci.yml +21 -0
- paneldx-0.3.1/.github/workflows/release.yml +34 -0
- paneldx-0.3.1/.gitignore +38 -0
- paneldx-0.3.1/.pre-commit-config.yaml +18 -0
- paneldx-0.3.1/CHANGELOG.md +59 -0
- paneldx-0.3.1/CITATION.cff +44 -0
- paneldx-0.3.1/CODE_OF_CONDUCT.md +49 -0
- paneldx-0.3.1/CONTRIBUTING.md +54 -0
- paneldx-0.3.1/LICENSE +202 -0
- paneldx-0.3.1/NOTICE +15 -0
- paneldx-0.3.1/PKG-INFO +239 -0
- paneldx-0.3.1/README.md +215 -0
- paneldx-0.3.1/SECURITY.md +38 -0
- paneldx-0.3.1/docs/api.md +132 -0
- paneldx-0.3.1/docs/getting-started.md +90 -0
- paneldx-0.3.1/docs/how-it-works.md +147 -0
- paneldx-0.3.1/docs/interpreting-results.md +122 -0
- paneldx-0.3.1/examples/physician_panel.py +80 -0
- paneldx-0.3.1/examples/synthetic_panel.py +77 -0
- paneldx-0.3.1/paneldx/__init__.py +28 -0
- paneldx-0.3.1/paneldx/audit.py +157 -0
- paneldx-0.3.1/paneldx/cli.py +135 -0
- paneldx-0.3.1/paneldx/keys.py +314 -0
- paneldx-0.3.1/paneldx/py.typed +0 -0
- paneldx-0.3.1/paneldx/report.py +188 -0
- paneldx-0.3.1/paneldx/traps.py +267 -0
- paneldx-0.3.1/pyproject.toml +57 -0
- paneldx-0.3.1/tests/test_audit.py +178 -0
- paneldx-0.3.1/tests/test_keys.py +110 -0
- paneldx-0.3.1/tests/test_traps.py +144 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
insert_final_newline = true
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
indent_style = space
|
|
9
|
+
|
|
10
|
+
[*.py]
|
|
11
|
+
indent_size = 4
|
|
12
|
+
max_line_length = 100
|
|
13
|
+
|
|
14
|
+
[*.{yml,yaml,toml,json}]
|
|
15
|
+
indent_size = 2
|
|
16
|
+
|
|
17
|
+
[*.md]
|
|
18
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: paneldx crashed, or reported something that looks wrong
|
|
3
|
+
labels: [bug]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: what
|
|
7
|
+
attributes:
|
|
8
|
+
label: What happened
|
|
9
|
+
description: What you ran, and what came back.
|
|
10
|
+
placeholder: |
|
|
11
|
+
paneldx audit panel.csv --time quarter --key patient_id
|
|
12
|
+
...
|
|
13
|
+
validations:
|
|
14
|
+
required: true
|
|
15
|
+
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: expected
|
|
18
|
+
attributes:
|
|
19
|
+
label: What you expected
|
|
20
|
+
validations:
|
|
21
|
+
required: true
|
|
22
|
+
|
|
23
|
+
- type: textarea
|
|
24
|
+
id: repro
|
|
25
|
+
attributes:
|
|
26
|
+
label: Reproduction
|
|
27
|
+
description: >
|
|
28
|
+
A synthetic frame that triggers it is far more useful than a description
|
|
29
|
+
of a private one. Please do not attach real data.
|
|
30
|
+
render: python
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
33
|
+
|
|
34
|
+
- type: input
|
|
35
|
+
id: shape
|
|
36
|
+
attributes:
|
|
37
|
+
label: Frame shape
|
|
38
|
+
placeholder: 24000 rows x 31 columns, 4 periods
|
|
39
|
+
|
|
40
|
+
- type: input
|
|
41
|
+
id: versions
|
|
42
|
+
attributes:
|
|
43
|
+
label: Versions
|
|
44
|
+
placeholder: paneldx 0.3.0, pandas 2.2.3, Python 3.11
|
|
45
|
+
validations:
|
|
46
|
+
required: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blank_issues_enabled: true
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Wrong verdict
|
|
2
|
+
description: A key you know is correct was rejected, or a bad one was accepted
|
|
3
|
+
labels: [verdict]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: >
|
|
8
|
+
False positives are bugs. If paneldx rejects a key you know is right,
|
|
9
|
+
that is worth reporting.
|
|
10
|
+
|
|
11
|
+
- type: dropdown
|
|
12
|
+
id: direction
|
|
13
|
+
attributes:
|
|
14
|
+
label: Which way
|
|
15
|
+
options:
|
|
16
|
+
- A correct key was rejected
|
|
17
|
+
- An incorrect key was accepted
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
|
|
21
|
+
- type: textarea
|
|
22
|
+
id: report
|
|
23
|
+
attributes:
|
|
24
|
+
label: The full KeyReport
|
|
25
|
+
description: Paste the output of print(validate_key(...)).
|
|
26
|
+
render: text
|
|
27
|
+
validations:
|
|
28
|
+
required: true
|
|
29
|
+
|
|
30
|
+
- type: textarea
|
|
31
|
+
id: why
|
|
32
|
+
attributes:
|
|
33
|
+
label: How do you know the true answer
|
|
34
|
+
description: What makes this key correct, or incorrect, in your data.
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
|
|
38
|
+
- type: textarea
|
|
39
|
+
id: panel
|
|
40
|
+
attributes:
|
|
41
|
+
label: A panel that reproduces it
|
|
42
|
+
description: Synthetic or anonymised. Never real personal data.
|
|
43
|
+
render: python
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## What this changes
|
|
2
|
+
|
|
3
|
+
<!-- One or two sentences. Link the issue if there is one. -->
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
<!-- What was wrong, or what could not be done before. -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] `pytest` passes
|
|
12
|
+
- [ ] `ruff check .` is clean
|
|
13
|
+
- [ ] New behaviour is covered by a test against a panel with a known answer
|
|
14
|
+
- [ ] No new runtime dependency (numpy and pandas only), or discussed in an issue
|
|
15
|
+
- [ ] README updated if a user would notice the change
|
|
16
|
+
- [ ] CHANGELOG entry added under Unreleased
|
|
17
|
+
|
|
18
|
+
## For a new or changed check
|
|
19
|
+
|
|
20
|
+
- [ ] It compares against a null, so it cannot fire on the shape of the table
|
|
21
|
+
- [ ] Its verdict tells the reader what to do next
|
|
22
|
+
- [ ] Thresholds live in the module's constants block, not inline
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: github-actions
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: monthly
|
|
7
|
+
commit-message:
|
|
8
|
+
prefix: "ci"
|
|
9
|
+
|
|
10
|
+
- package-ecosystem: pip
|
|
11
|
+
directory: /
|
|
12
|
+
schedule:
|
|
13
|
+
interval: monthly
|
|
14
|
+
commit-message:
|
|
15
|
+
prefix: "chore"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.9", "3.11", "3.13"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
- run: pip install -e ".[dev]"
|
|
21
|
+
- run: pytest -q
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-python@v5
|
|
13
|
+
with:
|
|
14
|
+
python-version: "3.12"
|
|
15
|
+
- run: pip install -e ".[dev]" build
|
|
16
|
+
- run: pytest -q
|
|
17
|
+
- run: python -m build
|
|
18
|
+
- uses: actions/upload-artifact@v4
|
|
19
|
+
with:
|
|
20
|
+
name: dist
|
|
21
|
+
path: dist/
|
|
22
|
+
|
|
23
|
+
publish:
|
|
24
|
+
needs: build
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
environment: pypi
|
|
27
|
+
permissions:
|
|
28
|
+
id-token: write
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/download-artifact@v4
|
|
31
|
+
with:
|
|
32
|
+
name: dist
|
|
33
|
+
path: dist/
|
|
34
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
paneldx-0.3.1/.gitignore
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# --- Data: never commit datasets to this repo -------------------------------
|
|
2
|
+
# The physician panel that motivated this package contains biometric attributes
|
|
3
|
+
# derived from photographs of identifiable people. It must not be published.
|
|
4
|
+
# These patterns are deliberately broad.
|
|
5
|
+
*.xlsx
|
|
6
|
+
*.xls
|
|
7
|
+
*.csv
|
|
8
|
+
*.parquet
|
|
9
|
+
*.feather
|
|
10
|
+
*.sav
|
|
11
|
+
*.dta
|
|
12
|
+
data/
|
|
13
|
+
datasets/
|
|
14
|
+
|
|
15
|
+
# --- Python -----------------------------------------------------------------
|
|
16
|
+
__pycache__/
|
|
17
|
+
*.py[cod]
|
|
18
|
+
*.egg-info/
|
|
19
|
+
build/
|
|
20
|
+
dist/
|
|
21
|
+
.eggs/
|
|
22
|
+
.venv/
|
|
23
|
+
venv/
|
|
24
|
+
env/
|
|
25
|
+
|
|
26
|
+
# --- Tooling ----------------------------------------------------------------
|
|
27
|
+
.pytest_cache/
|
|
28
|
+
.ruff_cache/
|
|
29
|
+
.mypy_cache/
|
|
30
|
+
.coverage
|
|
31
|
+
htmlcov/
|
|
32
|
+
|
|
33
|
+
# --- Editors / OS -----------------------------------------------------------
|
|
34
|
+
.DS_Store
|
|
35
|
+
.idea/
|
|
36
|
+
.vscode/
|
|
37
|
+
*.swp
|
|
38
|
+
dist/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-toml
|
|
9
|
+
- id: check-merge-conflict
|
|
10
|
+
- id: check-added-large-files
|
|
11
|
+
args: [--maxkb=200]
|
|
12
|
+
|
|
13
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
14
|
+
rev: v0.9.4
|
|
15
|
+
hooks:
|
|
16
|
+
- id: ruff
|
|
17
|
+
args: [--fix]
|
|
18
|
+
- id: ruff-format
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
|
|
5
|
+
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Planned
|
|
10
|
+
- Look-ahead detection in sequence construction
|
|
11
|
+
- Faster key search on wide tables
|
|
12
|
+
|
|
13
|
+
## [0.3.1]
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Rows with a missing key value were silently merged into one "nan"
|
|
17
|
+
pseudo-entity by `persistence_baseline` and `detect_counters`, distorting
|
|
18
|
+
within-entity statistics. They are now dropped, matching `validate_key`.
|
|
19
|
+
- A constant target now gets the verdict "target does not vary" instead of
|
|
20
|
+
claiming there is real movement to predict.
|
|
21
|
+
- The CLI prints one clear error line for bad input (missing column, single
|
|
22
|
+
period, unreadable file) instead of a traceback.
|
|
23
|
+
- `entity_key` is importable from the top level, as the API reference states.
|
|
24
|
+
- The package version in `pyproject.toml` had fallen behind `__version__`.
|
|
25
|
+
|
|
26
|
+
## [0.3.0]
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- `audit()` runs every check in one pass and ranks findings worst-first
|
|
30
|
+
- `to_html()` renders an audit as a self-contained HTML page
|
|
31
|
+
- `paneldx audit` command line entry point, exiting non-zero on failure
|
|
32
|
+
- `CITATION.cff` for citing the package
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
- `entity_key()` uses vectorised concatenation instead of a row-wise join,
|
|
36
|
+
taking a 24k x 36 key search from roughly 60 seconds to 23
|
|
37
|
+
|
|
38
|
+
## [0.2.0]
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- `detect_counters()` finds columns behaving as running totals
|
|
42
|
+
- `target_leakage()` tests whether a target is a linear restatement of its
|
|
43
|
+
own features
|
|
44
|
+
- `persistence_baseline()` scores the carry-forward forecast
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- `validate_key()` now rejects a key that holds nothing still when its
|
|
48
|
+
invariance rate matches shuffled labels. Ranking rows by a growing column
|
|
49
|
+
inherits that column's monotonicity from the sort order, so counters alone
|
|
50
|
+
can no longer support a key.
|
|
51
|
+
|
|
52
|
+
## [0.1.0]
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
- `validate_key()` tests whether a claimed entity key is supported by the data
|
|
56
|
+
- `discover_keys()` searches column combinations with no hints
|
|
57
|
+
- `KeyReport` with per-column invariant and counter evidence
|
|
58
|
+
|
|
59
|
+
[Unreleased]: https://github.com/stemmatics/paneldx/compare/main...HEAD
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
title: "paneldx: structural validation for longitudinal datasets"
|
|
3
|
+
message: "If you use this software in research, please cite it as below."
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- family-names: Imran
|
|
7
|
+
given-names: Umer
|
|
8
|
+
# orcid: "https://orcid.org/0000-0000-0000-0000"
|
|
9
|
+
repository-code: "https://github.com/stemmatics/paneldx"
|
|
10
|
+
url: "https://github.com/stemmatics/paneldx"
|
|
11
|
+
license: Apache-2.0
|
|
12
|
+
version: 0.3.1
|
|
13
|
+
abstract: >-
|
|
14
|
+
A panel dataset asserts that each row belongs to an entity observed
|
|
15
|
+
repeatedly over time. When that assertion is wrong, every within-entity
|
|
16
|
+
quantity computed downstream is silently meaningless: lags, differences,
|
|
17
|
+
trajectories, and grouped cross-validation splits. paneldx tests the
|
|
18
|
+
assertion against the data itself, without domain knowledge, by measuring
|
|
19
|
+
how much structure a candidate key reveals against a null in which entity
|
|
20
|
+
labels are permuted within each period. It also detects three structural
|
|
21
|
+
traps that make a model on panel data appear stronger than it is:
|
|
22
|
+
cumulative features that inflate autocorrelation, targets composed from
|
|
23
|
+
their own predictors, and the absent naive baseline.
|
|
24
|
+
keywords:
|
|
25
|
+
- panel data
|
|
26
|
+
- longitudinal data
|
|
27
|
+
- data leakage
|
|
28
|
+
- entity resolution
|
|
29
|
+
- research reproducibility
|
|
30
|
+
- data validation
|
|
31
|
+
references:
|
|
32
|
+
- type: article
|
|
33
|
+
title: >-
|
|
34
|
+
Leakage and the reproducibility crisis in machine-learning-based science
|
|
35
|
+
authors:
|
|
36
|
+
- family-names: Kapoor
|
|
37
|
+
given-names: Sayash
|
|
38
|
+
- family-names: Narayanan
|
|
39
|
+
given-names: Arvind
|
|
40
|
+
journal: Patterns
|
|
41
|
+
volume: 4
|
|
42
|
+
issue: 9
|
|
43
|
+
year: 2023
|
|
44
|
+
doi: 10.1016/j.patter.2023.100804
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behaviour that contributes to a positive environment:
|
|
18
|
+
|
|
19
|
+
- Demonstrating empathy and kindness toward other people
|
|
20
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
21
|
+
- Giving and gracefully accepting constructive feedback
|
|
22
|
+
- Accepting responsibility and apologising to those affected by our mistakes
|
|
23
|
+
- Focusing on what is best for the community
|
|
24
|
+
|
|
25
|
+
Examples of unacceptable behaviour:
|
|
26
|
+
|
|
27
|
+
- The use of sexualised language or imagery, and sexual attention or advances
|
|
28
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
29
|
+
- Public or private harassment
|
|
30
|
+
- Publishing others' private information without their explicit permission
|
|
31
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Enforcement
|
|
35
|
+
|
|
36
|
+
Instances of abusive, harassing, or otherwise unacceptable behaviour may be
|
|
37
|
+
reported to the project maintainer through a GitHub issue or by contacting
|
|
38
|
+
[@stemmatics](https://github.com/stemmatics). All complaints will be reviewed
|
|
39
|
+
and investigated promptly and fairly.
|
|
40
|
+
|
|
41
|
+
Project maintainers are responsible for clarifying and enforcing these standards
|
|
42
|
+
and will take appropriate corrective action in response to any behaviour they
|
|
43
|
+
deem inappropriate, threatening, offensive, or harmful.
|
|
44
|
+
|
|
45
|
+
## Attribution
|
|
46
|
+
|
|
47
|
+
Adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
|
|
48
|
+
version 2.1, available at
|
|
49
|
+
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Bug reports, new checks and better heuristics are all welcome.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/stemmatics/paneldx.git
|
|
9
|
+
cd paneldx
|
|
10
|
+
pip install -e ".[dev]"
|
|
11
|
+
pytest
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Python 3.9+. Runtime dependencies are `numpy` and `pandas` only, and that is
|
|
15
|
+
deliberate: this is a tool people run *before* choosing a modelling stack, so it
|
|
16
|
+
should never drag one in. Please do not add runtime dependencies without opening
|
|
17
|
+
an issue first.
|
|
18
|
+
|
|
19
|
+
## Tests
|
|
20
|
+
|
|
21
|
+
Every check is tested against synthetic panels where the correct answer is known
|
|
22
|
+
by construction. If you add a detector, add a panel that provably triggers it and
|
|
23
|
+
one that provably does not.
|
|
24
|
+
|
|
25
|
+
Tests must not depend on real data. The panel that motivated this package
|
|
26
|
+
contains biometric attributes of identifiable people and is not distributable;
|
|
27
|
+
`examples/physician_panel.py` takes a path to your own copy.
|
|
28
|
+
|
|
29
|
+
## What makes a good check
|
|
30
|
+
|
|
31
|
+
Checks here answer a question about the data, not about a model:
|
|
32
|
+
|
|
33
|
+
- **Cheap.** It runs before training, so it cannot cost more than training.
|
|
34
|
+
- **Falsifiable.** Compare against a null. `paneldx` shuffles entity labels
|
|
35
|
+
within each period; if your check cannot beat its own null, it is measuring
|
|
36
|
+
the shape of the table rather than a defect.
|
|
37
|
+
- **Actionable.** A verdict should tell someone what to do next.
|
|
38
|
+
|
|
39
|
+
## Reporting a bug
|
|
40
|
+
|
|
41
|
+
Include the shape of the frame, the column dtypes and a minimal reproduction. A
|
|
42
|
+
synthetic frame that triggers the problem is worth more than a description of a
|
|
43
|
+
private one.
|
|
44
|
+
|
|
45
|
+
False positives are bugs. If `paneldx` rejects a key you know is correct, that is
|
|
46
|
+
worth an issue, and the panel that produced it (synthetic or anonymised) is the
|
|
47
|
+
most useful thing you can attach.
|
|
48
|
+
|
|
49
|
+
## Pull requests
|
|
50
|
+
|
|
51
|
+
- One change per PR.
|
|
52
|
+
- `pytest` green, and CI covers 3.9 / 3.11 / 3.13.
|
|
53
|
+
- Update the README if you change behaviour a user would notice.
|
|
54
|
+
- New thresholds go in the constants block at the top of the module, not inline.
|
paneldx-0.3.1/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Umer Imran
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|