detquantlib 3.3.0__tar.gz → 3.4.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.3.0 → detquantlib-3.4.0}/PKG-INFO +1 -1
  2. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/outputs/outputs_interface.py +12 -5
  3. {detquantlib-3.3.0 → detquantlib-3.4.0}/pyproject.toml +1 -1
  4. {detquantlib-3.3.0 → detquantlib-3.4.0}/LICENSE.txt +0 -0
  5. {detquantlib-3.3.0 → detquantlib-3.4.0}/README.md +0 -0
  6. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/__init__.py +0 -0
  7. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/data/__init__.py +0 -0
  8. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/data/databases/detdatabase.py +0 -0
  9. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/data/entsoe/entsoe.py +0 -0
  10. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/data/sftp/sftp.py +0 -0
  11. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/dates/__init__.py +0 -0
  12. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/dates/dates.py +0 -0
  13. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/figures/__init__.py +0 -0
  14. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/figures/plotly_figures.py +0 -0
  15. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/outputs/__init__.py +0 -0
  16. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/stats/__init__.py +0 -0
  17. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/stats/data_analysis.py +0 -0
  18. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/tradable_products/__init__.py +0 -0
  19. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/tradable_products/tradable_products.py +0 -0
  20. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/utils/__init__.py +0 -0
  21. {detquantlib-3.3.0 → detquantlib-3.4.0}/detquantlib/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: detquantlib
3
- Version: 3.3.0
3
+ Version: 3.4.0
4
4
  Summary: An internal library containing functions and classes that can be used across Quant models.
5
5
  Author: DET
6
6
  Requires-Python: >=3.10,<4.0
@@ -12,7 +12,12 @@ class OutputItem:
12
12
  """A class to easily manage, store and export a model output."""
13
13
 
14
14
  def __init__(
15
- self, data=None, filename: str = None, extension: str = None, sub_path: str = None
15
+ self,
16
+ data=None,
17
+ filename: str = None,
18
+ extension: str = None,
19
+ sub_path: str = None,
20
+ export_options: dict = None,
16
21
  ):
17
22
  """
18
23
  Constructor method.
@@ -23,11 +28,13 @@ class OutputItem:
23
28
  extension: File extension to be used when exporting the output data
24
29
  sub_path: Within the output base directory, indicates the sub-path (if any) of the
25
30
  folder where the output data should be exported
31
+ export_options: Additional options for the function exporting the output data to a file
26
32
  """
27
33
  self.data = data
28
34
  self.filename = filename
29
35
  self.extension = extension
30
36
  self.sub_path = sub_path
37
+ self.export_options = dict() if export_options is None else export_options
31
38
 
32
39
  def export_to_file(self, folder_dir: Path = None):
33
40
  """
@@ -74,7 +81,7 @@ class OutputItem:
74
81
  """
75
82
  data_type = type(self.data)
76
83
  if data_type is pd.DataFrame:
77
- self.data.to_csv(file_dir, sep=",", index=False)
84
+ self.data.to_csv(file_dir, **self.export_options)
78
85
  else:
79
86
  raise TypeError(f"Exporting data type {data_type} to csv file is not supported.")
80
87
 
@@ -91,7 +98,7 @@ class OutputItem:
91
98
  data_type = type(self.data)
92
99
  if data_type is dict:
93
100
  with open(file_dir, "w") as f:
94
- json.dump(self.data, f, indent=4)
101
+ json.dump(self.data, f, indent=4, **self.export_options)
95
102
  else:
96
103
  raise TypeError(f"Exporting data type {data_type} to json file is not supported.")
97
104
 
@@ -107,7 +114,7 @@ class OutputItem:
107
114
  """
108
115
  data_type = type(self.data)
109
116
  if data_type is go.Figure:
110
- self.data.write_html(file_dir)
117
+ self.data.write_html(file_dir, **self.export_options)
111
118
  else:
112
119
  raise TypeError(f"Exporting data type {data_type} to html file is not supported.")
113
120
 
@@ -123,7 +130,7 @@ class OutputItem:
123
130
  """
124
131
  data_type = type(self.data)
125
132
  if data_type is np.ndarray:
126
- np.savez_compressed(file_dir, data=self.data)
133
+ np.savez_compressed(file_dir, data=self.data, **self.export_options)
127
134
  else:
128
135
  raise TypeError(f"Exporting data type {data_type} to npz file is not supported.")
129
136
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "detquantlib"
3
- version = "3.3.0"
3
+ version = "3.4.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"
File without changes
File without changes