-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
641 additions
and
517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
blank_issues_enabled: true | ||
contact_links: | ||
- name: I just have a question... | ||
url: https://github.com/ROVI-org/thevenin/discussions | ||
url: https://github.com/NREL/thevenin/discussions | ||
about: Join our discussion instead. Search for existing questions, or ask a new one! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+' | ||
|
||
env: | ||
PACKAGE_NAME: '<PACKAGE_NAME>' | ||
|
||
jobs: | ||
details: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag_version: ${{ steps.release.outputs.tag_version }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Extract tag details | ||
id: release | ||
run: | | ||
if [[ "${{ github.ref_type }}" = "tag" ]]; then | ||
TAG_VERSION=${GITHUB_REF#refs/tags/v} | ||
echo "tag_version=$TAG_VERSION" >> "$GITHUB_OUTPUT" | ||
echo "Tag version is $TAG_VERSION" | ||
else | ||
echo "No tag found" | ||
exit 1 | ||
fi | ||
check-version: | ||
needs: details | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.13' | ||
|
||
- name: Fetch info from PyPI | ||
run: | | ||
response=$(curl -s https://pypi.org/pypi/${{ env.PACKAGE_NAME }}/json || echo "{}") | ||
latest_pypi_version=$(echo $response | grep -oP '"releases":\{"\K[^"]+' | sort -rV | head -n 1) | ||
if [[ -z "$latest_pypi_version" ]]; then | ||
echo "Package not found on PyPI." | ||
latest_pypi_version="0.0.0" | ||
fi | ||
echo "Latest version on PyPI: $latest_pypi_version" | ||
echo "latest_pypi_version=$latest_pypi_version" >> $GITHUB_ENV | ||
- name: Compare version against PyPI and exit if not newer | ||
run: | | ||
TAG_VERSION=${{ needs.details.outputs.tag_version }} | ||
PYPI_VERSION=$latest_pypi_version | ||
TAG_BASE=${TAG_VERSION%%[a-z]} | ||
PYPI_BASE=${PYPI_VERSION%%[a-z]} | ||
TAG_SUFFIX=${TAG_VERSION#$TAG_BASE} | ||
PYPI_SUFFIX=${PYPI_VERSION#$PYPI_BASE} | ||
suffix_count=0 | ||
[[ -n "$TAG_SUFFIX" ]] && ((suffix_count++)) | ||
[[ -n "$PYPI_SUFFIX" ]] && ((suffix_count++)) | ||
if [[ "$TAG_VERSION" == "$PYPI_VERSION" ]]; then | ||
echo "The tag $TAG_VERSION matches the PyPI version $PYPI_VERSION." | ||
exit 1 | ||
elif [[ "$suffix_count" == 1 && "$TAG_BASE" == "$PYPI_BASE" ]]; then | ||
if [[ -n "$PYPI_SUFFIX" ]]; then | ||
echo "The tag $TAG_VERSION is newer than PyPI $PYPI_VERSION." | ||
else | ||
echo "The tag $TAG_VERSION is older than PyPI $PYPI_VERSION." | ||
exit 1 | ||
fi | ||
else | ||
newest=$(printf "%s\n%s" "$TAG_VERSION" "$PYPI_VERSION" | sort -V | tail -n 1) | ||
if [[ "$TAG_VERSION" == "$newest" ]]; then | ||
echo "The tag $TAG_VERSION is newer than PyPI $PYPI_VERSION." | ||
else | ||
echo "The tag $TAG_VERSION is older than PyPI $PYPI_VERSION." | ||
exit 1 | ||
fi | ||
fi | ||
- name: Verify tag and pyproject.toml versions match | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools numpy cython | ||
PKG_VERSION=$(python setup.py --version) | ||
TAG_VERSION=${{ needs.details.outputs.tag_version }} | ||
if [[ "$PKG_VERSION" != "$TAG_VERSION" ]]; then | ||
echo "Version mismatch: setup.py has $PKG_VERSION, but tag is $TAG_VERSION." | ||
exit 1 | ||
else | ||
echo "Package and tag versions match: $PKG_VERSION == $TAG_VERSION." | ||
fi | ||
build: | ||
name: (build ubuntu-latest, 3.13) | ||
needs: [details, check-version] | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.13' | ||
|
||
- name: Install build | ||
run: pip install build | ||
|
||
- name: Build distributions | ||
run: python -m build | ||
|
||
- name: Test binary installation | ||
run: | | ||
pip uninstall thevenin | ||
pip cache purge | ||
python -m pip install --upgrade pip | ||
pip install dist/*.whl -v | ||
pip install pytest | ||
pytest ./tests | ||
- name: Test source installation | ||
run: | | ||
pip uninstall thevenin | ||
pip cache purge | ||
python -m pip install --upgrade pip | ||
pip install dist/*.tar.gz -v | ||
pip install pytest | ||
pytest ./tests | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: builds | ||
path: dist/* | ||
|
||
pypi-publish: | ||
name: Upload to PyPI | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: dist/ | ||
pattern: builds* | ||
merge-multiple: true | ||
|
||
- name: Check files | ||
run: ls dist | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.13' | ||
|
||
- name: Install twine | ||
run: pip install twine | ||
|
||
- name: Check builds and upload to PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
twine check dist/* | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
# thevenin Changelog | ||
|
||
## [Version 0.1.1]() | ||
## [Unreleased](https://github.com/NREL/thevenin) | ||
|
||
### New Features | ||
|
||
### Optimizations | ||
* Add `options` to the `Experiment.print_steps()` report. This makes it easier to check solver options for each step. | ||
|
||
### Bug Fixes | ||
* Make the final value of `tspan` always match `t_max`. In cases where `dt` is used to construct the time array, the final `dt` may differ from the one given. Fixes [Issue #10](https://github.com/ROVI-org/thevenin/issues/10). | ||
|
||
### Breaking Changes | ||
* Drop support for Python 3.8 which reached end of support as of October 2024. | ||
|
||
## [v1.0.0](https://github.com/NREL/thevenin/tree/v1.0.0) | ||
This is the first official release of `thevenin`. Main features/capabilities are listed below. | ||
|
||
### Features | ||
- Support for any number of RC pairs | ||
- Run constant or dynamic loads with current, voltage, or power control | ||
- Parameters have temperature and state of charge dependence | ||
- Experiment limits to trigger switching between steps | ||
- Multi-limit support (end at voltage, time, etc. - whichever occurs first) | ||
|
||
### Notes | ||
- Implemented `pytest` with full package coverage | ||
- Source/binary distributions available on [PyPI](https://pypi.org/project/thevenin) | ||
- Documentation available on [Read the Docs](https://thevenin.readthedocs.io/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+14.4 KB
...er_execute/117b26505c6fecdcb9ca03e91a1511f99cf552d54a4da61141586eb2b11118be.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.8 KB
...er_execute/2909280912fc4238e0932d956c3a4caa9201facc2f89752e26d9fcbde1ba3231.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.8 KB
...er_execute/3e9b85352be643245b4634f626e01090af302155a1719045e5e95c7324fb817b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.9 KB
...er_execute/946e0a008234eed58f82547ace4186bb50604d73709eb423ec8c42de265920d7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.5 KB
...er_execute/b2de80016137565066efde91f82e4ac733749f81d9666401cde53c615dcc27e6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.8 KB
...er_execute/bc4daa5dd807256669b9e876c8786edd57baa6e79efc5663155eb6cbd680f3e3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.2 KB
...er_execute/c4ea032c0195cf3bf932cd7fdd8d3bcc9aa516477d422551c976f54de02de893.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+18.8 KB
...er_execute/f43d7715048ca9d85cc3f1b23c05426982e075d15965a93852a2a66908fd3e6e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.