2323
2424
2525class HistoricalData (AbstractData ):
26- def __init__ (self , spec , historical_data = None ):
26+ def __init__ (self , spec , historical_data = None ):
2727 super ().__init__ (spec = spec , name = "historical_data" , data = historical_data )
2828
2929 def _ingest_data (self , spec ):
3030 try :
3131 self .freq = get_frequency_of_datetime (self .data .index .get_level_values (0 ))
3232 except TypeError as e :
33- logger .warn (
33+ logger .warning (
3434 f"Error determining frequency: { e .args } . Setting Frequency to None"
3535 )
3636 logger .debug (f"Full traceback: { e } " )
@@ -106,7 +106,7 @@ def _ingest_data(self, spec):
106106 _spec = spec
107107 self .additional_regressors = list (self .data .columns )
108108 if not self .additional_regressors :
109- logger .warn (
109+ logger .warning (
110110 f"No additional variables found in the additional_data. Only columns found: { self .data .columns } . Skipping for now."
111111 )
112112 # Check that datetime column matches historical datetime column
@@ -121,7 +121,13 @@ def __init__(self, spec, test_data):
121121
122122
123123class ForecastDatasets :
124- def __init__ (self , config : ForecastOperatorConfig , historical_data = None , additional_data = None , test_data = None ):
124+ def __init__ (
125+ self ,
126+ config : ForecastOperatorConfig ,
127+ historical_data = None ,
128+ additional_data = None ,
129+ test_data = None ,
130+ ):
125131 """Instantiates the DataIO instance.
126132
127133 Properties
@@ -136,7 +142,9 @@ def __init__(self, config: ForecastOperatorConfig, historical_data=None, additio
136142 self ._target_col = config .spec .target_column
137143 if historical_data is not None :
138144 self .historical_data = HistoricalData (config .spec , historical_data )
139- self .additional_data = AdditionalData (config .spec , self .historical_data , additional_data )
145+ self .additional_data = AdditionalData (
146+ config .spec , self .historical_data , additional_data
147+ )
140148 else :
141149 self ._load_data (config .spec )
142150 self .test_data = TestData (config .spec , test_data )
@@ -147,7 +155,7 @@ def _load_data(self, spec):
147155 self .additional_data = AdditionalData (spec , self .historical_data )
148156
149157 if spec .generate_explanations and spec .additional_data is None :
150- logger .warn (
158+ logger .warning (
151159 "Unable to generate explanations as there is no additional data passed in. Either set generate_explanations to False, or pass in additional data."
152160 )
153161 spec .generate_explanations = False
0 commit comments