Skip to content

Commit 8389690

Browse files
authored
Merge pull request #4 from pyc-team/factors
Rewrite and Reframe of Library (PyC v1.0.0a1)
2 parents b0ccd89 + 4068844 commit 8389690

File tree

367 files changed

+50518
-9724
lines changed

Some content is hidden

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

367 files changed

+50518
-9724
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in PyC
4+
---
5+
6+
# Bug Report
7+
8+
## Description
9+
A clear and concise description of the problem.
10+
11+
## To Reproduce
12+
Steps to reproduce:
13+
1.
14+
2.
15+
3.
16+
17+
## Expected Behavior
18+
What you expected to happen.
19+
20+
## Environment
21+
- PyC version:
22+
- Python version:
23+
- OS:
24+
25+
## Additional Information
26+
Anything else we should know?
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new idea for PyC
4+
---
5+
6+
# Feature Request
7+
8+
## Description
9+
What feature would you like to see?
10+
11+
## Motivation
12+
Why is this feature useful?
13+
14+
## Alternatives
15+
Any alternative solutions you considered?
16+
17+
## Additional Information
18+
Anything else we should know?
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Pull Request
2+
3+
## Description
4+
Describe the changes you made and why they are necessary.
5+
6+
## Related Issues
7+
Link any related issues (e.g., #123).
8+
9+
## Changes Made
10+
- [ ] Feature added
11+
- [ ] Bug fixed
12+
- [ ] Documentation updated
13+
- [ ] Other (please specify)
14+
15+
## Checklist
16+
- [ ] Tests added or updated
17+
- [ ] Documentation updated
18+
- [ ] Code follows style guidelines
19+
20+
Thank you for contributing to PyC! — The PyC Team

.github/workflows/coverage.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [ "**" ] # Run on all branches
6+
pull_request:
7+
branches: [ main, dev ]
8+
9+
jobs:
10+
coverage:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.10'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pytest pytest-cov codecov
25+
# Install project requirements first
26+
pip install -r requirements.txt
27+
# Install pytorch_lightning (needed for data module)
28+
pip install pytorch-lightning
29+
# Install the package in editable mode with data extras
30+
pip install -e ".[data,tests]"
31+
32+
- name: Run tests with coverage
33+
run: |
34+
pytest tests/ --cov=torch_concepts --cov-report=xml --cov-report=term-missing
35+
36+
- name: Upload coverage to Codecov
37+
uses: codecov/codecov-action@v4
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
files: ./coverage.xml
41+
flags: unittests
42+
name: codecov-umbrella
43+
fail_ci_if_error: false
44+
verbose: true

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,20 @@ target/
6969
# pycharm
7070
.idea/*
7171

72+
# vscode
73+
.vscode
74+
7275
# lightning logs
7376
examples/lightning_logs/
7477
lightning_logs/
7578

7679
# results
7780
model_results.csv
81+
82+
# data folder (but not torch_concepts/data/)
83+
data/
84+
!torch_concepts/data/
85+
!tests/data/
86+
87+
# conceptarium logs
88+
outputs/

.readthedocs.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
formats:
2-
- none
3-
requirements_file: requirements.txt
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.10"
12+
13+
# Build documentation in the docs/ directory with Sphinx
14+
sphinx:
15+
configuration: doc/conf.py
16+
17+
# Install dependencies
418
python:
5-
pip_install: true
6-
extra_requirements:
7-
- tests
8-
- docs
19+
install:
20+
- method: pip
21+
path: .
22+
extra_requirements:
23+
- tests
24+
- docs
25+
- data
26+
- requirements: requirements.txt

CODE_OF_CONDUCT.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PyC Code of Conduct
2+
3+
## Our Pledge
4+
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.
5+
6+
## Our Standards
7+
Examples of behavior that contribute to a positive environment:
8+
- Being respectful and constructive.
9+
- Offering helpful feedback.
10+
- Showing empathy toward others.
11+
12+
Examples of unacceptable behavior:
13+
- Harassment or discrimination of any kind.
14+
- Personal attacks, trolling, or insults.
15+
- Publishing private information without permission.
16+
17+
## Our Responsibilities
18+
The PyC Team is responsible for clarifying our standards and taking appropriate actions when behavior violates this Code of Conduct.
19+
20+
## Enforcement
21+
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.
22+
23+
## Attribution
24+
This Code of Conduct is adapted from the Contributor Covenant.

CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Contributing to PyC
2+
3+
We welcome contributions to PyC! This guide will help you contribute effectively.
4+
5+
Thank you for your interest in contributing! The PyC Team welcomes all contributions, whether small bug fixes or major features.
6+
7+
## Join Our Community
8+
9+
Have questions or want to discuss your ideas? Join our Slack community to connect with other contributors and maintainers!
10+
11+
[![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)
12+
13+
## How to Contribute
14+
15+
1. **Fork the repository** - Create your own fork of the PyC repository on GitHub.
16+
2. **Use the** `dev` **branch** - Write and test your contributions locally on the `dev` branch.
17+
3. **Create a new branch** - Make a new branch for your specific contribution.
18+
4. **Make your changes** - Implement your changes with clear, descriptive commit messages.
19+
5. **Use Gitmoji** - Add emojis to your commit messages using [Gitmoji](https://gitmoji.dev/) for better clarity.
20+
6. **Write documentation and tests** - Ensure your contributions include appropriate documentation and tests.
21+
7. **Run all tests** - Make sure all tests pass before submitting your pull request.
22+
8. **Submit a Pull Request** - Open a PR to the `main` branch describing your changes.
23+
24+
## Development Setup
25+
26+
### Prerequisites
27+
28+
- Python 3.9 or higher
29+
- PyTorch (latest stable version)
30+
31+
### Installation
32+
33+
Install PyC and its dependencies:
34+
35+
```bash
36+
pip install pytorch-concepts
37+
```
38+
39+
For development, you may want to install in editable mode:
40+
41+
```bash
42+
git clone https://github.com/pyc-team/pytorch_concepts.git
43+
cd pytorch_concepts
44+
pip install -e .
45+
```
46+
47+
## Reporting Issues
48+
49+
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.
50+
51+
When reporting issues, please include:
52+
53+
- A clear description of the problem
54+
- Steps to reproduce the issue
55+
- Expected vs. actual behavior
56+
- Your environment (Python version, PyTorch version, OS, etc.)
57+
58+
## Code Style
59+
60+
Please follow these guidelines when contributing code:
61+
62+
- **PEP 8** - Follow [PEP 8](https://pep8.org/) style guidelines for Python code.
63+
- **Type hints** - Use type hints where appropriate to improve code clarity.
64+
- **Docstrings** - Write clear docstrings for all public functions and classes.
65+
- **Tests** - Write tests for new features and bug fixes when possible.
66+
- **Documentation** - Update documentation to reflect your changes.
67+
68+
## Pull Request Process
69+
70+
1. Ensure your code follows the style guidelines above.
71+
2. Update the documentation if you've made changes to the API.
72+
3. Add tests for new functionality.
73+
4. Make sure all tests pass locally.
74+
5. Write a clear PR description explaining what changes you made and why.
75+
6. Link any related issues in your PR description.
76+
7. Wait for review from the maintainers.
77+
78+
## Thank You!
79+
80+
Every contributor helps make PyC better. We appreciate your time and effort!
81+
82+
Thanks to all our contributors! 🧡
83+
84+
<a href="https://github.com/pyc-team/pytorch_concepts/graphs/contributors">
85+
<img src="https://contrib.rocks/image?repo=pyc-team/pytorch_concepts" alt="Contributors" />
86+
</a>

NOTICE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2025 PyC Team
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

0 commit comments

Comments
 (0)