-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix run_model_from_effective_irradiance with iterable weather and excluding cell temperature #1165
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0eea3a1
check for complete poa in _set_celltemp
cwhanse 27ed23a
test for new location of ValueError, add test for run_from_eff_irrad …
cwhanse 94ca106
handle single data/arrays, fix test
cwhanse 2d20a38
remove old test
cwhanse aa750e1
add _verify_df to run_from_effective_irradiance
cwhanse df5b8fd
remove ValueError from _set_celltemp
cwhanse 00eb76f
test for single, list tuple
cwhanse a3aa924
edits from review
cwhanse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -985,26 +985,46 @@ def test_run_model_from_poa_tracking(sapm_dc_snl_ac_system, location, | |||||
assert_series_equal(ac, expected) | ||||||
|
||||||
|
||||||
@pytest.mark.parametrize("input_type", [lambda x: x[0], tuple, list]) | ||||||
def test_run_model_from_effective_irradiance(sapm_dc_snl_ac_system, location, | ||||||
weather, total_irrad): | ||||||
weather, total_irrad, input_type): | ||||||
data = weather.copy() | ||||||
data[['poa_global', 'poa_diffuse', 'poa_direct']] = total_irrad | ||||||
data['effective_irradiance'] = data['poa_global'] | ||||||
mc = ModelChain(sapm_dc_snl_ac_system, location, aoi_model='no_loss', | ||||||
spectral_model='no_loss') | ||||||
ac = mc.run_model_from_effective_irradiance(data).results.ac | ||||||
ac = mc.run_model_from_effective_irradiance(input_type((data,))).results.ac | ||||||
expected = pd.Series(np.array([149.280238, 96.678385]), | ||||||
index=data.index) | ||||||
assert_series_equal(ac, expected) | ||||||
# check with data as an iterable of length 1 | ||||||
mc.run_model_from_effective_irradiance(input_type((data,))) | ||||||
|
# check with data as an iterable of length 1 | |
mc.run_model_from_effective_irradiance(input_type((data,))) |
Outdated
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.
Suggested change
def test_run_model_from_effective_irradiance_input_type( | |
def test_run_model_from_effective_irradiance_multi_array( |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.