Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 1549874
Author: echedey-ls <[email protected]>
Date:   Wed Oct 9 13:41:14 2024 +0200

    Delete _config.yml

commit 5e40321
Author: echedey-ls <[email protected]>
Date:   Wed Oct 9 13:39:47 2024 +0200

    Initial rework: docs/tests/pytest CI/port and update code
  • Loading branch information
echedey-ls committed Oct 9, 2024
1 parent 3fdc03c commit c3e51d4
Show file tree
Hide file tree
Showing 65 changed files with 3,568 additions and 66 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: pytest

on:
pull_request:
push:
branches:
- main

jobs:
test:
strategy:
fail-fast: false # run all matrix jobs even if one fails
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
suffix: [''] # placeholder as an alternative to "-min"
include:
- os: ubuntu-latest
python-version: "3.7"
suffix: -min

runs-on: ${{ matrix.os }}
env:
# Dev requirement filename, e.g., ci/requirements-py3.9-min.txt or ci/requirements-py3.9.txt
# these are pip-compatible requirements files
REQUIREMENTS: ci/requirements-py${{ matrix.python-version }}${{ matrix.suffix }}.txt

steps:
# Check out only a limited depth and then pull tags to save time
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 100

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Install Python ${{ matrix.python-version }}${{ matrix.suffix }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up test requirements
# sets versions of dependencies in the requirements file first to avoid installing newer versions
run: |
pip install -r ${{ env.REQUIREMENTS }}
pip freeze
- name: Set up environment
run: |
pip install .[test]
pip freeze
- name: Run tests
shell: bash -l {0}
run: |
pytest pvlib
73 changes: 70 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Added to the template .gitignore
# Autogenerated documentation files from autosummary
docs/api_reference/generated/
# Autogenerated documentation files from sphinx-gallery
docs/autogen_examples/
# sphinx-gallery execution summary
docs/sg_execution_times.rst

## Python project .gitignore file template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -20,6 +29,7 @@ parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -38,14 +48,17 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -55,6 +68,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -67,16 +81,51 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version
# IPython
profile_default/
ipython_config.py

# celery beat schedule file
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -102,3 +151,21 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,19 @@ A quick overview:
- dataplusmeta.py
- a simple way to pack data and essential meta-data into a single text file

- data/
- nrel_mpert/
- module measurements, model parameters and other data in DataPlusMeta style
- data/
- nrel_mpert/
- module measurements, model parameters and other data in DataPlusMeta style

- tests/
- test files for the functions in the main module, to be run with `pytest`

- examples/
- module_efficiency_demo.ipynb
- dataplusmeta_demo.py

- docs/
- sphinx project files and documentation auxiliary files, user guide, etc.

Development status
------------------
Expand Down Expand Up @@ -88,7 +93,7 @@ When referring to this software in either academic or commercial context,
please use a citation similar to the following:

- A. Driesse,
"PV Performance Labs Tools for Python", (2020), GitHub repository, https://github.com/adriesse/pvpltools-python
"PV Performance Labs Tools for Python", (2020), GitHub repository, https://github.com/pvplabs/pvpltools

When referring to specific functions, docs strings or algorithms,
please add specifics to the citation.
Expand All @@ -102,7 +107,7 @@ and compares it to the IEC 61853 efficiency matrix interpolation/extrapolation m

[102]: https://pvpmc.sandia.gov/download/7737/

Additional publications related to the contents of pvpltools-python
Additional publications related to the contents of pvpltools
will be listed here as they become available.


Expand All @@ -123,16 +128,6 @@ parts of which I use very frequently in the context of my work.
Getting help
------------

I expect that most potential users will have sufficient knowledge of github and python
that they will be able successfully clone or download, install and `import pvpltools`.

If that's not you, then:

- click on the green `Clone or download` button and download everything as a zip file
- unzip the contents somewhere on your computer
- add the directory called `pvpltools-python-master` to your python search path
- try `import pvpltools`

The doc strings within the code are currently the primary source of documentation.

Feel free to contact me with questions or suggestions though.
Expand Down
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

6 changes: 6 additions & 0 deletions ci/requirements-py3.10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib
numpy
pandas
pvlib
PyYAML
scipy
6 changes: 6 additions & 0 deletions ci/requirements-py3.11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib
numpy
pandas
pvlib
PyYAML
scipy
6 changes: 6 additions & 0 deletions ci/requirements-py3.12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib
numpy
pandas
pvlib
PyYAML
scipy
6 changes: 6 additions & 0 deletions ci/requirements-py3.13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib
numpy
pandas
pvlib
PyYAML
scipy
6 changes: 6 additions & 0 deletions ci/requirements-py3.7-min.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib==3.5
numpy==1.10
pandas==1.4
pvlib==0.8
PyYAML==3.13
scipy==1.6
6 changes: 6 additions & 0 deletions ci/requirements-py3.7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib
numpy
pandas
pvlib
PyYAML
scipy
6 changes: 6 additions & 0 deletions ci/requirements-py3.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib
numpy
pandas
pvlib
PyYAML
scipy
6 changes: 6 additions & 0 deletions ci/requirements-py3.9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib
numpy
pandas
pvlib
PyYAML
scipy
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
9 changes: 9 additions & 0 deletions docs/api_reference/dataplusmeta.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. py:module:: pvpltools.dataplusmeta
Data + Metadata manipulation utils
==================================

.. autosummary::
:toctree: generated/

DataPlusMeta
14 changes: 14 additions & 0 deletions docs/api_reference/iec61853.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. py:module:: pvpltools.iec61853
IEC61853 Utils
==============

.. autosummary::
:toctree: generated/

convert_to_banded
calc_spectral_factor
BilinearInterpolator
martin_ruiz
martin_ruiz_diffuse
faiman
16 changes: 16 additions & 0 deletions docs/api_reference/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. currentmodule:: pvpltools

.. _api:

=============
API Reference
=============

.. toctree::
:maxdepth: 2
:caption: Contents:

dataplusmeta
iec61853
module_efficiency
power_conversion
17 changes: 17 additions & 0 deletions docs/api_reference/module_efficiency.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. py:module:: pvpltools.module_efficiency
Module efficiency modelling
===========================

.. autosummary::
:toctree: generated/

fit_efficiency_model
adr
heydenreich
motherpv
pvgis
mpm6
mpm5
fit_bilinear
bilinear
12 changes: 12 additions & 0 deletions docs/api_reference/power_conversion.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. py:module:: pvpltools.power_conversion
Power conversion
================

.. autosummary::
:toctree: generated/

adr_converter_core
fit_adr_converter_core
create_cec_matrix_sandia
fit_adr_to_sandia
Loading

0 comments on commit c3e51d4

Please sign in to comment.