Skip to content
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

Add pyproject.toml, unit testing cases, workflows, issue and pr templates #13

Merged
merged 5 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "🐞 Bug Report"
description: Submit a bug report to help us improve BenchPOTS.
labels: ["bug"]

body:
- type: textarea
id: system-info
attributes:
label: 1. System Info
description: Please share information about your operating environment with us.
placeholder: BenchPOTS version, Python version, platform and your OS version, and versions of other libraries existing in the error message...
validations:
required: true

- type: checkboxes
id: information-scripts-examples
attributes:
label: 2. Information
description: 'The problem happens when running:'
options:
- label: "The official example scripts"
- label: "My own created scripts"

- type: textarea
id: reproduction
validations:
required: true
attributes:
label: 3. Reproduction
description: |
Please provide a code sample that reproduces the problem you ran into. It can be a Colab link or just a code snippet.
If you have code snippets, error messages, stack traces please provide them here as well.
Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.

placeholder: |
Steps to reproduce the behavior:

1.
2.
3.

……


- type: textarea
id: expected-behavior
validations:
required: true
attributes:
label: 4. Expected behavior
description: "A clear and concise description of what error you would expect to happen."
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blank_issues_enabled: true
version: 2.1
contact_links:
- name: 🤗 PyPOTS Community on Slack
url: https://join.slack.com/t/pypots-org/shared_invite/zt-1gq6ufwsi-p0OZdW~e9UW_IA4_f1OfxA
about: General usage questions, community discussions, and the development team are here.

- name: 🇨🇳 PyPOTS微信社区 (Community on WeChat)
url: https://mp.weixin.qq.com/s/CGkirx7ODkngk6tGGANksw
about: 中文社区讨论群,欢迎加入!
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/dataset-addition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "🤙 New Dataset Addition"
description: Submit a request to implement the preprocessing pipeline of a new dataset.
labels: ["new dataset", "enhancement"]

body:
- type: textarea
id: dataset-description-requested
validations:
required: true
attributes:
label: 1. Dataset description
description: |
Put all important information relative to the new dataset, e.g. paper link, citation number, and why you think it is necessary for BenchPOTS to include.
❗️A rule of thumb is at least one year since publication, 10+ citations, and usefulness.

- type: checkboxes
id: information-tasks
attributes:
label: 2. Check open-source status
description: |
Please note that if the dataset's open-source implementation is not available, it'll take much more time to finish the implementation, so we are less likely to implement it in `BenchPOTS`.
options:
- label: "The dataset is publicly available"

- type: textarea
id: additional-info
attributes:
label: 3. Provide useful information for the implementation
description: |
Give any and all information you think is helpful to the implementation.
If there is open-source implementation, please provide information regarding it and the authors.
Please mention the authors by @github-username in case you're aware of their usernames.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "🙌 Feature Request"
description: Submit a request to add a new feature.
labels: ["new feature", "enhancement"]

body:
- type: textarea
id: feature-description-requested
validations:
required: true
attributes:
label: 1. Feature description
description: |
A clear and concise description of the feature proposal. Please provide a link to the paper and code if they exist.

- type: textarea
id: motivation
validations:
required: true
attributes:
label: 2. Motivation
description: |
Please outline the motivation of your proposal. Is your feature request related to a problem? If this is related to another GitHub issue, please link here.

- type: textarea
id: contribution
validations:
required: true
attributes:
label: 3. Your contribution
description: |
Is there any way that you could help, for example, by submitting a PR?
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/other-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "🤔 Other Kinds of Issues"
description: "Didn't find a proper issue template above? Start here!"
labels: ["question"]

body:
- type: textarea
id: issue-description-requested
validations:
required: true
attributes:
label: Issue description
description: |
A clear and concise description of the issue. Please provide a link to related information and code if they exist.
Besides, please add according labels to the issue on the right side of the page.
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- 🚨Please create your PR to merge code from your branch to `dev` branch here, rather than `main`. -->

# What does this PR do?

<!--
Congrats! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution 😉.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, I will review your PR shortly. I may suggest changes to make the code even better 🤝.
-->

<!-- Remove if not applicable -->

Fixing # (issue)


## Before submitting

<!-- You can remove checks that are not relevant to this PR. -->

- [ ] This PR is made to fix a typo or improve the docs (you can dismiss the other checks if this is the case).
- [ ] Was this discussed/approved via a GitHub issue? Please add a link to it if that's the case.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have written necessary tests and already run them locally.
44 changes: 44 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Auto reply to new issues and PRs

on:
issues:
types: [opened]
pull_request:
branches: [main, dev]
types: [opened]

jobs:
greeting:
runs-on: ubuntu-latest

permissions:
pull-requests: write
issues: write

steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Hi there 👋,

Thank you so much for your attention to BenchPOTS! You can follow me on GitHub to get updates on PyPOTS.
If you find PyPOTS tools helpful to your work, please star⭐️ this repository.
Your star is your recognition, which can help more people notice PyPOTS and grow PyPOTS community.
It matters and is definitely a kind of contribution to the community.
You can also [follow me](https://github.com/WenjieDu) on GitHub to receive the latest news of PyPOTS.

I have received your message and will respond ASAP. Thank you for your patience! 😃

Best,
Wenjie
pr-message: |
Hi there 👋,

We really appreciate that you have taken the time to make this PR on BenchPOTS!

If you are trying to fix a bug, please reference the issue number in the description or give your details about the bug.
If you are implementing a feature request, please check with the maintainers that the feature will be accepted first.

Best,
Wenjie
31 changes: 31 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Linting

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
flake8-linting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install Flake8
run: |
pip install flake8 flake8-pyproject

- name: Run linting
run: |
flake8 .
8 changes: 2 additions & 6 deletions .github/workflows/publish_to_PyPI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,11 @@ jobs:
with:
python-version: '3.10'
check-latest: true
cache: pip
cache-dependency-path: |
setup.cfg

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
pip install -r requirements.txt
pip install build

- name: Fetch the test environment details
run: |
Expand All @@ -48,7 +44,7 @@ jobs:

- name: Build package
run: |
python -m build --no-isolation
python -m build

- name: Publish the new package to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.6
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/testing_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches:
- main
- dev
- temp_test_branch # if in need, create such a temporary branch to test some functions

pull_request:
branches:
- dev

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
python-version: [ "3.8","3.11" ]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
pip install coverage

- name: Test with pytest
run: |
python -m pytest -rA tests/test_benchpots.py -s --cov=benchpots

- name: Write the LCOV report
run: |
python -m coverage lcov

- name: Submit report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: 'coverage.lcov'
21 changes: 2 additions & 19 deletions benchpots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,11 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


# BenchPOTS version
#
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
# Generic release markers:
# X.Y
# X.Y.Z # For bugfix releases
#
# Admissible pre-release markers:
# X.YaN # Alpha release
# X.YbN # Beta release
# X.YrcN # Release Candidate
# X.Y # Final release
#
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
__version__ = "0.2"

from . import utils, datasets
from .version import __version__

__all__ = [
"__version__",
"utils",
"datasets",
]
25 changes: 25 additions & 0 deletions benchpots/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""

"""

# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause


# BenchPOTS version
#
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
# Generic release markers:
# X.Y
# X.Y.Z # For bugfix releases
#
# Admissible pre-release markers:
# X.YaN # Alpha release
# X.YbN # Beta release
# X.YrcN # Release Candidate
# X.Y # Final release
#
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
__version__ = "0.2.1"
Loading
Loading