Skip to content

Commit

Permalink
include pyproject.toml refactor (#54)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
martin-springer and markcampanelli authored Jan 31, 2024
1 parent 19e0f6f commit cc0679a
Show file tree
Hide file tree
Showing 54 changed files with 9,337 additions and 21,518 deletions.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

on: push

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pvdeg
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
117 changes: 0 additions & 117 deletions .github/workflows/publish-to-test-pypi.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
matrix:
python-version: ["3.9", "3.10", "3.11"]
env: [
'-r requirements.txt .[test]',
'--upgrade --upgrade-strategy=eager .[test]'
]

Expand All @@ -28,8 +27,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install ${{ matrix.env }}
run: |
python -m pip install --upgrade pip wheel
pip install ${{ matrix.env }}
python -m pip install --progress-bar off --upgrade pip
python -m pip install --progress-bar off ${{ matrix.env }}
- name: Test with pytest ${{ matrix.env }}
run: |
pytest
python -m pytest
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
4 changes: 1 addition & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include versioneer.py
include pvdeg/_version.py
include pvdeg/data/*
include LICENSE
include *.md
graft DataLibrary
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,24 @@ It takes a minute to load the environment.

### Locally

You can also run the tutorial locally with
[miniconda](https://docs.conda.io/en/latest/miniconda.html) by following thes
steps:

1. Install [miniconda](https://docs.conda.io/en/latest/miniconda.html).

1. Clone the repository:
You can also run the tutorial locally in a virtual environment, i.e., `venv` or
[miniconda](https://docs.conda.io/en/latest/miniconda.html).

1. Create and activate a new environment, e.g., on Mac/Linux terminal with `venv`:
```
git clone https://github.com/NREL/PVDegradationTools.git
python -m venv pvdeg
. pvdeg/bin/activate
```

1. Create the environment and install the requirements. The repository includes
a `requirements.txt` file that contains a list the packages needed to run
this tutorial. To install them using conda run:

or with `conda`:
```
conda create -n pvdeg jupyter -c pvlib --file requirements.txt
conda create -n pvdeg
conda activate pvdeg
```

or you can install it with `pip install pvdeg` as explained in the installation instructions into the environment.
1. Install `pvdeg` into the new environment with `pip`:
```
python -m pip install pvdeg
```

1. Start a Jupyter session:

Expand All @@ -98,9 +94,9 @@ Install with:

pip install pvdeg

For developer installation, download the repository, navigate to the folder location and install as:
For developer installation, clone the repository, navigate to the folder location and install as:

pip install -e .
pip install -e .[all]


License
Expand Down
11 changes: 11 additions & 0 deletions contributors/markcampanelli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
2024-01-09

I hereby agree to the terms of the Contributors License Agreement,
version 1.0, with MD5 checksum 46ea45f996295bdb0652333d516a6d0a.

I furthermore declare that I am authorized and able to make this
agreement and sign this declaration.

Signed,

Mark Campanelli https://github.com/markcampanelli
25 changes: 19 additions & 6 deletions docs/sphinx/source/_autosummary/pvdeg.collection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,30 @@

.. automodule:: pvdeg.collection












.. rubric:: Functions

.. autosummary::

calculate_jsc_from_tau_cp
calculate_jsc_from_tau_iqe
collection_probability
generation_current













25 changes: 19 additions & 6 deletions docs/sphinx/source/_autosummary/pvdeg.degradation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@

.. automodule:: pvdeg.degradation












.. rubric:: Functions

.. autosummary::

IwaArrhenius
IwaVantHoff
arrhenius_deg
degradation
vantHoff_deg













23 changes: 18 additions & 5 deletions docs/sphinx/source/_autosummary/pvdeg.design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,28 @@

.. automodule:: pvdeg.design







.. rubric:: Functions

.. autosummary::

edge_seal_ingress_rate
edge_seal_width












.. rubric:: Functions

.. autosummary::

edge_seal_ingress_rate
edge_seal_width
Loading

0 comments on commit cc0679a

Please sign in to comment.