detquantlib 3.7.1__tar.gz → 3.8.0__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.
Files changed (21) hide show
  1. {detquantlib-3.7.1 → detquantlib-3.8.0}/PKG-INFO +7 -5
  2. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/figures/plotly_figures.py +7 -7
  3. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/outputs/outputs_interface.py +29 -6
  4. {detquantlib-3.7.1 → detquantlib-3.8.0}/pyproject.toml +9 -9
  5. {detquantlib-3.7.1 → detquantlib-3.8.0}/LICENSE.txt +0 -0
  6. {detquantlib-3.7.1 → detquantlib-3.8.0}/README.md +0 -0
  7. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/__init__.py +0 -0
  8. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/data/__init__.py +0 -0
  9. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/data/databases/detdatabase.py +0 -0
  10. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/data/entsoe/entsoe.py +0 -0
  11. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/data/sftp/sftp.py +0 -0
  12. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/dates/__init__.py +0 -0
  13. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/dates/dates.py +0 -0
  14. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/figures/__init__.py +0 -0
  15. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/outputs/__init__.py +0 -0
  16. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/stats/__init__.py +0 -0
  17. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/stats/data_analysis.py +0 -0
  18. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/tradable_products/__init__.py +0 -0
  19. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/tradable_products/tradable_products.py +0 -0
  20. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/utils/__init__.py +0 -0
  21. {detquantlib-3.7.1 → detquantlib-3.8.0}/detquantlib/utils/utils.py +0 -0
@@ -1,7 +1,8 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: detquantlib
3
- Version: 3.7.1
3
+ Version: 3.8.0
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.0,<3.0.0)
14
- Requires-Dist: paramiko (>=3.5.1,<4.0.0)
15
- Requires-Dist: plotly (>=6.1.2,<7.0.0)
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
- def get_default_plotly_folder_dir():
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:
@@ -34,7 +32,7 @@ def set_standard_layout(fig: go.Figure) -> go.Figure:
34
32
  def save_plotly_fig_to_json(
35
33
  fig: go.Figure,
36
34
  filename: str,
37
- folder_dir: Path = get_default_plotly_folder_dir(),
35
+ folder_dir: Path = PathDefinitions.get_outputs_plotly_folder_dir(),
38
36
  standard_layout: bool = True,
39
37
  ):
40
38
  """
@@ -65,7 +63,7 @@ def save_plotly_fig_to_json(
65
63
  def save_plotly_fig_to_html(
66
64
  fig: go.Figure,
67
65
  filename: str,
68
- folder_dir: Path = get_default_plotly_folder_dir(),
66
+ folder_dir: Path = PathDefinitions.get_outputs_plotly_folder_dir(),
69
67
  standard_layout: bool = True,
70
68
  ):
71
69
  """
@@ -91,7 +89,9 @@ 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 = get_default_plotly_folder_dir()):
92
+ def show_plotly_fig_json(
93
+ filename: str, folder_dir: Path = PathDefinitions.get_outputs_plotly_folder_dir()
94
+ ):
95
95
  """
96
96
  Short helper function to display a plotly figure stored in a json file.
97
97
 
@@ -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
@@ -149,7 +150,14 @@ class OutputSet:
149
150
  output_items = list()
150
151
  self.output_items = output_items
151
152
 
152
- def add_item(self, data, filename: str, extension: str, sub_path: str = None):
153
+ def add_item(
154
+ self,
155
+ data,
156
+ filename: str,
157
+ extension: str,
158
+ sub_path: str = None,
159
+ export_options: dict = None,
160
+ ):
153
161
  """
154
162
  Creates an OutputItem object and adds it to the OutputSet list.
155
163
 
@@ -159,9 +167,16 @@ class OutputSet:
159
167
  extension: File extension to be used when exporting the output data
160
168
  sub_path: Within the output base directory, indicates the sub-path (if any) of the
161
169
  folder where the output data should be exported
170
+ export_options: Additional options for the function exporting the output data to a file
162
171
  """
163
172
  # Create OutputItem object
164
- item = OutputItem(data=data, filename=filename, extension=extension, sub_path=sub_path)
173
+ item = OutputItem(
174
+ data=data,
175
+ filename=filename,
176
+ extension=extension,
177
+ sub_path=sub_path,
178
+ export_options=export_options,
179
+ )
165
180
  # Append to OutputSet list
166
181
  self.output_items.append(item)
167
182
 
@@ -170,20 +185,28 @@ class PathDefinitions:
170
185
  """A class containing hard-coded path definitions."""
171
186
 
172
187
  @staticmethod
173
- def outputs_folder():
188
+ def default_outputs_folder_name():
174
189
  return "Outputs"
175
190
 
176
191
  @staticmethod
177
- def outputs_plotly_folder():
192
+ def outputs_plotly_folder_name():
178
193
  return "PlotlyFigures"
179
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
+
180
203
  @staticmethod
181
204
  def get_outputs_folder_dir():
182
205
  # Base directory of the folder containing all model outputs
183
- return Path.cwd().joinpath(PathDefinitions.outputs_folder())
206
+ return Path.cwd().joinpath(PathDefinitions.get_outputs_folder_name())
184
207
 
185
208
  @staticmethod
186
209
  def get_outputs_plotly_folder_dir():
187
210
  # Directory of the output folder containing all plotly figures
188
211
  base_dir = PathDefinitions.get_outputs_folder_dir()
189
- return base_dir.joinpath(PathDefinitions.outputs_plotly_folder())
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.7.1"
3
+ version = "3.8.0"
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 = "^3.5.1"
14
+ paramiko = "^4.0.0"
15
15
  numpy = "^2.2.6"
16
- pandas = "^2.3.0"
17
- plotly = "^6.1.2"
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.3.4"
26
- pytest-cov = "^6.2.1"
27
- black = "^25.1.0"
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.1"
29
+ isort = "^6.1.0"
30
30
  colorama = "^0.4.6"
31
- pymarkdownlnt = "^0.9.30"
31
+ pymarkdownlnt = "^0.9.32"
32
32
  md-toc = "^9.0.0"
33
33
 
34
34
  [build-system]
File without changes
File without changes