Skip to content

Commit cc0679a

Browse files
include pyproject.toml refactor (#54)
* Refactor packaging to pyproject.toml * Tweak a coule things * Exclude Python 3.12+ * Fix tests due to pvlib v0.10.3 bugfix * Provide key fallback for older pvlib versions * Add SCM version to sphinx docs * Update READMEs * Fix more Dew Point instances * deploy to pypi on tag release (#55) * add pypi workflow * Revert "Kempe standoff" (#57) --------- Co-authored-by: Mark Campanelli <mark.campanelli@gmail.com>
1 parent 19e0f6f commit cc0679a

Some content is hidden

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

54 files changed

+9337
-21518
lines changed

.coveragerc

-2
This file was deleted.

.github/workflows/publish-to-pypi.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.x"
16+
- name: Install pypa/build
17+
run: >-
18+
python3 -m
19+
pip install
20+
build
21+
--user
22+
- name: Build a binary wheel and a source tarball
23+
run: python3 -m build
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: python-package-distributions
28+
path: dist/
29+
30+
publish-to-pypi:
31+
name: >-
32+
Publish Python 🐍 distribution 📦 to PyPI
33+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
34+
needs:
35+
- build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: pypi
39+
url: https://pypi.org/p/pvdeg
40+
permissions:
41+
id-token: write # IMPORTANT: mandatory for trusted publishing
42+
43+
steps:
44+
- name: Download all the dists
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Publish distribution 📦 to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/publish-to-test-pypi.yml

-117
This file was deleted.

.github/workflows/pytest.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
matrix:
1717
python-version: ["3.9", "3.10", "3.11"]
1818
env: [
19-
'-r requirements.txt .[test]',
2019
'--upgrade --upgrade-strategy=eager .[test]'
2120
]
2221

@@ -28,8 +27,8 @@ jobs:
2827
python-version: ${{ matrix.python-version }}
2928
- name: Install ${{ matrix.env }}
3029
run: |
31-
python -m pip install --upgrade pip wheel
32-
pip install ${{ matrix.env }}
30+
python -m pip install --progress-bar off --upgrade pip
31+
python -m pip install --progress-bar off ${{ matrix.env }}
3332
- name: Test with pytest ${{ matrix.env }}
3433
run: |
35-
pytest
34+
python -m pytest

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
5+
rev: v3.2.0
66
hooks:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer

MANIFEST.in

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
include versioneer.py
2-
include pvdeg/_version.py
31
include pvdeg/data/*
4-
include LICENSE
2+
include *.md
53
graft DataLibrary

README.md

+13-17
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,24 @@ It takes a minute to load the environment.
5050

5151
### Locally
5252

53-
You can also run the tutorial locally with
54-
[miniconda](https://docs.conda.io/en/latest/miniconda.html) by following thes
55-
steps:
56-
57-
1. Install [miniconda](https://docs.conda.io/en/latest/miniconda.html).
58-
59-
1. Clone the repository:
53+
You can also run the tutorial locally in a virtual environment, i.e., `venv` or
54+
[miniconda](https://docs.conda.io/en/latest/miniconda.html).
6055

56+
1. Create and activate a new environment, e.g., on Mac/Linux terminal with `venv`:
6157
```
62-
git clone https://github.com/NREL/PVDegradationTools.git
58+
python -m venv pvdeg
59+
. pvdeg/bin/activate
6360
```
64-
65-
1. Create the environment and install the requirements. The repository includes
66-
a `requirements.txt` file that contains a list the packages needed to run
67-
this tutorial. To install them using conda run:
68-
61+
or with `conda`:
6962
```
70-
conda create -n pvdeg jupyter -c pvlib --file requirements.txt
63+
conda create -n pvdeg
7164
conda activate pvdeg
7265
```
7366

74-
or you can install it with `pip install pvdeg` as explained in the installation instructions into the environment.
67+
1. Install `pvdeg` into the new environment with `pip`:
68+
```
69+
python -m pip install pvdeg
70+
```
7571

7672
1. Start a Jupyter session:
7773

@@ -98,9 +94,9 @@ Install with:
9894

9995
pip install pvdeg
10096

101-
For developer installation, download the repository, navigate to the folder location and install as:
97+
For developer installation, clone the repository, navigate to the folder location and install as:
10298

103-
pip install -e .
99+
pip install -e .[all]
104100

105101

106102
License

contributors/markcampanelli.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2024-01-09
2+
3+
I hereby agree to the terms of the Contributors License Agreement,
4+
version 1.0, with MD5 checksum 46ea45f996295bdb0652333d516a6d0a.
5+
6+
I furthermore declare that I am authorized and able to make this
7+
agreement and sign this declaration.
8+
9+
Signed,
10+
11+
Mark Campanelli https://github.com/markcampanelli

docs/sphinx/source/_autosummary/pvdeg.collection.rst

+19-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,30 @@
33

44
.. automodule:: pvdeg.collection
55

6+
7+
8+
69

7-
8-
9-
10-
11-
10+
11+
1212
.. rubric:: Functions
1313

1414
.. autosummary::
15-
15+
1616
calculate_jsc_from_tau_cp
1717
calculate_jsc_from_tau_iqe
1818
collection_probability
1919
generation_current
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+

docs/sphinx/source/_autosummary/pvdeg.degradation.rst

+19-6
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,31 @@
33

44
.. automodule:: pvdeg.degradation
55

6+
7+
8+
69

7-
8-
9-
10-
11-
10+
11+
1212
.. rubric:: Functions
1313

1414
.. autosummary::
15-
15+
1616
IwaArrhenius
1717
IwaVantHoff
1818
arrhenius_deg
1919
degradation
2020
vantHoff_deg
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+

docs/sphinx/source/_autosummary/pvdeg.design.rst

+18-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,28 @@
33

44
.. automodule:: pvdeg.design
55

6+
7+
8+
69

10+
11+
12+
.. rubric:: Functions
713

14+
.. autosummary::
15+
16+
edge_seal_ingress_rate
17+
edge_seal_width
18+
19+
820

21+
22+
23+
924

25+
26+
27+
1028

1129

12-
.. rubric:: Functions
1330

14-
.. autosummary::
15-
16-
edge_seal_ingress_rate
17-
edge_seal_width

0 commit comments

Comments
 (0)