Skip to content

Commit 0e48566

Browse files
authored
Merge pull request #39 from scikit-learn-contrib/29-meet-sklearn-contrib-conventions
29 meet sklearn contrib conventions.
2 parents cabc92a + cd3d598 commit 0e48566

15 files changed

+922
-17
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Bug Report
2+
description: Create a report to help us improve
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
10+
11+
- type: textarea
12+
id: what-happened
13+
attributes:
14+
label: Describe the bug
15+
description: A clear and concise description of what the bug is.
16+
placeholder: Tell us what you see!
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: reproduce
22+
attributes:
23+
label: To Reproduce
24+
description: "Steps to reproduce the behavior. Please provide a minimal, self-contained code sample."
25+
placeholder: |
26+
```python
27+
import numpy as np
28+
from radius_clustering import RadiusClustering
29+
30+
# Your code here that triggers the bug
31+
```
32+
validations:
33+
required: true
34+
35+
- type: textarea
36+
id: expected
37+
attributes:
38+
label: Expected behavior
39+
description: A clear and concise description of what you expected to happen.
40+
validations:
41+
required: true
42+
43+
- type: dropdown
44+
id: os
45+
attributes:
46+
label: Operating System
47+
description: What operating system are you using?
48+
options:
49+
- Windows
50+
- macOS
51+
- Linux
52+
validations:
53+
required: true
54+
55+
- type: input
56+
id: python-version
57+
attributes:
58+
label: Python Version
59+
placeholder: "e.g. 3.11.4"
60+
validations:
61+
required: true
62+
63+
- type: input
64+
id: package-version
65+
attributes:
66+
label: Package Version
67+
placeholder: "e.g. 1.4.0"
68+
validations:
69+
required: true
70+
71+
- type: textarea
72+
id: additional-context
73+
attributes:
74+
label: Additional context
75+
description: Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Documentation improvement
2+
description: Create a report to help us improve the documentation. Alternatively you can just open a pull request with the suggested change.
3+
labels: ["documentation", "triage"]
4+
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: Describe the issue linked to the documentation
9+
description: >
10+
Tell us about the confusion introduced in the documentation.
11+
validations:
12+
required: true
13+
- type: textarea
14+
attributes:
15+
label: Suggest a potential alternative/fix
16+
description: >
17+
Tell us how we could improve the documentation in this regard.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project
3+
title: "[Feature]: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: Is your feature request related to a problem? Please describe.
9+
description: A clear and concise description of what the problem is. Ex. "I'm always frustrated when..."
10+
validations:
11+
required: true
12+
- type: textarea
13+
attributes:
14+
label: Describe the solution you'd like
15+
description: A clear and concise description of what you want to happen.
16+
validations:
17+
required: true
18+
- type: textarea
19+
attributes:
20+
label: Describe alternatives you've considered
21+
description: A clear and concise description of any alternative solutions or features you've considered.
22+
- type: textarea
23+
attributes:
24+
label: Additional context
25+
description: Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
## How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
19+
20+
- [ ] Test A
21+
- [ ] Test B
22+
23+
## Checklist:
24+
25+
- [ ] My code follows the style guidelines of this project
26+
- [ ] I have performed a self-review of my own code
27+
- [ ] I have commented my code, particularly in hard-to-understand areas
28+
- [ ] I have made corresponding changes to the documentation
29+
- [ ] My changes generate no new warnings
30+
- [ ] I have added tests that prove my fix is effective or that my feature works
31+
- [ ] New and existing unit tests pass locally with my changes
32+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/build_wheels.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@ name: Build and upload to PyPI
33
on:
44
workflow_dispatch:
55
push:
6-
branches:
7-
- main
8-
paths:
9-
- "src/radius_clustering/**"
10-
- "tests/**"
11-
- "pyproject.toml"
12-
release:
13-
types:
14-
- published
6+
tags:
7+
- "v*"
158

169
jobs:
1710
run_pytest:
@@ -93,7 +86,7 @@ jobs:
9386
attestations: write
9487
#if: github.event_name == 'release' && github.event.action == 'published'
9588
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
96-
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
89+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
9790
steps:
9891
- name: Download all dists
9992
uses: actions/download-artifact@v4

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint and Format
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
lint-and-format:
9+
name: Run Linters and Formatters
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install ".[dev]"
24+
25+
- name: Run ruff linter
26+
run: |
27+
ruff check src/radius_clustering tests --fix
28+
29+
- name: Run black formatter
30+
run: |
31+
black src/radius_clustering tests --check
32+

.github/workflows/sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
sudo apt-get update
2424
sudo apt-get install build-essential
2525
pip install --upgrade pip
26-
pip install -e ".[doc]"
26+
pip install ".[doc]"
2727
pushd docs
2828
make html
2929
popd

.github/workflows/tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@ jobs:
2828
- name: Run tests with pytest
2929
run: |
3030
pytest -v
31+
32+
- name: Upload coverage reports to Codecov
33+
uses: codecov/[email protected]
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}
36+
slug: scikit-learn-contrib/radius_clustering

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/psf/black-pre-commit-mirror
11+
rev: 24.8.0
12+
hooks:
13+
- id: black
14+
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.5.5
17+
hooks:
18+
- id: ruff
19+
args: ["--fix", "--show-source"]

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
- Demonstrating empathy and kindness toward other people
22+
- Being respectful of differing opinions, viewpoints, and experiences
23+
- Giving and gracefully accepting constructive feedback
24+
- Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
- Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
- The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
- Trolling, insulting or derogatory comments, and personal or political attacks
34+
- Public or private harassment
35+
- Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
- Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official email address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement :
64+
[Send Report](mailto:[email protected]).
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the
119+
[Contributor Covenant](https://www.contributor-covenant.org/), version 2.1,
120+
available at
121+
<https://www.contributor-covenant.org/version/2/1/code_of_conduct/>.
122+
123+
Community Impact Guidelines were inspired by
124+
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/inclusion).
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
<https://www.contributor-covenant.org/faq/>. Translations are available at
128+
<https://www.contributor-covenant.org/translations/>.

0 commit comments

Comments
 (0)