Skip to content

Commit 0880b88

Browse files
authored
Merge pull request #1 from Feelx234/develop
Major update, restructuring etc
2 parents df7b901 + 94087df commit 0880b88

Some content is hidden

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

57 files changed

+7263
-3139
lines changed

.coveragerc

Lines changed: 0 additions & 18 deletions
This file was deleted.

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitconfig

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# GitHub Actions configuration **EXAMPLE**,
2+
# MODIFY IT ACCORDING TO YOUR NEEDS!
3+
# Reference: https://docs.github.com/en/actions
4+
5+
name: ci
6+
7+
on:
8+
release:
9+
types: [published]
10+
push:
11+
# Avoid using all the resources/limits available by checking only
12+
# relevant branches and tags. Other branches can be checked via PRs.
13+
branches: [main]
14+
tags: ['v?[0-9]+.[0-9]+.?[0-9]?*'] # Match tags that resemble a version
15+
pull_request: # Run in every PR
16+
workflow_dispatch: # Allow manually triggering the workflow
17+
schedule:
18+
# Run roughly every 15 days at 00:00 UTC
19+
# (useful to check if updates on dependencies break the package)
20+
- cron: '0 0 1,16 * *'
21+
22+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: >-
27+
${{ github.workflow }}-${{ github.ref_type }}-
28+
${{ github.event.pull_request.number || github.sha }}
29+
cancel-in-progress: true
30+
31+
jobs:
32+
prepare:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
wheel-distribution: ${{ steps.wheel-distribution.outputs.path }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
with: {fetch-depth: 0} # deep clone for setuptools-scm
39+
- uses: actions/setup-python@v4
40+
id: setup-python
41+
with: {python-version: "3.11"}
42+
- name: Run static analysis and format checkers
43+
run: pipx run pre-commit run --all-files --show-diff-on-failure
44+
- name: Build package distribution files
45+
run: >-
46+
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
47+
tox -e clean,build
48+
- name: Record the path of wheel distribution
49+
id: wheel-distribution
50+
run: echo "path=$(ls dist/*.whl)" >> $GITHUB_OUTPUT
51+
- name: Store the distribution files for use in other stages
52+
# `tests` and `publish` will use the same pre-built distributions,
53+
# so we make sure to release the exact same package that was tested
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: python-distribution-files
57+
path: dist/
58+
retention-days: 1
59+
60+
test:
61+
needs: prepare
62+
strategy:
63+
matrix:
64+
python:
65+
- "3.9" # oldest Python supported by PSF
66+
- "3.11" # newest Python that is stable
67+
platform:
68+
- ubuntu-latest
69+
# - macos-latest
70+
- windows-latest
71+
runs-on: ${{ matrix.platform }}
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: actions/setup-python@v4
75+
id: setup-python
76+
with:
77+
python-version: ${{ matrix.python }}
78+
- name: Retrieve pre-built distribution files
79+
uses: actions/download-artifact@v4
80+
with: {name: python-distribution-files, path: dist/}
81+
- name: Run tests
82+
run: >-
83+
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
84+
tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}'
85+
-- -rFEx --durations 10 --color yes # pytest args
86+
- name: Generate coverage report
87+
run: pipx run coverage[toml] lcov -o coverage.lcov
88+
- name: Upload partial coverage report
89+
uses: coverallsapp/github-action@master
90+
with:
91+
path-to-lcov: coverage.lcov
92+
github-token: ${{ secrets.github_token }}
93+
flag-name: ${{ matrix.platform }} - py${{ matrix.python }}
94+
parallel: true
95+
96+
finalize:
97+
needs: test
98+
runs-on: ubuntu-latest
99+
steps:
100+
- name: Finalize coverage report
101+
uses: coverallsapp/github-action@master
102+
with:
103+
github-token: ${{ secrets.GITHUB_TOKEN }}
104+
parallel-finished: true
105+
106+
publish:
107+
needs: finalize
108+
if: ${{ (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) || (github.event_name == 'release' && github.event.action == 'published') }}
109+
runs-on: ubuntu-latest
110+
permissions:
111+
contents: write
112+
steps:
113+
- uses: actions/checkout@v4
114+
- uses: actions/setup-python@v4
115+
with: {python-version: "3.11"}
116+
- name: Retrieve pre-built distribution files
117+
uses: actions/download-artifact@v4
118+
with: {name: python-distribution-files, path: dist/}
119+
# - name: Publish Package (TEST)
120+
# env:
121+
# # TODO: Set your PYPI_TOKEN as a secret using GitHub UI
122+
# # - https://pypi.org/help/#apitoken
123+
# # - https://docs.github.com/en/actions/security-guides/encrypted-secrets
124+
# TWINE_REPOSITORY: pypi
125+
# TWINE_USERNAME: __token__
126+
# TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
127+
# run: pipx run tox -e publish
128+
- name: Publish Package
129+
env:
130+
# TODO: Set your PYPI_TOKEN as a secret using GitHub UI
131+
# - https://pypi.org/help/#apitoken
132+
# - https://docs.github.com/en/actions/security-guides/encrypted-secrets
133+
TWINE_REPOSITORY: pypi
134+
TWINE_USERNAME: __token__
135+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
136+
run: pipx run tox -e publish

.github/workflows/pythonapp.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/release_to_pypi.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,7 @@ scripts/datasets_path.txt
154154
env
155155
nestmodel.egginfo
156156
Untitled.ipynb
157-
Untitled1.ipynb
157+
Untitled*.ipynb
158+
csvs
159+
demo/images
160+
experiments

.pre-commit-config.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
exclude: '^docs/conf.py'
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
- id: check-ast
10+
- id: check-json
11+
- id: check-merge-conflict
12+
- id: check-xml
13+
- id: check-yaml
14+
- id: debug-statements
15+
- id: end-of-file-fixer
16+
- id: requirements-txt-fixer
17+
- id: mixed-line-ending
18+
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
19+
20+
## If you want to automatically "modernize" your Python code:
21+
# - repo: https://github.com/asottile/pyupgrade
22+
# rev: v3.7.0
23+
# hooks:
24+
# - id: pyupgrade
25+
# args: ['--py37-plus']
26+
27+
## If you want to avoid flake8 errors due to unused vars or imports:
28+
# - repo: https://github.com/PyCQA/autoflake
29+
# rev: v2.1.1
30+
# hooks:
31+
# - id: autoflake
32+
# args: [
33+
# --in-place,
34+
# --remove-all-unused-imports,
35+
# --remove-unused-variables,
36+
# ]
37+
38+
# - repo: https://github.com/PyCQA/isort
39+
# rev: 5.13.2
40+
# hooks:
41+
# - id: isort
42+
43+
- repo: https://github.com/psf/black
44+
rev: 24.10.0
45+
hooks:
46+
- id: black
47+
language_version: python3
48+
49+
## If like to embrace black styles even in the docs:
50+
# - repo: https://github.com/asottile/blacken-docs
51+
# rev: v1.13.0
52+
# hooks:
53+
# - id: blacken-docs
54+
# additional_dependencies: [black]
55+
56+
- repo: https://github.com/PyCQA/flake8
57+
rev: 7.1.1
58+
hooks:
59+
- id: flake8
60+
additional_dependencies: [Flake8-pyproject]
61+
## You can add flake8 plugins via `additional_dependencies`:
62+
# additional_dependencies: [flake8-bugbear]
63+
64+
## Check for misspells in documentation files:
65+
# - repo: https://github.com/codespell-project/codespell
66+
# rev: v2.2.5
67+
# hooks:
68+
# - id: codespell

.pylintrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)