File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 11import tensorflow as tf
22from tensorflow .keras .layers import Layer
33import numpy as np
4+ from loguru import logger
45import pandas as pd
56
67
@@ -157,23 +158,16 @@ def extract_calendar_features(date_inputs):
157158 if len (date_inputs .shape ) == 2 and date_inputs .shape [1 ] == 1 :
158159 date_inputs = date_inputs .reshape (- 1 )
159160
160- # Print debug info
161- print (f"Date inputs type: { type (date_inputs )} , dtype: { date_inputs .dtype } " )
162- if len (date_inputs ) > 0 :
163- print (
164- f"First element type: { type (date_inputs [0 ])} , value: { date_inputs [0 ]} "
165- )
166-
167161 # Convert to pandas datetime
168162 try :
169163 dates = pd .to_datetime (date_inputs , format = self .input_format )
170164 except (ValueError , TypeError ) as e :
171- print (f"First conversion attempt failed: { e } " )
165+ logger . debug (f"First conversion attempt failed: { e } " )
172166 try :
173167 # Try without specific format if the initial conversion fails
174168 dates = pd .to_datetime (date_inputs )
175169 except (ValueError , TypeError ) as e2 :
176- print (f"Second conversion attempt failed: { e2 } " )
170+ logger . debug (f"Second conversion attempt failed: { e2 } " )
177171 # Last resort: try to clean the strings and convert
178172 cleaned_inputs = []
179173 for d in date_inputs :
You can’t perform that action at this time.
0 commit comments