Skip to content

Commit 620fe51

Browse files
authored
Add pre commit + Cleanup + Python 3.10 (#4)
* switch to pyproject.toml * initial pre-commit * initial formatting * formatting * update configs * remove spyder docstring * add pre-commit to reqs * fix typo * fixing pre-commit * add pylint to reqs * update python 3.9 * fix typo * fix typo * fix typo * remove manifest from gitignore * set number of jobs for pylint * python 3.10 * 3.10 to "3.10" * remove macos-latest, windows-latest * test commit * change * change back * rerun notebooks * formatting * cleanup * fix data path * fix data path
1 parent 8146b06 commit 620fe51

File tree

87 files changed

+1538
-2501
lines changed

Some content is hidden

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

87 files changed

+1538
-2501
lines changed

.github/workflows/python-app.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: swolfpy-inputdata
4+
name: PreCommit - swolfpy-inputdata
55

66
on:
77
push:
@@ -16,21 +16,22 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
os: [ubuntu-latest, macos-latest, windows-latest]
20-
python-version: [3.7, 3.8]
19+
os: [ubuntu-latest]
20+
python-version: ["3.10"]
2121

2222
steps:
2323
- uses: actions/checkout@v2
2424
- name: Set up Python ${{ matrix.python-version }}
2525
uses: actions/setup-python@v2
2626
with:
2727
python-version: ${{ matrix.python-version }}
28-
28+
2929
- name: Install dependencies
3030
run: |
3131
python -m pip install --upgrade pip
3232
pip install -r requirements.txt
33-
34-
- name: Test with pytest
33+
34+
- name: Pre-Commit
3535
run: |
36-
py.test
36+
git fetch origin master
37+
pre-commit run --from-ref origin/master --to-ref HEAD --show-diff-on-failure

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ wheels/
2828
# PyInstaller
2929
# Usually these files are written by a python script from a template
3030
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31-
*.manifest
3231
*.spec
3332

3433
# Installer logs
@@ -46,6 +45,7 @@ coverage.xml
4645
*.cover
4746
.hypothesis/
4847
.pytest_cache/
48+
test_report.xml
4949

5050
# Translations
5151
*.mo
@@ -102,4 +102,4 @@ ENV/
102102
.mypy_cache/
103103

104104
# IDE settings
105-
.vscode/
105+
.vscode/

.pre-commit-config.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-json
9+
- id: check-toml
10+
- id: debug-statements
11+
- id: pretty-format-json
12+
- id: check-merge-conflict
13+
14+
- repo: https://github.com/pycqa/isort
15+
rev: 5.12.0
16+
hooks:
17+
- id: isort
18+
19+
20+
- repo: https://github.com/pycqa/docformatter
21+
rev: v1.5.1
22+
hooks:
23+
- id: docformatter
24+
args: [
25+
--in-place,
26+
--make-summary-multi-line,
27+
--close-quotes-on-newline ,
28+
--pre-summary-newline,
29+
--recursive,
30+
--wrap-summaries=90,
31+
--wrap-descriptions=90,
32+
]
33+
34+
- repo: https://github.com/psf/black
35+
rev: 23.1.0
36+
hooks:
37+
- id: black
38+
args: [
39+
--safe,
40+
--config=pyproject.toml,
41+
]
42+
43+
- repo: local
44+
hooks:
45+
- id: pylint
46+
name: pylint
47+
entry: pylint
48+
language: python
49+
types: [python]
50+
always_run: true
51+
args: [
52+
swolfpy_inputdata,
53+
tests,
54+
--rcfile=pyproject.toml,
55+
-rn, # Only display messages
56+
-sn, # Don't display the score
57+
]
58+
59+
- id: pytest
60+
name: pytest
61+
entry: pytest
62+
language: python
63+
verbose: true
64+
pass_filenames: false
65+
always_run: true

AUTHORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Contributors
1818

1919
Acknowledgements
2020
----------------
21-
This work was supported by the National Science Foundation(Awards Numbers: `CBET-1437498`_ and `CBET-1034059`_) and Environmental Research and Educational Foundation (`EREF`_).
21+
This work was supported by the National Science Foundation(Awards Numbers: `CBET-1437498`_ and `CBET-1034059`_) and Environmental Research and Educational Foundation (`EREF`_).
2222

2323
.. _CBET-1437498: https://nsf.gov/awardsearch/showAward?AWD_ID=1437498
2424
.. _CBET-1034059: https://nsf.gov/awardsearch/showAward?AWD_ID=1034059

HISTORY.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
History
33
=======
44

5+
1.0.0 (2023-06-03)
6+
------------------
7+
8+
* Upgrade to Python 3.10
9+
* Add PreCommit
10+
11+
512
0.2.4 (2022-04-05)
613
------------------
14+
715
* Add Multi-family and commercial Waste collection
816
* Add Animal feed production (AnF)
917

@@ -17,13 +25,13 @@ History
1725
0.2.1 (2021-10-02)
1826
------------------
1927

20-
* New models: Gasification & Syngas combustion (GC), Refuse-Derived Fuel (RDF), Home composting (HC)
28+
* New models: Gasification & Syngas combustion (GC), Refuse-Derived Fuel (RDF), Home composting (HC)
2129

2230

2331
0.1.9 (2021-05-10)
2432
------------------
2533

26-
* Life cycle cost, input data for TS, References
34+
* Life cycle cost, input data for TS, References
2735

2836

2937
0.1.0 (2020-05-06)

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include CONTRIBUTING.rst
33
include HISTORY.rst
44
include LICENSE
55
include README.rst
6-
6+
recursive-include swolfpy_inputdata/data *.csv
77
recursive-include tests *
88
recursive-exclude * __pycache__
99
recursive-exclude * *.py[co]

0 commit comments

Comments
 (0)