Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9f97e50
try to use weather DataFrame for irradiance if irradiance DataFrame i…
uvchik Sep 1, 2016
d99ee18
try to determine missing columns of the irradiance DataFrame
uvchik Sep 1, 2016
0c83199
remove prepare_irradiance call from run_model
uvchik Sep 8, 2016
9ffa138
replace irradiance DF with weather DF without breaking the API
uvchik Sep 8, 2016
2aae90c
add future warning
uvchik Sep 8, 2016
326dc11
add error if irradiation data is incomplete
uvchik Sep 8, 2016
f1e17ee
rename method
uvchik Sep 8, 2016
933e57b
replace non existing function with set set comparison
uvchik Sep 8, 2016
00e0e72
fix assigned attributes in the docstring
uvchik Sep 8, 2016
0abdde4
fix self.weather assignment
uvchik Sep 8, 2016
ec5ed5f
fix layout
uvchik Sep 8, 2016
ecf6c6d
Merge branch 'master' of https://github.com/pvlib/pvlib-python
uvchik Sep 13, 2016
9e54af7
Merge branch 'master' of https://github.com/pvlib/pvlib-python
uvchik Oct 12, 2016
4d8feaf
change existing tests to new API
uvchik Oct 13, 2016
c572a07
add new tests
uvchik Oct 13, 2016
9dac5cf
add columns or update columns of existing weather data
uvchik Oct 13, 2016
7fda218
add attributes to class
uvchik Oct 13, 2016
7e0b626
adapt docstrings
uvchik Oct 13, 2016
300678c
make time an optional argument if self.times is already set
uvchik Oct 13, 2016
c74f977
complete temporary version (beta) of "complete_irradiance"
uvchik Oct 13, 2016
ef5520e
remove duplicate import
uvchik Oct 14, 2016
dfe04b1
update docstring
uvchik Oct 14, 2016
b691358
fix typo
Oct 17, 2016
5f8ce92
add deprecated parameter to docstring
Oct 17, 2016
1bff19f
set default self.weather to None instead of empty DataFrame
Oct 17, 2016
721743d
fix typos, layout changes
Oct 17, 2016
6a1a61d
avoid mutation of input data (irradiance)
Oct 17, 2016
f702c73
overwrite self.weather completly with its parameter instead of column…
Oct 17, 2016
82a4366
add more IDE config files to gitignore
Oct 17, 2016
34166c8
add whatsnew entry
Oct 17, 2016
9ff9fe4
copy doctstring changes to run_model method
Oct 17, 2016
76d89c3
make parameters optional if attributes are already set
Oct 17, 2016
a63a48f
add example to docstring (not working and excluded from doctest)
uvchik Oct 18, 2016
6097d75
return self and describe it in the docstring
uvchik Oct 18, 2016
da8076d
add bug fix to whatsnew
uvchik Oct 18, 2016
d4ff364
add empty DataFrame directly to avoid if clauses
uvchik Oct 18, 2016
bfb2350
make error message clearer
uvchik Oct 18, 2016
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
Prev Previous commit
Next Next commit
add empty DataFrame directly to avoid if clauses
  • Loading branch information
uvchik committed Oct 18, 2016
commit d4ff3647c4fa4d3fd3f2b5b7512741fe18f5d1b3
14 changes: 3 additions & 11 deletions 14 pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,10 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None):

Assigns attributes: times, solar_position, airmass, total_irrad, aoi
"""
# Add columns that does not exist and overwrite existing columns
# Maybe there is a more elegant way to do this. Any ideas?
if weather is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be best for pvlib to only use a simple assignment. Users can do this in their own code before passing the parameter or making the assignment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.weather = weather
if self.weather is None:
self.weather = pd.DataFrame()

# The following part could be removed together with the irradiance
# parameter at version v0.5 or v0.6.
Expand All @@ -735,15 +735,7 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None):
self.aoi = self.system.get_aoi(self.solar_position['apparent_zenith'],
self.solar_position['azimuth'])

use_clearsky = False
if self.weather is None:
use_clearsky = True
self.weather = pd.DataFrame()
else:
if not any([x in ['ghi', 'dni', 'dhi'] for x in self.weather.columns]):
use_clearsky = True

if use_clearsky:
if not any([x in ['ghi', 'dni', 'dhi'] for x in self.weather.columns]):
self.weather[['ghi', 'dni', 'dhi']] = self.location.get_clearsky(
self.solar_position.index, self.clearsky_model,
zenith_data=self.solar_position['apparent_zenith'],
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.