Skip to content

Commit 44d6958

Browse files
committed
remove warning if new function is used
1 parent dd01440 commit 44d6958

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pvlib/modelchain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,18 +659,20 @@ def complete_irradiance(self, times=None, weather=None):
659659
"Results can be too high or negative.\n" +
660660
"Help to improve this function on github:\n" +
661661
"https://github.com/pvlib/pvlib-python \n")
662-
warnings.warn(wrn_txt, UserWarning)
662+
663663
if {'ghi', 'dhi'} <= icolumns and 'dni' not in icolumns:
664664
logging.debug('Estimate dni from ghi and dhi')
665665
self.weather.loc[:, 'dni'] = pvlib.irradiance.dni(
666666
self.weather.loc[:, 'ghi'], self.weather.loc[:, 'dhi'],
667667
self.solar_position.loc[:, 'zenith'])
668668
elif {'dni', 'dhi'} <= icolumns and 'ghi' not in icolumns:
669+
warnings.warn(wrn_txt, UserWarning)
669670
logging.debug('Estimate ghi from dni and dhi')
670671
self.weather.loc[:, 'ghi'] = (
671672
self.weather.dni * tools.cosd(self.solar_position.zenith) +
672673
self.weather.dhi)
673674
elif {'dni', 'ghi'} <= icolumns and 'dhi' not in icolumns:
675+
warnings.warn(wrn_txt, UserWarning)
674676
logging.debug('Estimate dhi from dni and ghi')
675677
self.weather.loc[:, 'dhi'] = (
676678
self.weather.ghi - self.weather.dni *

0 commit comments

Comments
 (0)