@@ -286,7 +286,8 @@ def orientation_strategy(self, strategy):
286
286
287
287
def prepare_inputs (self , times , irradiance = None , weather = None ):
288
288
"""
289
- Run the model.
289
+ Prepare the solar position, irradiance, and weather inputs to
290
+ the model.
290
291
291
292
Parameters
292
293
----------
@@ -368,6 +369,7 @@ def run_model(self):
368
369
"""
369
370
A stub function meant to be subclassed.
370
371
"""
372
+
371
373
raise NotImplementedError (
372
374
'you must subclass ModelChain and implement this method' )
373
375
@@ -376,20 +378,31 @@ class SAPM(ModelChain):
376
378
"""
377
379
Uses the SAPM to calculate cell temperature, DC power and AC power.
378
380
"""
379
- def run_model (self ):
381
+ def run_model (self , times , irradiance = None , weather = None ):
380
382
"""
381
383
Run the model.
382
384
383
385
Parameters
384
386
----------
387
+ times : DatetimeIndex
388
+ Times at which to evaluate the model.
389
+
390
+ irradiance : None or DataFrame
391
+ If None, calculates clear sky data.
392
+ Columns must be 'dni', 'ghi', 'dhi'.
393
+
394
+ weather : None or DataFrame
395
+ If None, assumes air temperature is 20 C and
396
+ wind speed is 0 m/s.
397
+ Columns must be 'wind_speed', 'temp_air'.
385
398
386
399
Returns
387
400
-------
388
401
self
389
402
390
403
Assigns attributes: temps, dc, ac
391
404
"""
392
-
405
+ self . prepare_inputs ( times , irradiance , weather )
393
406
394
407
self .temps = self .system .sapm_celltemp (self .total_irrad ['poa_global' ],
395
408
self .weather ['wind_speed' ],
@@ -414,12 +427,23 @@ class SingleDiode(ModelChain):
414
427
and the SAPM models to calculate cell temperature and AC power.
415
428
"""
416
429
417
- def run_model (self ):
430
+ def run_model (self , times , irradiance = None , weather = None ):
418
431
"""
419
432
Run the model.
420
433
421
434
Parameters
422
435
----------
436
+ times : DatetimeIndex
437
+ Times at which to evaluate the model.
438
+
439
+ irradiance : None or DataFrame
440
+ If None, calculates clear sky data.
441
+ Columns must be 'dni', 'ghi', 'dhi'.
442
+
443
+ weather : None or DataFrame
444
+ If None, assumes air temperature is 20 C and
445
+ wind speed is 0 m/s.
446
+ Columns must be 'wind_speed', 'temp_air'.
423
447
424
448
Returns
425
449
-------
@@ -428,6 +452,7 @@ def run_model(self):
428
452
Assigns attributes: temps, dc, ac
429
453
"""
430
454
455
+ self .prepare_inputs (times , irradiance , weather )
431
456
432
457
self .temps = self .system .sapm_celltemp (self .total_irrad ['poa_global' ],
433
458
self .weather ['wind_speed' ],
0 commit comments