Skip to content

Commit b2d4797

Browse files
committed
Initial commit: setqca 0.1.0
Native Python implementation of crisp-set and fuzzy-set Qualitative Comparative Analysis, with exact Quine-McCluskey Boolean minimisation and typed, pandas-native result objects. Package: - three-anchor direct fuzzy calibration (logistic and piecewise) and crisp calibration - typed fuzzy-set algebra over calibrated conditions - sufficiency and necessity parameters of fit, including PRI and RoN - complete binary truth tables with frequency, consistency and PRI cutoffs - exact prime-implicant generation and branch-and-bound chart solving - conservative, parsimonious and experimental intermediate solutions Engineering: - PEP 621 packaging with project URLs and a py.typed marker - CI across Linux, macOS and Windows on Python 3.11-3.13, covering lint, formatting, strict typing, tests, examples, distribution build and docs - release workflow publishing to PyPI via trusted publishing - weekly dependency audit and CodeQL analysis - MkDocs Material documentation with a generated API reference - 112 tests at 100% coverage, spanning known results, brute-force exactness, property-based invariants and every documented error contract
0 parents  commit b2d4797

72 files changed

Lines changed: 7113 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
indent_size = 4
10+
11+
[*.{yml,yaml,json,toml,cff}]
12+
indent_size = 2
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[*.R]
18+
indent_size = 2
19+
20+
[Makefile]
21+
indent_style = tab

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Normalise line endings so Windows and CI agree on file content.
2+
* text=auto eol=lf
3+
4+
*.bat text eol=crlf
5+
*.ps1 text eol=crlf
6+
7+
*.png binary
8+
*.jpg binary
9+
*.gif binary
10+
*.ico binary
11+
*.whl binary
12+
13+
# Keep generated/vendored files out of language statistics and diffs.
14+
poetry.lock linguist-generated=true -diff
15+
validation/r/*.R linguist-detectable=true

.github/CODEOWNERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Default owner for everything in the repository.
2+
* @DiogoRibeiro7
3+
4+
# The mathematical core carries the scientific-correctness guarantee and must
5+
# not change without explicit review.
6+
/src/setqca/minimize/ @DiogoRibeiro7
7+
/src/setqca/metrics.py @DiogoRibeiro7
8+
/src/setqca/calibration.py @DiogoRibeiro7
9+
/docs/METHODOLOGY.md @DiogoRibeiro7
10+
/validation/ @DiogoRibeiro7
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Bug report
2+
description: Report incorrect behaviour, a crash, or a wrong numerical result
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to file a report. For **numerical**
10+
disagreements, the reference R `QCA` output is the most useful evidence
11+
you can attach.
12+
13+
- type: textarea
14+
id: summary
15+
attributes:
16+
label: What happened?
17+
description: A clear description of the incorrect behaviour.
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: expected
23+
attributes:
24+
label: What did you expect instead?
25+
description: |
26+
If this is a numerical disagreement, state the expected values and where
27+
they come from (R `QCA`, a textbook, a published replication).
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: reproducer
33+
attributes:
34+
label: Minimal reproducible example
35+
description: Self-contained Python that reproduces the problem, including the data.
36+
render: python
37+
validations:
38+
required: true
39+
40+
- type: input
41+
id: version
42+
attributes:
43+
label: setqca version
44+
description: "Output of `python -c \"import setqca; print(setqca.__version__)\"`"
45+
placeholder: "0.1.0"
46+
validations:
47+
required: true
48+
49+
- type: input
50+
id: environment
51+
attributes:
52+
label: Python and OS
53+
placeholder: "Python 3.12.4 on Ubuntu 24.04"
54+
validations:
55+
required: true
56+
57+
- type: textarea
58+
id: traceback
59+
attributes:
60+
label: Traceback or output
61+
render: shell
62+
63+
- type: checkboxes
64+
id: checks
65+
attributes:
66+
label: Before submitting
67+
options:
68+
- label: I checked that my conditions and outcome are calibrated to `[0, 1]`.
69+
required: true
70+
- label: I searched existing issues for a duplicate.
71+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Question or methodological discussion
4+
url: https://github.com/DiogoRibeiro7/setqca-python/discussions
5+
about: Ask about QCA methodology, calibration choices, or how to use the API.
6+
- name: Security vulnerability
7+
url: https://github.com/DiogoRibeiro7/setqca-python/security/advisories/new
8+
about: Report a vulnerability privately. Please do not open a public issue.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Feature request
2+
description: Propose a new method, parameter, or API capability
3+
title: "[Feature]: "
4+
labels: ["enhancement", "triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please check [the roadmap](https://github.com/DiogoRibeiro7/setqca-python/blob/main/docs/ROADMAP.md)
10+
first — several commonly requested features are already scheduled.
11+
12+
- type: textarea
13+
id: problem
14+
attributes:
15+
label: What problem does this solve?
16+
description: The analytical task you cannot currently carry out.
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: proposal
22+
attributes:
23+
label: Proposed API or method
24+
description: Sketch the interface, or name the algorithm precisely.
25+
render: python
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: references
31+
attributes:
32+
label: Methodological references
33+
description: |
34+
Papers, textbook sections, or the equivalent R `QCA` function. Changes
35+
to the mathematical core require a published definition.
36+
validations:
37+
required: true
38+
39+
- type: dropdown
40+
id: area
41+
attributes:
42+
label: Which area does this touch?
43+
options:
44+
- Calibration
45+
- Parameters of fit
46+
- Truth table
47+
- Boolean minimisation
48+
- Result objects and exports
49+
- Documentation
50+
- Other
51+
validations:
52+
required: true
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Parity divergence
2+
description: Report a numerical divergence from the reference R QCA implementation
3+
title: "[Parity]: "
4+
labels: ["parity", "scientific-correctness"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
The R `QCA` package is the reference implementation for parity testing.
10+
A confirmed divergence in a stable feature is treated as a correctness
11+
bug, not an enhancement.
12+
13+
- type: dropdown
14+
id: component
15+
attributes:
16+
label: Which component diverges?
17+
options:
18+
- Direct calibration
19+
- Truth-table row assignment
20+
- Consistency / coverage
21+
- PRI
22+
- RoN
23+
- Prime implicants
24+
- Conservative solution
25+
- Parsimonious solution
26+
- Intermediate solution (known experimental)
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: dataset
32+
attributes:
33+
label: Dataset
34+
description: CSV contents, or the name of a canonical published dataset.
35+
render: text
36+
validations:
37+
required: true
38+
39+
- type: textarea
40+
id: python_output
41+
attributes:
42+
label: setqca code and output
43+
render: python
44+
validations:
45+
required: true
46+
47+
- type: textarea
48+
id: r_output
49+
attributes:
50+
label: R QCA code and output
51+
render: r
52+
validations:
53+
required: true
54+
55+
- type: input
56+
id: r_version
57+
attributes:
58+
label: R QCA package version
59+
placeholder: "3.21"
60+
validations:
61+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Summary
2+
3+
<!-- What does this change and why? Link the issue it closes. -->
4+
5+
Closes #
6+
7+
## Type of change
8+
9+
- [ ] Bug fix (no API change)
10+
- [ ] New feature (no API break)
11+
- [ ] Breaking change
12+
- [ ] Documentation only
13+
- [ ] Build, CI or tooling
14+
15+
## Scientific correctness
16+
17+
Complete this section for any change to calibration, parameters of fit,
18+
truth-table coding, or Boolean minimisation. Delete it otherwise.
19+
20+
- [ ] The change includes a mathematical description of what it computes.
21+
- [ ] Unit tests cover the new behaviour.
22+
- [ ] At least one edge case is tested.
23+
- [ ] Where an equivalent R `QCA` feature exists, a parity fixture is included,
24+
or the divergence is documented with a stated reason.
25+
- [ ] No heuristic minimisation has been introduced behind an API documented as exact.
26+
27+
## Checklist
28+
29+
- [ ] `poetry run ruff check .` passes
30+
- [ ] `poetry run ruff format --check .` passes
31+
- [ ] `poetry run mypy` passes
32+
- [ ] `poetry run pytest --cov=setqca` passes and meets the coverage gate
33+
- [ ] Public API changes are reflected in the docstrings and the docs site
34+
- [ ] `CHANGELOG.md` has an entry under `Unreleased`

.github/dependabot.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
open-pull-requests-limit: 5
9+
reviewers:
10+
- "DiogoRibeiro7"
11+
labels:
12+
- "dependencies"
13+
- "python"
14+
groups:
15+
# Development tooling churns fast; batch it into a single review.
16+
dev-tooling:
17+
patterns:
18+
- "ruff"
19+
- "mypy"
20+
- "pytest*"
21+
- "pre-commit"
22+
- "hypothesis"
23+
- "pandas-stubs"
24+
25+
- package-ecosystem: "github-actions"
26+
directory: "/"
27+
schedule:
28+
interval: "monthly"
29+
open-pull-requests-limit: 5
30+
reviewers:
31+
- "DiogoRibeiro7"
32+
labels:
33+
- "dependencies"
34+
- "github-actions"

0 commit comments

Comments
 (0)