detquantlib 2.0.5__tar.gz → 2.1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: detquantlib
3
- Version: 2.0.5
3
+ Version: 2.1.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
@@ -53,7 +53,7 @@ Project dependencies are managed by [Poetry](https://python-poetry.org/).
53
53
  The project follows the standard Poetry structure:
54
54
 
55
55
  ```
56
- poetrytemplate
56
+ project
57
57
  ├── pyproject.toml
58
58
  ├── README.md
59
59
  ├── src
@@ -34,7 +34,7 @@ Project dependencies are managed by [Poetry](https://python-poetry.org/).
34
34
  The project follows the standard Poetry structure:
35
35
 
36
36
  ```
37
- poetrytemplate
37
+ project
38
38
  ├── pyproject.toml
39
39
  ├── README.md
40
40
  ├── src
@@ -531,5 +531,5 @@ class DetDatabaseDefinitions:
531
531
  driver="{ODBC Driver 18 for SQL Server}",
532
532
  table_name_entsoe_day_ahead_spot_price="[ENTSOE].[DayAheadSpotPrice]",
533
533
  table_name_entsoe_imbalance_price="[ENTSOE].[ImbalancePrice]",
534
- table_name_futures_eod_settlement_price="[FUT].[EODSettlementPrice]",
534
+ table_name_futures_eod_settlement_price="[VW].[EODSettlementPrice]",
535
535
  )
@@ -62,6 +62,35 @@ def save_plotly_fig_to_json(
62
62
  f.write(fig_json)
63
63
 
64
64
 
65
+ 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,
70
+ ):
71
+ """
72
+ Saves a plotly figure object to an html file.
73
+
74
+ Args:
75
+ fig: Plotly figure
76
+ filename: Name of html file in which plotly figure will be saved
77
+ folder_dir: Folder directory where the html file will be saved
78
+ standard_layout: If true, enforces a standard plotly layout
79
+ """
80
+ # Create plotly folder if it doesn't exist yet
81
+ folder_dir.mkdir(parents=True, exist_ok=True)
82
+
83
+ # Define html file directory
84
+ file_dir = folder_dir.joinpath(f"{filename}.html")
85
+
86
+ # Adjust figure layout
87
+ if standard_layout:
88
+ fig = set_standard_layout(fig)
89
+
90
+ # Save figure to html
91
+ fig.write_html(file_dir)
92
+
93
+
65
94
  def show_plotly_fig_json(filename: str, folder_dir: Path = get_default_plotly_folder_dir()):
66
95
  """
67
96
  Short helper function to display a plotly figure stored in a json file.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "detquantlib"
3
- version = "2.0.5"
3
+ version = "2.1.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