detquantlib 3.10.2__tar.gz → 3.10.3__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-3.10.2 → detquantlib-3.10.3}/PKG-INFO +1 -1
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/tradable_products/tradable_products.py +7 -3
- {detquantlib-3.10.2 → detquantlib-3.10.3}/pyproject.toml +1 -1
- {detquantlib-3.10.2 → detquantlib-3.10.3}/LICENSE.txt +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/README.md +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/__init__.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/data/__init__.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/data/databases/detdatabase.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/data/entsoe/entsoe.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/data/sftp/sftp.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/dates/__init__.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/dates/dates.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/figures/__init__.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/figures/plotly_figures.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/outputs/__init__.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/outputs/outputs_interface.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/stats/__init__.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/stats/data_analysis.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/tradable_products/__init__.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/utils/__init__.py +0 -0
- {detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/utils/utils.py +0 -0
{detquantlib-3.10.2 → detquantlib-3.10.3}/detquantlib/tradable_products/tradable_products.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Python built-in packages
|
|
2
2
|
import math
|
|
3
|
-
from datetime import datetime
|
|
3
|
+
from datetime import datetime, time
|
|
4
4
|
from typing import Literal
|
|
5
5
|
|
|
6
6
|
# Third-party packages
|
|
@@ -35,14 +35,18 @@ def convert_delivery_start_date_to_maturity(
|
|
|
35
35
|
# Make input product string lower case only
|
|
36
36
|
product = product.lower()
|
|
37
37
|
|
|
38
|
+
# Set trading date and delivery date to midnight
|
|
39
|
+
trading_date = datetime.combine(trading_date, time())
|
|
40
|
+
delivery_start_date = datetime.combine(delivery_start_date, time())
|
|
41
|
+
|
|
38
42
|
if product == "day":
|
|
39
43
|
maturity = (delivery_start_date - trading_date).days
|
|
40
44
|
|
|
41
45
|
elif product == "week":
|
|
42
|
-
maturity = math.ceil((delivery_start_date - trading_date).
|
|
46
|
+
maturity = math.ceil((delivery_start_date - trading_date).days / 7)
|
|
43
47
|
|
|
44
48
|
elif product == "weekend":
|
|
45
|
-
maturity = math.ceil((delivery_start_date - trading_date).
|
|
49
|
+
maturity = math.ceil((delivery_start_date - trading_date).days / 7)
|
|
46
50
|
|
|
47
51
|
elif product == "month":
|
|
48
52
|
maturity = calc_months_diff(
|
|
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
|