fix(utils): remove month
Browse files
utils.py
CHANGED
|
@@ -121,10 +121,7 @@ def create_timestamp_from_predictions(predictions, sensor_timestamp=None):
|
|
| 121 |
try:
|
| 122 |
hour = predictions.get("hour", 0)
|
| 123 |
dayofyear = predictions.get("dayofyear", 1)
|
| 124 |
-
month = predictions.get("month", 1)
|
| 125 |
|
| 126 |
-
# Create a date from dayofyear
|
| 127 |
-
# Get the year from the input sensor timestamp
|
| 128 |
if sensor_timestamp:
|
| 129 |
if isinstance(sensor_timestamp, str):
|
| 130 |
input_dt = datetime.fromisoformat(
|
|
@@ -136,7 +133,6 @@ def create_timestamp_from_predictions(predictions, sensor_timestamp=None):
|
|
| 136 |
else:
|
| 137 |
year = datetime.now().year
|
| 138 |
|
| 139 |
-
# Create datetime from day of year and hour
|
| 140 |
predicted_dt = datetime.strptime(f"{year}-{dayofyear}", "%Y-%j")
|
| 141 |
predicted_dt = predicted_dt.replace(hour=hour, minute=0, second=0)
|
| 142 |
|
|
|
|
| 121 |
try:
|
| 122 |
hour = predictions.get("hour", 0)
|
| 123 |
dayofyear = predictions.get("dayofyear", 1)
|
|
|
|
| 124 |
|
|
|
|
|
|
|
| 125 |
if sensor_timestamp:
|
| 126 |
if isinstance(sensor_timestamp, str):
|
| 127 |
input_dt = datetime.fromisoformat(
|
|
|
|
| 133 |
else:
|
| 134 |
year = datetime.now().year
|
| 135 |
|
|
|
|
| 136 |
predicted_dt = datetime.strptime(f"{year}-{dayofyear}", "%Y-%j")
|
| 137 |
predicted_dt = predicted_dt.replace(hour=hour, minute=0, second=0)
|
| 138 |
|