-
Notifications
You must be signed in to change notification settings - Fork 28
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
Code and example for classifying snow effects #209
base: main
Are you sure you want to change the base?
Conversation
@kandersolar @kperrynrel I think we're far enough along for a first review, if you have time and interest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rather large PR! Here is a partial review of just the gallery example, for now.
print(f"There are {num_str_per_cb} modules connected in series in each string," | ||
f" and there are {num_mods_per_str} strings connected in" | ||
f" parallel at each combiner") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The positions of these interpolated variables need to be swapped with each other, I think.
data.loc[:, dc_voltage_cols] = np.maximum(data[dc_voltage_cols], 0) | ||
data.loc[:, dc_current_cols] = np.maximum(data[dc_current_cols], 0) | ||
data.loc[:, ac_power_cols] = np.maximum(data[ac_power_cols], 0) | ||
|
||
data[dc_voltage_cols] = data[dc_voltage_cols].replace({np.nan: 0, None: 0}) | ||
data[dc_current_cols] = data[dc_current_cols].replace({np.nan: 0, None: 0}) | ||
data.loc[:, ac_power_cols] = data[ac_power_cols].replace({np.nan: 0, None: 0}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all four of these .loc[:, ]
are unnecessary. I suggest also just using .fillna(0)
instead of replace()
. It should work on both None and nan.
print('End: {}'.format(data.index[-1])) | ||
print('Frequency: {}'.format(data.index.inferred_freq)) | ||
print('Columns : ' + ', '.join(data.columns)) | ||
data.between_time('8:00', '16:00').head() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line doesn't have any effect
# Plot DC voltage for each combiner input relative to inverter nameplate | ||
# limits | ||
|
||
fig, ax = plt.subplots(figsize=(10, 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these 10x10 figures throughout this file are a bit taller than they need to be. Maybe 6 or 7 instead of 10? fig.tight_layout()
would help too.
|
||
# %% | ||
# Plot DC voltage for each combiner input relative to inverter nameplate | ||
# limits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some explanation of why we are doing this would be helpful. Are we searching for values outside the inverter MPPT range? Why are those worth looking for? And same for the power plot -- what is it supposed to be telling us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some explanation - we're looking for DC voltages below the inverter's turn-on voltage because these values are recorded outside of MPP operating conditions, and therefore cannot be used in an apples-to-apples comparison with modeled MPP voltage. Similar deal with AC power, except we're looking for periods of clipping. These get put in the Mode -1 bucket later.
|
||
# We want to exclude periods where array voltage is affected by horizon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this blank line for the text to be rendered as text instead of a code comment block
fig, ax = plt.subplots() | ||
ax.scatter(data['azimuth'], data['elevation'], s=0.5, label='data', | ||
c=data['Horizon Mask']) | ||
ax.scatter(horizon.index, horizon, s=0.5, label='mask') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is an artifact of how the horizon profile is estimated - as there is no data below the solar elevation curve, there is no way to determine what the horizon actually looks like in this region.
ax.legend(loc='lower left') | ||
plt.show() | ||
|
||
# %% Plot AC power relative to inverter nameplate limits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like text on the same line as # %%
doesn't get rendered in the HTML. Better to move the text to the next line. Note that there are several instances of this to fix in this file.
docs/api.rst
.in
docs/whatsnew
for all changes. Includes link to the GitHub Issue with
:issue:`num`
or this Pull Request with
:pull:`num`
. Includes contributor nameand/or GitHub username (link with
:ghuser:`user`
).