Skip to content

Commit

Permalink
Merge pull request pvcaptest#95 from bt-/v12_release
Browse files Browse the repository at this point in the history
v0.12.0 release
  • Loading branch information
bt- committed Aug 29, 2023
2 parents fbac468 + a6a95d0 commit 4bddcf5
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 25 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Publish to PyPI

on:
pull_request:
push:
branches:
- master
tags:
- "v*"

jobs:
build-n-publish:
name: Build and publish to pypi
if: github.repository == 'pvcaptest/pvcaptest'
runs-on: ubuntu-latest
steps:
# fetch all commits and tags so versioneer works
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build
python -m pip install twine
- name: Build packages
run: python -m build

- name: Check metadata verification
run: python -m twine check --strict dist/*

# only publish distribution to PyPI for tagged commits
- name: Publish distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[Unreleased]


[0.12.0]: https://github.com/pvcaptest/pvcaptest/compare/v0.11.2...v0.12.0
## [0.12.0] - 2023-08-27
### Added
- Added a user guide section to the documentation with an overview and bifacial tests section.
- Added verbose kwarg to the DataLoader load method, which prints which files have been loaded
- DataLoader load method has new kwarg print_errors
- DataLoader load method stores list of paths of files that fail to load in failed_to_load attribute
- CapData method to save column_groups dictionary to excel
- Github action to build and publish to PyPI on tags like v* pushed from master

### Changed
- Updates to make pvcaptest compatible with pvlib 0.10 and scipy 1.11
- Update to make pvcaptest compatible with bokeh v3.0.0, change `plot_width` and `plot_height` to `width` and `height`
- Make bokeh v3 minimum version
- Drop support for python 3.7
- Drop to_numeric from io.file_reader
- CapData.column_groups is instance of ColumnGroups now when group_columns is a callable
- Changed defaults for the CapData plot method to single column

[0.11.2]: https://github.com/pvcaptest/pvcaptest/compare/v0.11.1...v0.11.2
## [0.11.2] - 2023-04-20
Expand Down
14 changes: 2 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx_rtd_theme',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -88,20 +89,9 @@

# -- Options for HTML output -------------------------------------------------


# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# This code is copied from the pvlib package conf.py file

# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
else:
html_theme = 'default'
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
10 changes: 8 additions & 2 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,11 @@ Maintainer will:
- checkout master branch
- merge release branch into master
- tag master branch (this will trigger versioneer to update version)
- push updates and tag to github (this will trigger CI tests)
- delete the release branch
- push updates and tag to github
- delete the release branch

Pushing a tag beginning with v from master in pvcaptest/pvcaptest will trigger the Github action publish, which will build and publish to PyPI.

``git tag -a v0.X.X -m 'v0.X.X'``

``git push origin v0.X.X``
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bokeh
bokeh>=3.0.0
holoviews>=1.14.8
colorcet
panel
Expand All @@ -10,7 +10,7 @@ docutils
notebook
nbsphinx
sphinx==2.2.0
sphinx_rtd_theme
sphinx_rtd_theme==1.2.0
recommonmark
pvlib>=0.9.0
openpyxl
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- matplotlib
- numpy
- pandas>=1*
- python>=3.7*
- python>=3.8*
- python-dateutil
- statsmodels
- scikit-learn
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
universal = 1

[metadata]
license_file = LICENSE.txt
license_files = LICENSE.txt

[flake8]
max-line-length = 88
Expand Down
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def read(*filenames, **kwargs):
'twine',
]
EXTRAS_REQUIRE['docs'] = EXTRAS_REQUIRE['optional'] + [
'docutils',
'nbsphinx',
'docutils==0.18.1',
'nbsphinx==0.9.1',
'notebook',
'recommonmark',
'sphinx',
'sphinx_rtd_theme',
'recommonmark==0.7.1',
'sphinx==6.1.3',
'sphinx_rtd_theme==1.2.0',
]
EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), [])))

Expand All @@ -60,9 +60,11 @@ def read(*filenames, **kwargs):
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
author_email='benjaming.taylor@gmail.com',
description=('Framework and methods to facilitate photovoltaic '
'facility capacity testing following ASTM E2848.'),
description=(
'Framework and methods to facilitate photovoltaic '
'facility capacity testing following ASTM E2848.'),
long_description=long_description,
long_description_content_type='text/rst',
packages=find_packages(where="src"),
package_dir={"": "src"},
include_package_data=True,
Expand Down
7 changes: 7 additions & 0 deletions src/captest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,13 @@ def load(self, extension="csv", verbose=True, print_errors=False, **kwargs):
Change the extension to allow loading different filetypes. Must also set
the `file_reader` attribute to a function that will read that type of file.
Do not include a period ".".
verbose : bool, default True
By default prints path of each file attempted to load and then confirmation
it was loaded or states it failed to load. Is only relevant if `path` is
set to a directory not a file. Set to False to not print out any file
loading status.
print_errors : bool, default False
Set to true to print error if file fails to load.
**kwargs
Are passed through to the file_reader callable, which by default will pass
them on to pandas.read_csv.
Expand Down

0 comments on commit 4bddcf5

Please sign in to comment.