detquantlib 3.7.2__tar.gz → 3.8.1__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.7.2 → detquantlib-3.8.1}/PKG-INFO +7 -5
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/figures/plotly_figures.py +14 -13
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/outputs/outputs_interface.py +13 -4
- {detquantlib-3.7.2 → detquantlib-3.8.1}/pyproject.toml +9 -9
- {detquantlib-3.7.2 → detquantlib-3.8.1}/LICENSE.txt +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/README.md +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/__init__.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/data/__init__.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/data/databases/detdatabase.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/data/entsoe/entsoe.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/data/sftp/sftp.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/dates/__init__.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/dates/dates.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/figures/__init__.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/outputs/__init__.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/stats/__init__.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/stats/data_analysis.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/tradable_products/__init__.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/tradable_products/tradable_products.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/utils/__init__.py +0 -0
- {detquantlib-3.7.2 → detquantlib-3.8.1}/detquantlib/utils/utils.py +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: detquantlib
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.8.1
|
|
4
4
|
Summary: An internal library containing functions and classes that can be used across Quant models.
|
|
5
|
+
License-File: LICENSE.txt
|
|
5
6
|
Author: DET
|
|
6
7
|
Requires-Python: >=3.10,<4.0
|
|
7
8
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -9,10 +10,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
9
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
14
|
Requires-Dist: numpy (>=2.2.6,<3.0.0)
|
|
13
|
-
Requires-Dist: pandas (>=2.3.
|
|
14
|
-
Requires-Dist: paramiko (>=
|
|
15
|
-
Requires-Dist: plotly (>=6.1
|
|
15
|
+
Requires-Dist: pandas (>=2.3.3,<3.0.0)
|
|
16
|
+
Requires-Dist: paramiko (>=4.0.0,<5.0.0)
|
|
17
|
+
Requires-Dist: plotly (>=6.3.1,<7.0.0)
|
|
16
18
|
Requires-Dist: pyodbc (>=5.2.0,<6.0.0)
|
|
17
19
|
Requires-Dist: python-dotenv (>=1.1.0,<2.0.0)
|
|
18
20
|
Requires-Dist: scipy (>=1.15.2,<2.0.0)
|
|
@@ -5,10 +5,8 @@ from pathlib import Path
|
|
|
5
5
|
import plotly.graph_objects as go
|
|
6
6
|
import plotly.io as pio
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# Default path to output folder containing plotly figures.
|
|
11
|
-
return Path.cwd().joinpath("Outputs", "PlotlyFigures")
|
|
8
|
+
# Internal modules
|
|
9
|
+
from detquantlib.outputs.outputs_interface import PathDefinitions
|
|
12
10
|
|
|
13
11
|
|
|
14
12
|
def set_standard_layout(fig: go.Figure) -> go.Figure:
|
|
@@ -32,10 +30,7 @@ def set_standard_layout(fig: go.Figure) -> go.Figure:
|
|
|
32
30
|
|
|
33
31
|
|
|
34
32
|
def save_plotly_fig_to_json(
|
|
35
|
-
fig: go.Figure,
|
|
36
|
-
filename: str,
|
|
37
|
-
folder_dir: Path = get_default_plotly_folder_dir(),
|
|
38
|
-
standard_layout: bool = True,
|
|
33
|
+
fig: go.Figure, filename: str, folder_dir: Path = None, standard_layout: bool = True
|
|
39
34
|
):
|
|
40
35
|
"""
|
|
41
36
|
Saves a plotly figure object to a json file.
|
|
@@ -46,6 +41,9 @@ def save_plotly_fig_to_json(
|
|
|
46
41
|
folder_dir: Folder directory where the json file will be saved
|
|
47
42
|
standard_layout: If true, enforces a standard plotly layout
|
|
48
43
|
"""
|
|
44
|
+
if folder_dir is None:
|
|
45
|
+
PathDefinitions.get_outputs_plotly_folder_dir()
|
|
46
|
+
|
|
49
47
|
# Create plotly folder if it doesn't exist yet
|
|
50
48
|
folder_dir.mkdir(parents=True, exist_ok=True)
|
|
51
49
|
|
|
@@ -63,10 +61,7 @@ def save_plotly_fig_to_json(
|
|
|
63
61
|
|
|
64
62
|
|
|
65
63
|
def save_plotly_fig_to_html(
|
|
66
|
-
fig: go.Figure,
|
|
67
|
-
filename: str,
|
|
68
|
-
folder_dir: Path = get_default_plotly_folder_dir(),
|
|
69
|
-
standard_layout: bool = True,
|
|
64
|
+
fig: go.Figure, filename: str, folder_dir: Path = None, standard_layout: bool = True
|
|
70
65
|
):
|
|
71
66
|
"""
|
|
72
67
|
Saves a plotly figure object to an html file.
|
|
@@ -77,6 +72,9 @@ def save_plotly_fig_to_html(
|
|
|
77
72
|
folder_dir: Folder directory where the html file will be saved
|
|
78
73
|
standard_layout: If true, enforces a standard plotly layout
|
|
79
74
|
"""
|
|
75
|
+
if folder_dir is None:
|
|
76
|
+
folder_dir = PathDefinitions.get_outputs_plotly_folder_dir()
|
|
77
|
+
|
|
80
78
|
# Create plotly folder if it doesn't exist yet
|
|
81
79
|
folder_dir.mkdir(parents=True, exist_ok=True)
|
|
82
80
|
|
|
@@ -91,7 +89,7 @@ def save_plotly_fig_to_html(
|
|
|
91
89
|
fig.write_html(file_dir)
|
|
92
90
|
|
|
93
91
|
|
|
94
|
-
def show_plotly_fig_json(filename: str, folder_dir: Path =
|
|
92
|
+
def show_plotly_fig_json(filename: str, folder_dir: Path = None):
|
|
95
93
|
"""
|
|
96
94
|
Short helper function to display a plotly figure stored in a json file.
|
|
97
95
|
|
|
@@ -99,6 +97,9 @@ def show_plotly_fig_json(filename: str, folder_dir: Path = get_default_plotly_fo
|
|
|
99
97
|
filename: Name of json file containing the plotly figure
|
|
100
98
|
folder_dir: Folder directory containing the json file
|
|
101
99
|
"""
|
|
100
|
+
if folder_dir is None:
|
|
101
|
+
PathDefinitions.get_outputs_plotly_folder_dir()
|
|
102
|
+
|
|
102
103
|
# Get json file directory
|
|
103
104
|
file_dir = folder_dir.joinpath(f"{filename}.json")
|
|
104
105
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Python built-in packages
|
|
2
2
|
import json
|
|
3
|
+
import os
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
|
|
5
6
|
# Third-party packages
|
|
@@ -184,20 +185,28 @@ class PathDefinitions:
|
|
|
184
185
|
"""A class containing hard-coded path definitions."""
|
|
185
186
|
|
|
186
187
|
@staticmethod
|
|
187
|
-
def
|
|
188
|
+
def default_outputs_folder_name():
|
|
188
189
|
return "Outputs"
|
|
189
190
|
|
|
190
191
|
@staticmethod
|
|
191
|
-
def
|
|
192
|
+
def outputs_plotly_folder_name():
|
|
192
193
|
return "PlotlyFigures"
|
|
193
194
|
|
|
195
|
+
@staticmethod
|
|
196
|
+
def get_outputs_folder_name():
|
|
197
|
+
# Get name from environment variable if it exists, otherwise use default name
|
|
198
|
+
folder_name = os.getenv("OUTPUTS_FOLDER")
|
|
199
|
+
if folder_name is None:
|
|
200
|
+
folder_name = PathDefinitions.default_outputs_folder_name()
|
|
201
|
+
return folder_name
|
|
202
|
+
|
|
194
203
|
@staticmethod
|
|
195
204
|
def get_outputs_folder_dir():
|
|
196
205
|
# Base directory of the folder containing all model outputs
|
|
197
|
-
return Path.cwd().joinpath(PathDefinitions.
|
|
206
|
+
return Path.cwd().joinpath(PathDefinitions.get_outputs_folder_name())
|
|
198
207
|
|
|
199
208
|
@staticmethod
|
|
200
209
|
def get_outputs_plotly_folder_dir():
|
|
201
210
|
# Directory of the output folder containing all plotly figures
|
|
202
211
|
base_dir = PathDefinitions.get_outputs_folder_dir()
|
|
203
|
-
return base_dir.joinpath(PathDefinitions.
|
|
212
|
+
return base_dir.joinpath(PathDefinitions.outputs_plotly_folder_name())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "detquantlib"
|
|
3
|
-
version = "3.
|
|
3
|
+
version = "3.8.1"
|
|
4
4
|
description = "An internal library containing functions and classes that can be used across Quant models."
|
|
5
5
|
authors = ["DET"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -11,10 +11,10 @@ packages = [
|
|
|
11
11
|
|
|
12
12
|
[tool.poetry.dependencies]
|
|
13
13
|
python = ">=3.10,<4.0"
|
|
14
|
-
paramiko = "^
|
|
14
|
+
paramiko = "^4.0.0"
|
|
15
15
|
numpy = "^2.2.6"
|
|
16
|
-
pandas = "^2.3.
|
|
17
|
-
plotly = "^6.1
|
|
16
|
+
pandas = "^2.3.3"
|
|
17
|
+
plotly = "^6.3.1"
|
|
18
18
|
pyodbc = "^5.2.0"
|
|
19
19
|
python-dotenv = "^1.1.0"
|
|
20
20
|
scipy = "^1.15.2"
|
|
@@ -22,13 +22,13 @@ scipy = "^1.15.2"
|
|
|
22
22
|
[tool.poetry.group.dev.dependencies]
|
|
23
23
|
toml = "^0.10.2"
|
|
24
24
|
invoke = "^2.2.0"
|
|
25
|
-
pytest = "^8.
|
|
26
|
-
pytest-cov = "^
|
|
27
|
-
black = "^25.
|
|
25
|
+
pytest = "^8.4.2"
|
|
26
|
+
pytest-cov = "^7.0.0"
|
|
27
|
+
black = "^25.9.0"
|
|
28
28
|
darglint = "^1.8.1"
|
|
29
|
-
isort = "^6.0
|
|
29
|
+
isort = "^6.1.0"
|
|
30
30
|
colorama = "^0.4.6"
|
|
31
|
-
pymarkdownlnt = "^0.9.
|
|
31
|
+
pymarkdownlnt = "^0.9.32"
|
|
32
32
|
md-toc = "^9.0.0"
|
|
33
33
|
|
|
34
34
|
[build-system]
|
|
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
|