Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kempe standoff #43

Merged
merged 61 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
277eda3
Reworking of the standoff calculations
MDKempe Dec 27, 2023
a90a16d
standard updates
shirubana Dec 27, 2023
8343bec
Update weather.py
MDKempe Dec 27, 2023
eda68d2
updates to the standoff calculation
Dec 28, 2023
ffb6186
Update xeff_demo.csv
MDKempe Jan 3, 2024
9a98da7
Update standards.py
MDKempe Jan 3, 2024
c3730e3
Create xeff_demo.xlsx
MDKempe Jan 3, 2024
20bac61
Adding calculations to the file
MDKempe Jan 3, 2024
079e21e
Update 4 - Standards.py
MDKempe Jan 3, 2024
37882ba
Update weather.py
MDKempe Jan 3, 2024
b10d37e
Update standards.py
MDKempe Jan 3, 2024
1837f73
Update weather.py
MDKempe Jan 3, 2024
2e109f0
Update weather.py
MDKempe Jan 3, 2024
bb4f736
Update weather.py
MDKempe Jan 3, 2024
d51294e
Update weather.py
MDKempe Jan 3, 2024
b1238c5
Update weather.py
MDKempe Jan 3, 2024
f065a7f
Update weather.py
MDKempe Jan 3, 2024
c876f31
Update weather.py
MDKempe Jan 3, 2024
45b1a34
Update weather.py
MDKempe Jan 4, 2024
be70174
Update 4 - Standards.ipynb
MDKempe Jan 4, 2024
734e0d6
standards
shirubana Jan 4, 2024
f61e03b
Update xeff_demo.csv
MDKempe Jan 10, 2024
8e0568a
Update xeff_demo.xlsx
MDKempe Jan 10, 2024
81db018
Update xeff_demo.csv
Jan 11, 2024
d12300e
Update xeff_demo.xlsx
Jan 11, 2024
a547b2f
Update utilities.py
Jan 11, 2024
48e5632
Massive changes and a stopping point
Jan 11, 2024
0b9d138
Update spectral.py
Jan 11, 2024
7b310b6
Update temperature.py
Jan 11, 2024
59e501b
Update standards.py
Jan 11, 2024
828b945
improvement on temperature windspeedfactor fix
shirubana Jan 18, 2024
3e09f23
dding pytest coverage instructions
shirubana Jan 18, 2024
4ce8040
Wind height added
MDKempe Jan 22, 2024
d44698d
Update weather.py
Jan 22, 2024
5895169
Update weather.py
MDKempe Jan 23, 2024
28afc77
Update standards.py
MDKempe Jan 23, 2024
0eed5f0
Update temperature.py
MDKempe Jan 23, 2024
bb66e97
Update temperature.py
MDKempe Jan 23, 2024
233452f
Update standards.py
MDKempe Jan 23, 2024
bc382d3
Update 4 - Standards.ipynb
MDKempe Jan 23, 2024
0a9a3a0
Update temperature.py
MDKempe Jan 23, 2024
8e27de0
Update 4 - Standards.ipynb
MDKempe Jan 23, 2024
906a1b6
Update fatigue.py
MDKempe Jan 23, 2024
b1c6ab6
Update test_fatigue.py
MDKempe Jan 23, 2024
e2fa285
Update humidity.py
MDKempe Jan 24, 2024
4860938
Update h5_pytest.h5
MDKempe Jan 24, 2024
35cfc0e
Update meta.json
MDKempe Jan 24, 2024
c97ff12
Update test_humidity.py
MDKempe Jan 24, 2024
24afef1
Update test_standards.py
MDKempe Jan 24, 2024
b1b2083
Update test_temperature.py
MDKempe Jan 24, 2024
8f6d478
Update standards.py
MDKempe Jan 24, 2024
c9f8fb5
Update standards.py
MDKempe Jan 30, 2024
14e7245
Update weather.py
MDKempe Jan 30, 2024
9d2b2f0
Update standards.py
MDKempe Jan 30, 2024
84ab262
Update 4 - Standards.ipynb
MDKempe Jan 30, 2024
1ffef28
Update standards.py
MDKempe Jan 31, 2024
8a380ed
Update 4 - Standards.ipynb
MDKempe Jan 31, 2024
4586e8d
Update temperature.py
MDKempe Jan 31, 2024
b196d42
run pre-commit hooks
martin-springer Jan 31, 2024
4992471
revert changes in h5_pytest.h5
martin-springer Jan 31, 2024
19e0f6f
update docs conf from main
martin-springer Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
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@v4
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@v3
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@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v1.2.3
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/pvdeg

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
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: v3.2.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
11 changes: 6 additions & 5 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@

sys.path.insert(0, os.path.abspath("../../.."))

import pvdeg

# -- Project information -----------------------------------------------------

project = 'pvdeg'
copyright = '2023, NREL'
author = 'Alliance for Sustainable Energy, LLC'
# -- Project information -----------------------------------------------------

import pvdeg
project = "pvdeg"
copyright = "2023, NREL"
author = "Alliance for Sustainable Energy, LLC"
version = pvdeg.__version__


# -- General configuration ---------------------------------------------------
Expand Down
17,526 changes: 8,763 additions & 8,763 deletions pvdeg/data/psm3.csv

Large diffs are not rendered by default.

8,763 changes: 8,763 additions & 0 deletions pvdeg/data/xeff_demo.csv

