Skip to content

Commit 2333152

Browse files
fix(KDP): removing print and replacing by logger
1 parent 849a982 commit 2333152

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

kdp/layers/time_series/calendar_feature_layer.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import tensorflow as tf
22
from tensorflow.keras.layers import Layer
33
import numpy as np
4+
from loguru import logger
45
import 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:

0 commit comments

Comments
 (0)