Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
357 commits
Select commit Hold shift + click to select a range
954a724
Start adding documentation in torch concepts package
pietrobarbiero Nov 17, 2025
c60a64c
minor fixes
gdefe Nov 17, 2025
a5ace44
Start adding documentation in conceptarium
gdefe Nov 17, 2025
73df6fb
removing user from files
gdefe Nov 17, 2025
bd3e52d
clear output from notebooks
gdefe Nov 17, 2025
561b217
complete documentation for conceptarium
gdefe Nov 17, 2025
5b73e7e
minor fixes to conceptarium documentation
gdefe Nov 18, 2025
53b7e57
remove unused imports
gdefe Nov 18, 2025
08474e5
Add documentation for functions and classes with examples + remove ou…
pietrobarbiero Nov 18, 2025
7999f82
Merge remote-tracking branch 'origin/factors' into factors
pietrobarbiero Nov 18, 2025
7d0426f
conceptarium REAMDE
gdefe Nov 18, 2025
0c87352
add logos to pyc
gdefe Nov 18, 2025
fb7ce4a
update conceptarium library
gdefe Nov 18, 2025
f6afa9a
update README
gdefe Nov 18, 2025
a094d58
update README
gdefe Nov 18, 2025
fcca6b1
update README
gdefe Nov 18, 2025
7f5a369
update README
gdefe Nov 18, 2025
5c41f80
update README
gdefe Nov 18, 2025
dd5ffee
Merge datasets and models from Conceptarium to PyC and refactor PyC d…
pietrobarbiero Nov 18, 2025
796992f
Merge remote-tracking branch 'origin/factors' into factors
pietrobarbiero Nov 18, 2025
d48a364
Update examples
pietrobarbiero Nov 18, 2025
777c6b9
Fix imports
pietrobarbiero Nov 18, 2025
afc8780
Fix imports
pietrobarbiero Nov 18, 2025
b465c92
Add documentation for read the docs automatically generated
pietrobarbiero Nov 18, 2025
a263f78
Merge examples and tests from Conceptarium to PyC and update README
gdefe Nov 18, 2025
b314364
fix conceptarium imports after merging
gdefe Nov 18, 2025
fd9aa81
update README
gdefe Nov 18, 2025
5bf56e9
update README
gdefe Nov 18, 2025
61d37a7
Add cbm construction in readme using different level of APIs
pietrobarbiero Nov 19, 2025
d7c2ef9
Fix import in c2bm
pietrobarbiero Nov 19, 2025
aa06a87
Make documentation navbar nested
pietrobarbiero Nov 19, 2025
6393308
Create navbar groups and hide toc from main rst
pietrobarbiero Nov 19, 2025
e40ddc6
Add nice cards to installation, guides, and api references
pietrobarbiero Nov 19, 2025
d73e901
Customize logo in navbar and fix size of logo in index.rst
pietrobarbiero Nov 19, 2025
1c44269
Update software stack image and cards
pietrobarbiero Nov 19, 2025
1f92684
Add design principles for low/mid/high level API
pietrobarbiero Nov 19, 2025
50577b8
Add factor documentation
pietrobarbiero Nov 19, 2025
977a9bb
Remove mid-level toc from high-level doc
pietrobarbiero Nov 19, 2025
e2a3a9d
Add warning saying that mid level apis are still under development
pietrobarbiero Nov 19, 2025
4bc65ed
Add requirements in setup
pietrobarbiero Nov 20, 2025
dc7f7ef
Make the data package and related requirements optional
pietrobarbiero Nov 20, 2025
1ea7c59
Adding bp, work in progress
GiuseppeMarra Nov 20, 2025
f568b72
Adding bp, work in progress
GiuseppeMarra Nov 20, 2025
1980168
Add installation info to conceptarium doc
pietrobarbiero Nov 20, 2025
9619421
Align readme to doc index
pietrobarbiero Nov 20, 2025
028d04c
Remove toc from readme as it is now much shorter and structured
pietrobarbiero Nov 20, 2025
2cd4897
Add warning in doc for unstable mid level api
pietrobarbiero Nov 20, 2025
8e37857
Fix annotation import statements
pietrobarbiero Nov 20, 2025
ab2af84
Add explore paths in readme and index and refactor api reference stru…
pietrobarbiero Nov 20, 2025
9e03f23
Add badges with shields.io style
pietrobarbiero Nov 20, 2025
0158d33
Add aliases for logos in readme
pietrobarbiero Nov 20, 2025
2414e2c
Add files to compute code coverage with github workflows
pietrobarbiero Nov 20, 2025
737aade
Add codecov for all branches
pietrobarbiero Nov 20, 2025
32e9623
Add coverage reporting to github folder
pietrobarbiero Nov 20, 2025
878ee74
Move incorrectly placed codecov.yml
pietrobarbiero Nov 20, 2025
f17cd26
Fix: Install all dependencies in CI workflow
pietrobarbiero Nov 20, 2025
99173da
Fix: Add pytorch-lightning dependency to CI workflow
pietrobarbiero Nov 20, 2025
4df9222
Fix imports in tests
pietrobarbiero Nov 20, 2025
1f03821
Remove outdated tests
pietrobarbiero Nov 20, 2025
585b4f3
Remove formats from rtd
pietrobarbiero Nov 20, 2025
a29bbd1
Trigger ReadTheDocs build
pietrobarbiero Nov 20, 2025
c03bcdc
Add codecov token
pietrobarbiero Nov 20, 2025
642cc7c
Add configs to readthedocs
pietrobarbiero Nov 20, 2025
a69c22c
Add verbose option to debug codecov
pietrobarbiero Nov 20, 2025
78dccaa
Reorder cards in index and readme for low-mid-high level
pietrobarbiero Nov 20, 2025
3e182a2
Moved requirements for readthedocs
pietrobarbiero Nov 20, 2025
03b37bb
Add missing dependencies to build docs
pietrobarbiero Nov 20, 2025
783fd8d
Remove conceptarium from codecov
pietrobarbiero Nov 20, 2025
f836824
Move pytorch lightning into high-level in documentation
pietrobarbiero Nov 20, 2025
74cfdf4
Move data api doc
pietrobarbiero Nov 20, 2025
4cdb5ae
Fix logo alias sizes
pietrobarbiero Nov 20, 2025
6e83520
Fix names in logic rule explanations
pietrobarbiero Nov 20, 2025
2b0fad9
Add fwo logos
pietrobarbiero Nov 20, 2025
6da2c33
Fix build potential and cpt for factor and pgm
pietrobarbiero Nov 20, 2025
757e8b8
Add preliminary asserts in check tensors
pietrobarbiero Nov 20, 2025
089c645
Add tests for low-level api
pietrobarbiero Nov 20, 2025
c74fc66
Add tests for semantic
pietrobarbiero Nov 20, 2025
d3a3914
Add tests for typing
pietrobarbiero Nov 20, 2025
9b20f73
Add tests for utils
pietrobarbiero Nov 20, 2025
1237598
Add tests for delta distribution
pietrobarbiero Nov 20, 2025
2408b3b
Add tests for nn.functionals
pietrobarbiero Nov 20, 2025
1617dbe
Add tests for nn.minimize_constraint
pietrobarbiero Nov 20, 2025
5c291db
Add simple code of conduct
pietrobarbiero Nov 20, 2025
3469127
Add simple contributing guidelines
pietrobarbiero Nov 20, 2025
1c449ca
Add simple feature request template
pietrobarbiero Nov 20, 2025
306a7a0
Add simple pull request template
pietrobarbiero Nov 20, 2025
48d4ff9
Add simple bug report template
pietrobarbiero Nov 20, 2025
e24842a
Add simple security notice
pietrobarbiero Nov 20, 2025
d97ac5a
Add fallback to use sample instead of rsample in ancestral sampling
pietrobarbiero Nov 20, 2025
d230d99
Ensure vars and factors are always lists for consitency
pietrobarbiero Nov 20, 2025
2eda712
Add default fallback for scipy minimize
pietrobarbiero Nov 20, 2025
53271d6
Only validate metadata in annotations if not empty
pietrobarbiero Nov 20, 2025
0cc0bcd
Fix in variable constructor: if single concept in list, create and re…
pietrobarbiero Nov 20, 2025
c2f2d06
Fix in variable constructor: if single concept in list, create and re…
pietrobarbiero Nov 20, 2025
1387c03
Fix variable construction when 1 concept onlu is provided
pietrobarbiero Nov 20, 2025
3415962
Add tests for annotations
pietrobarbiero Nov 20, 2025
9000679
Add tests for loss and metrics
pietrobarbiero Nov 20, 2025
a335695
Add tests for mid level
pietrobarbiero Nov 20, 2025
be4b133
Add placeholder tests for high level
pietrobarbiero Nov 20, 2025
f7c359e
Add tests for propagator
pietrobarbiero Nov 20, 2025
f67cb04
Add notice file
pietrobarbiero Nov 20, 2025
04b7e6a
Add funding section in documentation
pietrobarbiero Nov 21, 2025
98573b6
Display funding logos in table in readme
pietrobarbiero Nov 21, 2025
cdf7742
Make logos in index.rst adaptive to light/dark themes
pietrobarbiero Nov 21, 2025
6e2abdb
Update notice file to comply with Apache licence
pietrobarbiero Nov 21, 2025
4f67c4f
Make sidebar in rtd fixed
pietrobarbiero Nov 21, 2025
555e0a4
Add more detailed description for contributing
pietrobarbiero Nov 21, 2025
564c96b
Add step by step examples on how to use the library at different API …
pietrobarbiero Nov 21, 2025
24fd098
refarctor models high-level API, move lightning utilities into the model
gdefe Nov 21, 2025
076300d
adapt blackbox model to the new API
gdefe Nov 21, 2025
f60698f
Split user guide into three docs
pietrobarbiero Nov 21, 2025
dcaac0a
Split shared modules into three docs
pietrobarbiero Nov 21, 2025
f568d3c
Merge remote-tracking branch 'origin/factors' into factors
pietrobarbiero Nov 21, 2025
03f73c5
weighted concept loss
gdefe Nov 21, 2025
e08684d
Add slack badge
pietrobarbiero Nov 21, 2025
1f0c980
Add group lengths in assert error message of grouped_concept_embeddin…
pietrobarbiero Nov 21, 2025
46f2e3f
Add external contributors
pietrobarbiero Nov 21, 2025
e8ae578
Merge remote-tracking branch 'origin/factors' into factors
pietrobarbiero Nov 21, 2025
d188e0a
Move semantic to low-level subfolder
pietrobarbiero Nov 21, 2025
05608ca
Raise error in base graph learner abstract method weighted_adj
pietrobarbiero Nov 21, 2025
baec1da
Add Mateo as reference point of contact considering the immense PR work
pietrobarbiero Nov 21, 2025
e098d86
Fix imports due to moving semantic script
pietrobarbiero Nov 21, 2025
b4bbf38
Fix imports due to moving semantic script
pietrobarbiero Nov 21, 2025
9ae1f7b
Merge remote-tracking branch 'origin/factors' into factors
pietrobarbiero Nov 21, 2025
7515eeb
Add eps as hyperparam in wanda
pietrobarbiero Nov 21, 2025
8a2411c
Add shape of y for better error
pietrobarbiero Nov 21, 2025
1e50612
Add util to translates two equal-length list arguments (c_idxs, c_val…
pietrobarbiero Nov 21, 2025
caef21a
Add eps as intervention wrapper argument
pietrobarbiero Nov 21, 2025
f74312d
Add more explicit error message in constructing bipartite models
pietrobarbiero Nov 21, 2025
a641d85
Optimize _node_to_index in concept graph to dict lookup by precomputi…
pietrobarbiero Nov 21, 2025
5cc08a7
Add device as optional query parameter of forward inference
pietrobarbiero Nov 21, 2025
b4ba415
Add error message when creating factor for a single concept
pietrobarbiero Nov 21, 2025
03d50c8
style changes and relative paths to pyc and conceptarium README
gdefe Nov 21, 2025
83942c0
Changed Propagator class name to LazyConstructor and moved in low-lev…
pietrobarbiero Nov 22, 2025
5cd879b
Merge remote-tracking branch 'origin/factors' into factors
pietrobarbiero Nov 22, 2025
7ef4928
Changed Factor class name to comply with existing standards in other …
pietrobarbiero Nov 22, 2025
ddf4886
use format strings in __repr__ methods
gdefe Nov 22, 2025
6ad915f
make run_experiment executable
gdefe Nov 22, 2025
8d070d3
fix model init in run_experiment
gdefe Nov 22, 2025
f5d2d90
naming convetions for raw filenames and processed filenames
gdefe Nov 22, 2025
b6fd780
default scaler to None
gdefe Nov 22, 2025
6b930b2
closing parens match the indentation of the def block.
gdefe Nov 22, 2025
15cde65
fix remaning closing parenthesis and simplify is_binary
gdefe Nov 22, 2025
8d71d9a
remove printing, using logger
gdefe Nov 22, 2025
cab50c5
remove preprocess_inputs and scale_concepts parameters as both fucnti…
gdefe Nov 22, 2025
dc9e642
bug fixing in detecting cathegorical and joint learner
gdefe Nov 22, 2025
1802585
rename enable_summary_metrics and perconcept_metrics
gdefe Nov 22, 2025
d3c8778
correctly raise error when using continuous concepts in high-level API
gdefe Nov 22, 2025
082575b
fix bug in ConceptLoss and correct test
gdefe Nov 22, 2025
7a4969c
check batch structure
gdefe Nov 22, 2025
729aff8
bug fix in test
gdefe Nov 22, 2025
059a31d
clean hydra.py
gdefe Nov 22, 2025
17b7f83
remove gradient monitoring debugging class
gdefe Nov 22, 2025
3f799be
Use format strings for readability
pietrobarbiero Nov 22, 2025
aac9d66
let user define device
gdefe Nov 22, 2025
a7ac34f
Removed dependency from pyg
pietrobarbiero Nov 22, 2025
661bc5a
Merge remote-tracking branch 'origin/factors' into factors
pietrobarbiero Nov 22, 2025
2eaaadc
Add eps as argument of stochastic encoder
pietrobarbiero Nov 22, 2025
656bc7f
fix typo in readme and other relative paths
gdefe Nov 22, 2025
a60937d
Add max uncertainty point to UCP to make it more flexible (can work b…
pietrobarbiero Nov 22, 2025
5e963e9
Merge remote-tracking branch 'origin/factors' into factors
pietrobarbiero Nov 22, 2025
7179f43
removed block preventing the user from defining bernoully variables w…
gdefe Nov 22, 2025
1a04f9a
simplify AxisAnnotation __post_init__
gdefe Nov 22, 2025
1b34da9
remove Backward compatibility in annotations
gdefe Nov 22, 2025
1dfd3e6
Restore original training state in backbone and do not pin memory
gdefe Nov 22, 2025
cd3837a
verbose option in datamodule setup
gdefe Nov 22, 2025
61bdd34
update test data after chenge to backbone verbose option
gdefe Nov 22, 2025
2a1522d
use pl seed-Everything and move utility to pyc utils
gdefe Nov 22, 2025
02e4f80
styling of ds and dm
gdefe Nov 22, 2025
df3ccf8
update error when missing annotation axis 1
gdefe Nov 22, 2025
d4ad54a
clearer error in concept subset
gdefe Nov 22, 2025
97201c9
remove redundant methods in concept dataset base class
gdefe Nov 22, 2025
8681752
remove finetuning
gdefe Nov 22, 2025
a5cbf59
custom data root for each datamodule
gdefe Nov 22, 2025
eace659
verbose option in tqdm in io.py
gdefe Nov 22, 2025
0ff06c0
fix autoencoder training and weights storage
gdefe Nov 22, 2025
6f65fef
flexible device handling in datamodule
gdefe Nov 22, 2025
1d04094
avoid resolve_size duplication
gdefe Nov 22, 2025
2935d8a
fix ensure list and test it
gdefe Nov 22, 2025
b0e4042
rename hamming distance to custom
gdefe Nov 22, 2025
0964854
simplify backbone parameters in model init and reset models to implement
gdefe Nov 22, 2025
72bd548
clean cbm model
gdefe Nov 22, 2025
f4868f5
add collection name to assert in check_collection
gdefe Nov 22, 2025
813c87d
Fix interventions in probabilistic models in forward inference applyi…
pietrobarbiero Nov 23, 2025
94d3ecb
Cache networkx graph to improve efficiency of concept graphs
pietrobarbiero Nov 23, 2025
def45bc
Parallelize interventions per level in forward inference
pietrobarbiero Nov 23, 2025
b8bd09d
Make threshold an argument for wanda
pietrobarbiero Nov 23, 2025
6d875f5
Create three subclasses of Variable class for latent, exogenous, and …
pietrobarbiero Nov 23, 2025
01f53af
Simplified readme
pietrobarbiero Nov 23, 2025
6962032
Added quick start and logos to readme
pietrobarbiero Nov 23, 2025
9bc519e
Refined documentation
pietrobarbiero Nov 23, 2025
665cec4
clean high-level model interface + Separate model from loss +
gdefe Nov 24, 2025
1f87af7
list in annotations states and cardinalities
gdefe Nov 24, 2025
ed8c562
fix override failing python tests
gdefe Nov 24, 2025
4b783b9
remove independent CBM as not yet implemented
gdefe Nov 24, 2025
e825f42
fix independent learner import
gdefe Nov 24, 2025
212d168
Replace pedantic imports in doc with shortcuts
pietrobarbiero Nov 24, 2025
33e50b1
Refactor installation dependencies removing redundant ones for the ma…
pietrobarbiero Nov 24, 2025
f52150e
Add shortcut in init for dense layers
pietrobarbiero Nov 24, 2025
85b2f57
Refactor toy and completeness datasets using the new concept dataset …
pietrobarbiero Nov 24, 2025
26f9081
Fix extra requirement for pytables
pietrobarbiero Nov 24, 2025
e88c94a
Add data requirements for readthedocs
pietrobarbiero Nov 24, 2025
21090ee
Add callable predictor layer to write custom structural causal models
pietrobarbiero Nov 24, 2025
7a3ed82
automating data root in bnlearn and update readme
gdefe Nov 24, 2025
2b341e8
env configuration for macos silicon
gdefe Nov 24, 2025
1ad46ef
minor fixes
gdefe Nov 24, 2025
503b45b
minor fixes to confs
gdefe Nov 24, 2025
952dea6
removing imports of not yet supperted datasets
gdefe Nov 24, 2025
1d810e1
Rename logits to endogenous and embedding to latent
pietrobarbiero Nov 24, 2025
1dd2c11
Rename layers using causal deep learning acronym standards
pietrobarbiero Nov 24, 2025
f5661a9
Rename selector using naming conventions
pietrobarbiero Nov 24, 2025
2f72f8d
Rename latent to input to avoid confusion with latent variable models
pietrobarbiero Nov 24, 2025
c8dffff
Discuss layer naming standard in user guide and API reference
pietrobarbiero Nov 24, 2025
56bcaf1
Renaming emb to input
pietrobarbiero Nov 25, 2025
920c8c8
Add example of structural equation model
pietrobarbiero Nov 25, 2025
f482177
Add example of structural equation model in documentation
pietrobarbiero Nov 25, 2025
b4ea4bd
Fix links in documentation
pietrobarbiero Nov 25, 2025
22a693a
rename slicing indices
gdefe Nov 25, 2025
ccd6676
update metric computation in learner
gdefe Nov 25, 2025
9fb691b
Update links to latest documentation in readme
pietrobarbiero Nov 25, 2025
c5d5814
Make probabilistic model lower case in documentation
pietrobarbiero Nov 25, 2025
a8e77c7
Change title of contributing guide to align with existing links
pietrobarbiero Nov 25, 2025
d5d1382
Make probabilistic model lowercase in doc
pietrobarbiero Nov 25, 2025
4654642
Improve low-level API description with examples and more detailed exp…
pietrobarbiero Nov 25, 2025
6c1c5e2
Improve mid-level API description with examples and more detailed exp…
pietrobarbiero Nov 25, 2025
ef20c93
Add more tests to increase coverage
pietrobarbiero Nov 25, 2025
a1ae2af
Add test for unrolling pgm
pietrobarbiero Nov 25, 2025
7d8bbbb
Refactor test folder mirroring the main package
pietrobarbiero Nov 25, 2025
c3c1961
Add tests related to data and update gitignore to allow tracking this…
pietrobarbiero Nov 25, 2025
17a5ee6
Amend licence in bibtex
pietrobarbiero Nov 25, 2025
374e5ca
ConceptMetrics: metrics refactor + GroupConfig: flexible/modular init…
gdefe Nov 25, 2025
ec50602
remove independent learner from init as not implemented yet
gdefe Nov 25, 2025
d5e866c
Adding bp, work in progress
GiuseppeMarra Nov 26, 2025
c6226d2
Merge branch 'factors' of https://github.com/pyc-team/pytorch_concept…
GiuseppeMarra Nov 26, 2025
aa62476
Fix load annotations in bnlearn (weights only = False)
pietrobarbiero Nov 26, 2025
bcc4214
Fix parametric cpd re-initialization in probabilistic model
pietrobarbiero Nov 26, 2025
71c3467
Fix typos in examples mid-level
pietrobarbiero Nov 26, 2025
4e5aede
Add missing parameters in hypernet from init arguments
pietrobarbiero Nov 26, 2025
24ec245
Remove unstable tests
pietrobarbiero Nov 26, 2025
c173033
Reinitialize the output features of endogenous variables in probabili…
pietrobarbiero Nov 26, 2025
ca4df05
Allow to instantiate parametricCPD with lazy constructors, otherwise …
pietrobarbiero Nov 26, 2025
268599f
Fix examples in low and mid-level documentation
pietrobarbiero Nov 26, 2025
d3634ae
Remove lazy build from graph model
pietrobarbiero Nov 26, 2025
36d33c8
Fix examples in docstrings under nn
pietrobarbiero Nov 26, 2025
bb07f51
Add script to recursively execute doctest-style examples found in doc…
pietrobarbiero Nov 26, 2025
aeed36b
Add absolute paths to images in readme so that pypi readme is rendere…
pietrobarbiero Nov 26, 2025
4eff755
Adding bp, work in progress
GiuseppeMarra Nov 26, 2025
0761c95
Merge branch 'factors' of https://github.com/pyc-team/pytorch_concept…
GiuseppeMarra Nov 26, 2025
3c877db
First version of BP.
GiuseppeMarra Nov 26, 2025
6b7731b
update add_distribution_to_annotations to work with dicts and GroupCo…
gdefe Nov 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug Report
about: Report a bug in PyC
---

# Bug Report

## Description
A clear and concise description of the problem.

## To Reproduce
Steps to reproduce:
1.
2.
3.

## Expected Behavior
What you expected to happen.

## Environment
- PyC version:
- Python version:
- OS:

## Additional Information
Anything else we should know?
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature Request
about: Suggest a new idea for PyC
---

# Feature Request

## Description
What feature would you like to see?

## Motivation
Why is this feature useful?

## Alternatives
Any alternative solutions you considered?

## Additional Information
Anything else we should know?
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Pull Request

## Description
Describe the changes you made and why they are necessary.

## Related Issues
Link any related issues (e.g., #123).

## Changes Made
- [ ] Feature added
- [ ] Bug fixed
- [ ] Documentation updated
- [ ] Other (please specify)

## Checklist
- [ ] Tests added or updated
- [ ] Documentation updated
- [ ] Code follows style guidelines

Thank you for contributing to PyC! — The PyC Team
44 changes: 44 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Coverage

on:
push:
branches: [ "**" ] # Run on all branches
pull_request:
branches: [ main, dev ]

jobs:
coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov codecov
# Install project requirements first
pip install -r requirements.txt
# Install pytorch_lightning (needed for data module)
pip install pytorch-lightning
# Install the package in editable mode with data extras
pip install -e ".[data,tests]"

- name: Run tests with coverage
run: |
pytest tests/ --cov=torch_concepts --cov-report=xml --cov-report=term-missing

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,20 @@ target/
# pycharm
.idea/*

# vscode
.vscode

# lightning logs
examples/lightning_logs/
lightning_logs/

# results
model_results.csv

# data folder (but not torch_concepts/data/)
data/
!torch_concepts/data/
!tests/data/

# conceptarium logs
outputs/
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NIT, HERE AND ELSEWHERE] Please end all files with a new line to follow POSIX standards.

32 changes: 25 additions & 7 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
formats:
- none
requirements_file: requirements.txt
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# Install dependencies
python:
pip_install: true
extra_requirements:
- tests
- docs
install:
- method: pip
path: .
extra_requirements:
- tests
- docs
- data
- requirements: requirements.txt
24 changes: 24 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# PyC Code of Conduct

## Our Pledge
We, the PyC Team, are committed to making PyC an open, welcoming, and respectful community. We pledge to provide a harassment-free experience for everyone, regardless of background or identity.

## Our Standards
Examples of behavior that contribute to a positive environment:
- Being respectful and constructive.
- Offering helpful feedback.
- Showing empathy toward others.

Examples of unacceptable behavior:
- Harassment or discrimination of any kind.
- Personal attacks, trolling, or insults.
- Publishing private information without permission.

## Our Responsibilities
The PyC Team is responsible for clarifying our standards and taking appropriate actions when behavior violates this Code of Conduct.

## Enforcement
Instances of unacceptable behavior may be reported to the PyC Team at the project's issue tracker or through direct contact. All complaints will be reviewed and handled confidentially.

## Attribution
This Code of Conduct is adapted from the Contributor Covenant.
86 changes: 86 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Contributing to PyC

We welcome contributions to PyC! This guide will help you contribute effectively.

Thank you for your interest in contributing! The PyC Team welcomes all contributions, whether small bug fixes or major features.

## Join Our Community

Have questions or want to discuss your ideas? Join our Slack community to connect with other contributors and maintainers!

[![Slack](https://img.shields.io/badge/Slack-Join%20Us-4A154B?style=for-the-badge&logo=slack)](https://join.slack.com/t/pyc-yu37757/shared_invite/zt-3jdcsex5t-LqkU6Plj5rxFemh5bRhe_Q)

## How to Contribute

1. **Fork the repository** - Create your own fork of the PyC repository on GitHub.
2. **Use the** `dev` **branch** - Write and test your contributions locally on the `dev` branch.
3. **Create a new branch** - Make a new branch for your specific contribution.
4. **Make your changes** - Implement your changes with clear, descriptive commit messages.
5. **Use Gitmoji** - Add emojis to your commit messages using [Gitmoji](https://gitmoji.dev/) for better clarity.
6. **Write documentation and tests** - Ensure your contributions include appropriate documentation and tests.
7. **Run all tests** - Make sure all tests pass before submitting your pull request.
8. **Submit a Pull Request** - Open a PR to the `main` branch describing your changes.

## Development Setup

### Prerequisites

- Python 3.9 or higher
- PyTorch (latest stable version)

### Installation

Install PyC and its dependencies:

```bash
pip install pytorch-concepts
```

For development, you may want to install in editable mode:

```bash
git clone https://github.com/pyc-team/pytorch_concepts.git
cd pytorch_concepts
pip install -e .
```

## Reporting Issues

If you find a bug or have a feature request, please open an issue on our [GitHub Issues page](https://github.com/pyc-team/pytorch_concepts/issues) using the appropriate issue template.

When reporting issues, please include:

- A clear description of the problem
- Steps to reproduce the issue
- Expected vs. actual behavior
- Your environment (Python version, PyTorch version, OS, etc.)

## Code Style

Please follow these guidelines when contributing code:

- **PEP 8** - Follow [PEP 8](https://pep8.org/) style guidelines for Python code.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments elsewhere about code style and PEP8. I think it may be potentially useful to provide our own PEP8 formater config.

- **Type hints** - Use type hints where appropriate to improve code clarity.
- **Docstrings** - Write clear docstrings for all public functions and classes.
- **Tests** - Write tests for new features and bug fixes when possible.
- **Documentation** - Update documentation to reflect your changes.

## Pull Request Process

1. Ensure your code follows the style guidelines above.
2. Update the documentation if you've made changes to the API.
3. Add tests for new functionality.
4. Make sure all tests pass locally.
5. Write a clear PR description explaining what changes you made and why.
6. Link any related issues in your PR description.
7. Wait for review from the maintainers.

## Thank You!

Every contributor helps make PyC better. We appreciate your time and effort!

Thanks to all our contributors! 🧡

<a href="https://github.com/pyc-team/pytorch_concepts/graphs/contributors">
<img src="https://contrib.rocks/image?repo=pyc-team/pytorch_concepts" alt="Contributors" />
</a>
13 changes: 13 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2025 PyC Team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing new line

Loading