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