Large diffs are not rendered by default.

Binary file added pvdeg/data/xeff_demo.xlsx
Binary file not shown.
12 changes: 11 additions & 1 deletion pvdeg/fatigue.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def solder_fatigue(
b=0.33,
C1=405.6,
Q=0.12,
wind_factor=None,
):
"""
Get the Thermomechanical Fatigue of flat plate photovoltaic module solder joints.
Expand All @@ -127,6 +128,13 @@ def solder_fatigue(
Must contain dni, dhi, ghi, temp_air, windspeed, and datetime index
meta : dict
site location meta-data
wind_factor : float, optional
Wind speed correction exponent to account for different wind speed measurement heights
between weather database (e.g. NSRDB) and the tempeature model (e.g. SAPM)
The NSRDB provides calculations at 2 m (i.e module height) but SAPM uses a 10 m height.
It is recommended that a power-law relationship between height and wind speed of 0.33
be used. This results in a wind speed that is 1.7 times higher. It is acknowledged that
this can vary significantly.
time_range : timestamp series, optional
Local time of specific site by the hour year-month-day hr:min:sec
(Example) 2002-01-01 01:00:00
Expand Down Expand Up @@ -169,7 +177,9 @@ def solder_fatigue(
time_range = weather_df.index

if temp_cell is None:
temp_cell = temperature.cell(weather_df, meta)
temp_cell = temperature.cell(
weather_df=weather_df, meta=meta, wind_factor=wind_factor
)

temp_amplitude, temp_max_avg = _avg_daily_temp_change(time_range, temp_cell)

Expand Down
22 changes: 13 additions & 9 deletions pvdeg/humidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,13 @@ def module(
azimuth=180,
sky_model="isotropic",
temp_model="sapm",
mount_type="open_rack_glass_glass",
conf="open_rack_glass_glass",
WVTRo=7970633554,
EaWVTR=55.0255,
So=1.81390702,
l=0.5,
Eas=16.729,
wind_speed_factor=1,
wind_factor=0.33,
):
"""Calculate the Relative Humidity of solar module backsheet from timeseries data.

Expand Down Expand Up @@ -701,9 +701,13 @@ def module(
Eas : float
Encapsulant solubility activation energy in [kJ/mol]
Eas = 16.729(kJ/mol) is the suggested value for EVA.
wind_speed_factor : float, optional
Wind speed correction factor to account for different wind speed measurement heights
wind_factor : float, optional
Wind speed correction exponent to account for different wind speed measurement heights
between weather database (e.g. NSRDB) and the tempeature model (e.g. SAPM)
The NSRDB provides calculations at 2 m (i.e module height) but SAPM uses a 10 m height.
It is recommended that a power-law relationship between height and wind speed of 0.33
be used. This results in a wind speed that is 1.7 times higher. It is acknowledged that
this can vary significantly.

Returns
--------
Expand All @@ -713,7 +717,7 @@ def module(

# solar_position = spectral.solar_position(weather_df, meta)
# poa = spectral.poa_irradiance(weather_df, meta, solar_position, tilt, azimuth, sky_model)
# temp_module = temperature.module(weather_df, poa, temp_model, mount_type, wind_speed_factor)
# temp_module = temperature.module(weather_df, poa, temp_model, mount_type, wind_factor)

poa = spectral.poa_irradiance(
weather_df=weather_df,
Expand All @@ -728,8 +732,8 @@ def module(
meta,
poa=poa,
temp_model=temp_model,
conf=mount_type,
wind_speed_factor=wind_speed_factor,
conf=conf,
wind_factor=wind_factor,
)

rh_surface_outside = surface_outside(
Expand Down Expand Up @@ -789,7 +793,7 @@ def module(
# So=1.81390702,
# l=0.5,
# Eas=16.729,
# wind_speed_factor=1
# wind_factor=1
# ):

# """Run the relative humidity calculation for a set of project points."""
Expand Down Expand Up @@ -860,7 +864,7 @@ def module(
# So,
# l,
# Eas,
# wind_speed_factor
# wind_factor
# )
# future_to_point[future] = gid

Expand Down
9 changes: 7 additions & 2 deletions pvdeg/spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def solar_position(weather_df, meta):


def poa_irradiance(
weather_df, meta, sol_position=None, tilt=None, azimuth=180, sky_model="isotropic"
weather_df, meta, sol_position=None, tilt=None, azimuth=None, sky_model="isotropic"
):
"""
Calculate plane-of-array (POA) irradiance using pvlib based on weather data from the
Expand All @@ -60,7 +60,7 @@ def poa_irradiance(
The tilt angle of the PV panels in degrees, if None, the latitude of the
location is used.
azimuth : float, optional
The azimuth angle of the PV panels in degrees, 180 by default - facing south.
The azimuth angle of the PV panels in degrees. Equatorial facing by default.
sky_model : str, optional
The pvlib sky model to use, 'isotropic' by default.

Expand All @@ -74,6 +74,11 @@ def poa_irradiance(
# TODO: change for handling HSAT tracking passed or requested
if tilt is None:
tilt = float(meta["latitude"])
if azimuth is None: # Sets the default orientation to equator facing.
if float(meta["latitude"]) < 0:
azimuth = 0
else:
azimuth = 180

if sol_position is None:
sol_position = solar_position(weather_df, meta)
Expand Down
Loading
Loading