From c8411bfd7199f029e75a7e15cd21219df873ff70 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Fri, 30 Jun 2023 21:00:31 -0400 Subject: [PATCH] Set up for initial release (#5) * updates * fix unrelated broken test * whatsnew * tweak docs --- .github/workflows/publish.yml | 2 +- README.rst | 22 +++++++++++++++++ docs/sphinx/conf.py | 24 +++++++++++++------ docs/sphinx/whatsnew.rst | 1 + docs/sphinx/whatsnew/v1.5.3.rst | 13 ++++------ pvfactors/tests/test_geometry/test_pvarray.py | 2 +- requirements.txt | 2 +- setup.py | 9 ++++--- 8 files changed, 52 insertions(+), 23 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 427c1eb..4535f3e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,4 +34,4 @@ jobs: uses: pypa/gh-action-pypi-publish@master with: user: __token__ - password: ${{ secrets.PYPI_PASSWORD }} \ No newline at end of file + password: ${{ secrets.PYPI_TOKEN }} diff --git a/README.rst b/README.rst index bdf0003..51d75da 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,25 @@ +pvlib/solarfactors: a fork of SunPower/pvfactors +================================================ + +This repository is a fork of `SunPower/solarfactors `_, +a 2-D view factor model for simulating front- and rear-side irradiance for +bifacial PV systems. + +This fork exists so that the pvfactors model can continue to be used with +`pvlib python `_ even though the original +repository is no longer maintained. The objective is to provide a working +dependency for the existing pvfactors functionality currently in pvlib python. +New features may be added, but don't count on it. + +Documentation for this fork can be found at `Read The Docs `_. + +The project can be installed from PyPI using ``pip install solarfactors``. Note +that the package is still used from python under the ``pvfactors`` name, i.e. +with ``from pvfactors.geometry import OrderedPVArray``. + +The original ``pvfactors`` is preserved below: + + pvfactors: irradiance modeling made simple ========================================== diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index 67eb79f..9cd5999 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -48,10 +48,12 @@ 'sphinx.ext.coverage', 'nbsphinx', 'sphinx.ext.napoleon', + 'sphinx.ext.extlinks', 'sphinxcontrib_github_alt' ] -# For sphinxcontrib_github_alt +# For sphinxcontrib_github_alt. keep this as the original repo for old links +# (since new links use extlinks instead of this) github_project_url = "https://github.com/SunPower/pvfactors" # Add any paths that contain templates here, relative to this directory. @@ -69,9 +71,9 @@ master_doc = 'index' # General information about the project. -project = u'pvfactors' -copyright = u'2016, SunPower Corporation' -author = u'SunPower Corporation' +project = u'solarfactors' +copyright = u'2016, SunPower Corporation and pvlib python Developers' +author = u'SunPower Corporation and pvlib python Developers' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -135,8 +137,8 @@ html_context = { 'display_github': True, - 'github_user': 'SunPower', - 'github_repo': 'pvfactors' + 'github_user': 'pvlib', + 'github_repo': 'solarfactors' } # Theme options are theme-specific and customize the look and feel of a theme @@ -146,7 +148,7 @@ # Make sure the "Edit on Github" link is not broken rst_prolog = """ -:github_url: https://github.com/SunPower/pvfactors/ +:github_url: https://github.com/pvlib/solarfactors/ """ @@ -336,3 +338,11 @@ def setup(app): app.add_css_file('css/custom.css') + + +extlinks = { + 'issue': ('https://github.com/pvlib/solarfactors/issues/%s', 'GH'), + 'pull': ('https://github.com/pvlib/solarfactors/pull/%s', 'GH'), + 'doi': ('http://dx.doi.org/%s', 'DOI: '), + 'ghuser': ('https://github.com/%s', '@') +} diff --git a/docs/sphinx/whatsnew.rst b/docs/sphinx/whatsnew.rst index 8fc39ed..15ad9c1 100644 --- a/docs/sphinx/whatsnew.rst +++ b/docs/sphinx/whatsnew.rst @@ -6,6 +6,7 @@ What's New These are new features and improvements of note in each release. +.. include:: whatsnew/v1.5.3.rst .. include:: whatsnew/v1.5.2.rst .. include:: whatsnew/v1.5.1.rst .. include:: whatsnew/v1.5.0.rst diff --git a/docs/sphinx/whatsnew/v1.5.3.rst b/docs/sphinx/whatsnew/v1.5.3.rst index bdadb38..7bc6735 100644 --- a/docs/sphinx/whatsnew/v1.5.3.rst +++ b/docs/sphinx/whatsnew/v1.5.3.rst @@ -1,23 +1,20 @@ .. _whatsnew_153: -v1.5.3 (TBD) +v1.5.3 (June 30, 2023) ====================== +This is the first release of the ``solarfactors`` fork. + Installation ------------ * The ``docs`` and ``testing`` extras in ``setup.py`` are now called ``doc`` and ``test`` (:pull:`1`) -Enhancements ------------- - Requirements ------------ +* Removed the upper version limit on ``pvlib`` (:pull:`5`) -Bug Fixes ----------- - Testing ------- * Migrated CI infrastructure to GitHub Actions (:pull:`1`) @@ -28,4 +25,4 @@ Testing Contributors ------------ -* Kevin Anderson (:ghuser:`kanderso-nrel`) +* Kevin Anderson (:ghuser:`kandersolar`) diff --git a/pvfactors/tests/test_geometry/test_pvarray.py b/pvfactors/tests/test_geometry/test_pvarray.py index 47deab8..55c7277 100644 --- a/pvfactors/tests/test_geometry/test_pvarray.py +++ b/pvfactors/tests/test_geometry/test_pvarray.py @@ -133,7 +133,7 @@ def test_ordered_pvarray_gnd_shadow_casting(params): ordered_pvarray = OrderedPVArray.fit_from_dict_of_scalars(params) assert len(ordered_pvarray.ts_ground.non_point_shaded_surfaces_at(0)) == 3 assert len(ordered_pvarray.ts_ground.non_point_illum_surfaces_at(0)) == 7 - assert ordered_pvarray.ts_ground.shaded_length == 6.385066634855473 + assert ordered_pvarray.ts_ground.shaded_length.round(3) == 6.385 def _check_ground_surfaces(ts_ground, expected_n_shadow_surfaces, diff --git a/requirements.txt b/requirements.txt index 38a4094..da5c165 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pvlib>=0.9.0,<0.10.0 +pvlib>=0.9.0 shapely>=1.6.4.post2,<2 matplotlib future diff --git a/setup.py b/setup.py index 6319bd2..cabb0cb 100644 --- a/setup.py +++ b/setup.py @@ -11,10 +11,10 @@ with open('requirements.txt', 'r') as f: INSTALL_REQUIRES = list(f) -DISTNAME = 'pvfactors' -AUTHOR = 'SunPower' -MAINTAINER_EMAIL = 'marc.abouanoma@sunpowercorp.com' -URL = 'https://github.com/SunPower/pvfactors' +DISTNAME = 'solarfactors' +AUTHOR = 'SunPower and pvlib python Developers' +MAINTAINER_EMAIL = 'pvlib-admin@googlegroups.com' +URL = 'https://github.com/pvlib/solarfactors' PACKAGES = ['pvfactors', 'pvfactors.geometry', 'pvfactors.irradiance', 'pvfactors.viewfactors'] LICENSE = 'BSD 3-Clause' @@ -24,7 +24,6 @@ 'Operating System :: OS Independent', 'Intended Audience :: Science/Research', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9',