@@ -674,18 +674,20 @@ def complete_irradiance(self, times=None, weather=None):
674
674
"Results can be too high or negative.\n " +
675
675
"Help to improve this function on github:\n " +
676
676
"https://github.com/pvlib/pvlib-python \n " )
677
- warnings . warn ( wrn_txt , UserWarning )
677
+
678
678
if {'ghi' , 'dhi' } <= icolumns and 'dni' not in icolumns :
679
679
logging .debug ('Estimate dni from ghi and dhi' )
680
680
self .weather .loc [:, 'dni' ] = pvlib .irradiance .dni (
681
681
self .weather .loc [:, 'ghi' ], self .weather .loc [:, 'dhi' ],
682
682
self .solar_position .loc [:, 'zenith' ])
683
683
elif {'dni' , 'dhi' } <= icolumns and 'ghi' not in icolumns :
684
+ warnings .warn (wrn_txt , UserWarning )
684
685
logging .debug ('Estimate ghi from dni and dhi' )
685
686
self .weather .loc [:, 'ghi' ] = (
686
687
self .weather .dni * tools .cosd (self .solar_position .zenith ) +
687
688
self .weather .dhi )
688
689
elif {'dni' , 'ghi' } <= icolumns and 'dhi' not in icolumns :
690
+ warnings .warn (wrn_txt , UserWarning )
689
691
logging .debug ('Estimate dhi from dni and ghi' )
690
692
self .weather .loc [:, 'dhi' ] = (
691
693
self .weather .ghi - self .weather .dni *
0 commit comments