Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Suggestions from review

Co-authored-by: Kevin Anderson <[email protected]>
  • Loading branch information
cwhanse and kandersolar authored Sep 27, 2024
1 parent 4075739 commit 8cd1fca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
18 changes: 8 additions & 10 deletions docs/examples/snow-detection/snow-mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Mode 2: Indicates periods when the operating voltage is reduced but
current is consistent with snow-free conditions.
* Mode 3: Indicates periods when the operating voltage is consistent with
snow-free conditionss but current is reduced.
snow-free conditions but current is reduced.
* Mode 4: Voltage and current are consistent with snow-free conditions.
* Mode -1: Indicates periods where it is unknown if or how snow impacts
Expand Down Expand Up @@ -93,7 +93,7 @@
print(f"Inverter MPPT range: {mppt_low_voltage} V - {mppt_high_voltage} V")
num_str_per_cb = config['num_str_per_cb']['INV1 CB1']
num_mods_per_str = config['num_mods_per_str']['INV1 CB1']
print(f"There are {num_mods_per_str} modules connected in series in each,"
print(f"There are {num_mods_per_str} modules connected in series in each"
f" string and there are {num_str_per_cb} strings connected in"
f" parallel at each combiner")

Expand Down Expand Up @@ -207,10 +207,11 @@
# %%
# We want to exclude periods where array voltage is affected by horizon
# shading. Load in and apply horizon profiling created using approach described
# in [1].
# [1] J. L. Braid and B. G. Pierce, "Horizon Profiling Methods for Photovoltaic
# Arrays," 2023 IEEE 50th Photovoltaic Specialists Conference (PVSC),
# San Juan, PR, USA, 2023, pp. 1-7. doi:`10.1109/PVSC48320.2023.10359914`
# in [1]_.
#
# .. [1] J. L. Braid and B. G. Pierce, "Horizon Profiling Methods for Photovoltaic
# Arrays," 2023 IEEE 50th Photovoltaic Specialists Conference (PVSC),
# San Juan, PR, USA, 2023, pp. 1-7. :doi:`10.1109/PVSC48320.2023.10359914`

horizon = pd.read_csv(horizon_file, index_col='Unnamed: 0').squeeze("columns")

Expand All @@ -234,7 +235,6 @@
data = data[data['Horizon Mask']]

# %%

# Define coefficients for modeling transmission and voltage. User can either
# use the SAPM to calculate transmission or an approach based on the ratio
# between measured current and nameplate current. For modeling voltage, the
Expand All @@ -245,9 +245,7 @@
sde_coeffs = cec_module_db[config['panel']]

# %%
"""
Model cell temperature using the SAPM model.
"""
# Model cell temperature using the SAPM model.

irrad_ref = 1000
data['Cell Temp [C]'] = pvlib.temperature.sapm_cell_from_module(
Expand Down
4 changes: 2 additions & 2 deletions pvanalytics/features/snow.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ def get_irradiance_sapm(temp_cell, i_mp, imp0, c0, c1, alpha_imp,
irradiance.
alpha_imp : float
Normalized temperature coefficient for short-circuit current. [1/°C]
irrad_ref : float
irrad_ref : float, default 1000
Reference irradiance. [W/m2]
temp_ref : float
temp_ref : float, default 25
Reference cell temperature. [degrees C]
Returns
Expand Down

0 comments on commit 8cd1fca

Please sign in to comment.