detquantlib 5.1.1__tar.gz → 5.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {detquantlib-5.1.1 → detquantlib-5.1.2}/PKG-INFO +1 -1
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/data/databases/detdatabase.py +32 -17
- {detquantlib-5.1.1 → detquantlib-5.1.2}/pyproject.toml +1 -1
- {detquantlib-5.1.1 → detquantlib-5.1.2}/LICENSE.txt +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/README.md +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/assets/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/assets/battery.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/assets/wind_turbine.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/converters/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/converters/definitions.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/converters/energy.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/converters/helpers.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/converters/price.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/data/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/data/databases/helpers.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/data/entsoe/entsoe.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/data/sftp/sftp.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/dates/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/dates/dates.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/figures/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/figures/plotly_figures.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/forecasting/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/forecasting/forecasting.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/outputs/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/outputs/outputs_interface.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/stats/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/stats/data_analysis.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/tradable_products/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/tradable_products/tradable_products.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/utils/__init__.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/utils/logging.py +0 -0
- {detquantlib-5.1.1 → detquantlib-5.1.2}/detquantlib/utils/utils.py +0 -0
|
@@ -878,15 +878,20 @@ class DetDatabase:
|
|
|
878
878
|
Args:
|
|
879
879
|
profile: Customer/profile name.
|
|
880
880
|
Note on the 'Portfolio' and 'Portfolioweekend' profiles:
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
881
|
+
- [Legacy data until March 2026]:
|
|
882
|
+
- Profile names 'Portfolio' and 'Portfolioweekend' refer to the same set
|
|
883
|
+
of connection points.
|
|
884
|
+
- In the database, the profile name is set to 'Portfolio' when the
|
|
885
|
+
forecast date is between Monday and Friday.
|
|
886
|
+
- In the database, the profile name is set to 'Portfolioweekend' when
|
|
887
|
+
the forecast date is Saturday or Sunday.
|
|
888
|
+
- [Data since March 2026]:
|
|
889
|
+
- The 'Portfolioweekend' name is deprecated. Day-ahead forecasts are
|
|
890
|
+
now stored under the 'Portfolio' profile only.
|
|
891
|
+
- When calling this method, set the input argument 'profile' to
|
|
892
|
+
'PortfolioAll' to automatically switch between 'Portfolio' and
|
|
893
|
+
'Portfolioweekend', based on the used-input forecast date.
|
|
894
|
+
'PortfolioAll' supports both the legacy and new data structure.
|
|
890
895
|
forecast_date: Date on which customer volume forecast is generated.
|
|
891
896
|
start_delivery_date: First delivery date included.
|
|
892
897
|
end_delivery_date: Last delivery date included.
|
|
@@ -902,13 +907,6 @@ class DetDatabase:
|
|
|
902
907
|
Raises:
|
|
903
908
|
ValueError: Raises an error if no volume forecast data is found for user inputs.
|
|
904
909
|
"""
|
|
905
|
-
# Convert profile if set to "PortfolioAll"
|
|
906
|
-
if profile == "PortfolioAll":
|
|
907
|
-
if forecast_date.weekday() > 4:
|
|
908
|
-
profile = "Portfolioweekend"
|
|
909
|
-
else:
|
|
910
|
-
profile = "Portfolio"
|
|
911
|
-
|
|
912
910
|
# Convert start delivery date from local timezone to UTC and string
|
|
913
911
|
start_delivery_date = start_delivery_date.replace(tzinfo=ZoneInfo(local_timezone))
|
|
914
912
|
start_delivery_date = start_delivery_date.astimezone(ZoneInfo("UTC"))
|
|
@@ -930,17 +928,34 @@ class DetDatabase:
|
|
|
930
928
|
# Convert dates from datetime to string
|
|
931
929
|
forecast_date_str = forecast_date.strftime("%Y-%m-%d")
|
|
932
930
|
|
|
931
|
+
# Define query profile name. If 'PortfolioAll', first try with 'Portfolio' (compatibility
|
|
932
|
+
# with new data).
|
|
933
|
+
query_profile = "Portfolio" if profile == "PortfolioAll" else profile
|
|
934
|
+
|
|
933
935
|
# Query db
|
|
934
936
|
table = DetDatabase.get_table_name("client_volume_forecast")
|
|
935
937
|
query = (
|
|
936
938
|
f"SELECT {columns_str} FROM {table} "
|
|
937
|
-
f"WHERE Profile='{
|
|
939
|
+
f"WHERE Profile='{query_profile}' "
|
|
938
940
|
f"AND ForecastDate='{forecast_date_str}' "
|
|
939
941
|
f"AND Datetime>='{start_date_str}' "
|
|
940
942
|
f"AND Datetime<'{end_date_str}'"
|
|
941
943
|
)
|
|
942
944
|
df = self.query_db(query)
|
|
943
945
|
|
|
946
|
+
if profile == "PortfolioAll" and df.empty and forecast_date.weekday() > 4:
|
|
947
|
+
# If 'Portfolio' not found, try with 'Portfolioweekend' (backward compatibility with
|
|
948
|
+
# legacy data)
|
|
949
|
+
query_profile = "Portfolioweekend"
|
|
950
|
+
query = (
|
|
951
|
+
f"SELECT {columns_str} FROM {table} "
|
|
952
|
+
f"WHERE Profile='{query_profile}' "
|
|
953
|
+
f"AND ForecastDate='{forecast_date_str}' "
|
|
954
|
+
f"AND Datetime>='{start_date_str}' "
|
|
955
|
+
f"AND Datetime<'{end_date_str}'"
|
|
956
|
+
)
|
|
957
|
+
df = self.query_db(query)
|
|
958
|
+
|
|
944
959
|
# Assert data
|
|
945
960
|
if df.empty:
|
|
946
961
|
raise ValueError("No volume forecast data found for user-defined inputs.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|