openseries 1.9.6__tar.gz → 1.9.7__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.4
2
2
  Name: openseries
3
- Version: 1.9.6
3
+ Version: 1.9.7
4
4
  Summary: Tools for analyzing financial timeseries.
5
5
  License: # BSD 3-Clause License
6
6
 
@@ -118,7 +118,7 @@ _,_=series.plot_series()
118
118
 
119
119
  ```
120
120
 
121
- ### Sample output using the report_html() function:
121
+ ### Sample output using the report_html() function
122
122
 
123
123
  <img src="https://raw.githubusercontent.com/CaptorAB/openseries/master/openseries_plot.png" alt="Two Assets Compared" width="1000" />
124
124
 
@@ -152,10 +152,7 @@ source source_me
152
152
 
153
153
  ## Testing and Linting / Type-checking
154
154
 
155
- Ruff and Mypy checking is embedded in the pre-commit hook. Both
156
- are also used in the project's GitHub workflows and are run when the `lint`
157
- alternative is chosen in the below commands.
158
- Any silenced error codes can be found in the
155
+ [Ruff](https://docs.astral.sh/ruff/) and [mypy](https://mypy-lang.org/) checking is embedded in the pre-commit hook. Both are also used in the project's GitHub workflows and are run when the `lint` alternative is chosen in the below commands. Any silenced error codes can be found in the
159
156
  [pyproject.toml](https://github.com/CaptorAB/openseries/blob/master/pyproject.toml)
160
157
  file or in in-line comments.
161
158
 
@@ -201,7 +198,7 @@ make lint
201
198
  | [report.py](https://github.com/CaptorAB/openseries/blob/master/openseries/report.py) | Defines the _report_html_ function that is used to create a landscape orientation report on at least two assets. All preceding assets will be measured against the last asset in the input OpenFrame. |
202
199
  | [simulation.py](https://github.com/CaptorAB/openseries/blob/master/openseries/simulation.py) | Defines the class _ReturnSimulation_ to create simulated financial timeseries. Used in the project's test suite |
203
200
 
204
- ### Class methods used to construct objects.
201
+ ### Class methods used to construct objects
205
202
 
206
203
  | Method | Applies to | Description |
207
204
  |:------------------|:------------------------------|:---------------------------------------------------------------------------------------------------|
@@ -210,7 +207,7 @@ make lint
210
207
  | `from_fixed_rate` | `OpenTimeSeries` | Class method to create an OpenTimeSeries object from a fixed rate, number of days and an end date. |
211
208
  | `from_deepcopy` | `OpenTimeSeries`, `OpenFrame` | Creates a copy of an OpenTimeSeries object. |
212
209
 
213
- ### Non-numerical or "helper" properties that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class.
210
+ ### Non-numerical or "helper" properties that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class
214
211
 
215
212
  | Property | type | Applies to | Description |
216
213
  |:----------------|:---------------------|:-----------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -228,7 +225,7 @@ make lint
228
225
  | `markets` | `list[str]` or `str` | `OpenTimeSeries` | (List of) markets code(s) according to market code(s) input for the [pandas-market-calendars](https://pandas-market-calendars.readthedocs.io/en/latest/) package. |
229
226
  | `valuetype` | `ValueType` | `OpenTimeSeries` | Field identifies the type of values in the series. ValueType is an Enum. |
230
227
 
231
- ### Non-numerical or "helper" properties that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
228
+ ### Non-numerical or "helper" properties that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class
232
229
 
233
230
  | Property | type | Applies to | Description |
234
231
  |:-------------------|:---------------------------------|:------------|:-------------------------------------------------------------------------|
@@ -242,7 +239,7 @@ make lint
242
239
  | `lengths_of_items` | `pandas.Series[int]` | `OpenFrame` | Number of items in each of the series in the OpenFrame. |
243
240
  | `span_of_days_all` | `pandas.Series[int]` | `OpenFrame` | Number of days from the first to the last in each of the series. |
244
241
 
245
- ### Non-numerical or "helper" properties that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
242
+ ### Non-numerical or "helper" properties that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class
246
243
 
247
244
  | Property | type | Applies to | Description |
248
245
  |:--------------------|:---------------------------------|:------------------------------|:----------------------------------------------------------------------------------|
@@ -255,7 +252,7 @@ make lint
255
252
  | `periods_in_a_year` | `float` | `OpenTimeSeries`, `OpenFrame` | The number of observations in an average year for all days in the data. |
256
253
  | `yearfrac` | `float` | `OpenTimeSeries`, `OpenFrame` | Length of timeseries expressed as np.float64 fraction of a year with 365.25 days. |
257
254
 
258
- ### Methods that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class.
255
+ ### Methods that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class
259
256
 
260
257
  | Method | Applies to | Description |
261
258
  |:-------------------------|:-----------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|
@@ -263,10 +260,9 @@ make lint
263
260
  | `set_new_label` | `OpenTimeSeries` | Method to change the pandas.DataFrame column MultiIndex. |
264
261
  | `running_adjustment` | `OpenTimeSeries` | Adjusts the series performance with a `float` factor. |
265
262
  | `ewma_vol_func` | `OpenTimeSeries` | Returns a `pandas.Series` with volatility based on [Exponentially Weighted Moving Average](https://www.investopedia.com/articles/07/ewma.asp). |
266
- | `from_1d_rate_to_cumret` | `OpenTimeSeries` | Converts a series of 1-day rates into a cumulative valueseries. |
267
- |
263
+ | `from_1d_rate_to_cumret` | `OpenTimeSeries` | Converts a series of 1-day rates into a cumulative valueseries. |
268
264
 
269
- ### Methods that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
265
+ ### Methods that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class
270
266
 
271
267
  | Method | Applies to | Description |
272
268
  |:---------------------------------|:------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -275,7 +271,7 @@ make lint
275
271
  | `add_timeseries` | `OpenFrame` | Adds a given OpenTimeSeries to the OpenFrame. |
276
272
  | `delete_timeseries` | `OpenFrame` | Deletes an OpenTimeSeries from the OpenFrame. |
277
273
  | `relative` | `OpenFrame` | Calculates a new series that is the relative performance of two others. |
278
- | `make_portfolio` | `OpenFrame` | Calculates a portfolio timeseries based on the series and weights. Weights can be provided as a list, or a weight strategy can be set as *equal weights* or *inverted volatility*. |
274
+ | `make_portfolio` | `OpenFrame` | Calculates a portfolio timeseries based on the series and weights. Weights an be provided as a list, or a weight strategy can be set as _equal weights_ or _inverted volatility_. |
279
275
  | `ord_least_squares_fit` | `OpenFrame` | Performs a regression and an [Ordinary Least Squares](https://www.statsmodels.org/stable/examples/notebooks/generated/ols.html) fit. |
280
276
  | `beta` | `OpenFrame` | Calculates [Beta](https://www.investopedia.com/terms/b/beta.asp) of an asset relative a market. |
281
277
  | `jensen_alpha` | `OpenFrame` | Calculates [Jensen's Alpha](https://www.investopedia.com/terms/j/jensensmeasure.asp) of an asset relative a market. |
@@ -289,7 +285,7 @@ make lint
289
285
  | `ewma_risk` | `OpenFrame` | Returns a `pandas.DataFrame` with volatility and correlation based on [Exponentially Weighted Moving Average](https://www.investopedia.com/articles/07/ewma.asp). |
290
286
  | `multi_factor_linear_regression` | `OpenFrame` | Treats one specified series as the dependent variable (y) and uses all remaining series as independent variables (X) in a linear regression and returns a DataFrame with summary output and a series of predicted values. |
291
287
 
292
- ### Methods that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
288
+ ### Methods that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class
293
289
 
294
290
  | Method | Applies to | Description |
295
291
  |:-----------------------------------|:------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -315,7 +311,7 @@ make lint
315
311
  | `rolling_cvar_down` | `OpenTimeSeries`, `OpenFrame` | Returns a pandas.DataFrame with rolling CVaR figures. |
316
312
  | `calc_range` | `OpenTimeSeries`, `OpenFrame` | Returns the start and end dates of a range from specific period definitions. Used by the below numerical methods and not meant to be used independently. |
317
313
 
318
- ### Numerical properties available for individual [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) or on all series in an [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py).
314
+ ### Numerical properties available for individual [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) or on all series in an [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py)
319
315
 
320
316
  | Property | type | Applies to | Description |
321
317
  |:------------------------|:-------------------------|:------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -341,7 +337,7 @@ make lint
341
337
  | `kurtosis` | `float`, `pandas.Series` | `OpenTimeSeries`, `OpenFrame` | [Kurtosis](https://www.investopedia.com/terms/k/kurtosis.asp) of the return distribution. |
342
338
  | `z_score` | `float`, `pandas.Series` | `OpenTimeSeries`, `OpenFrame` | [Z-score](https://www.investopedia.com/terms/z/zscore.asp) as (last return - mean return) / standard deviation of returns. |
343
339
 
344
- ### Methods below are identical to the Numerical Properties above.
340
+ ### Methods below are identical to the Numerical Properties above
345
341
 
346
342
  _They are simply methods that take different date or length inputs to return the
347
343
  properties for subset periods._
@@ -52,7 +52,7 @@ _,_=series.plot_series()
52
52
 
53
53
  ```
54
54
 
55
- ### Sample output using the report_html() function:
55
+ ### Sample output using the report_html() function
56
56
 
57
57
  <img src="https://raw.githubusercontent.com/CaptorAB/openseries/master/openseries_plot.png" alt="Two Assets Compared" width="1000" />
58
58
 
@@ -86,10 +86,7 @@ source source_me
86
86
 
87
87
  ## Testing and Linting / Type-checking
88
88
 
89
- Ruff and Mypy checking is embedded in the pre-commit hook. Both
90
- are also used in the project's GitHub workflows and are run when the `lint`
91
- alternative is chosen in the below commands.
92
- Any silenced error codes can be found in the
89
+ [Ruff](https://docs.astral.sh/ruff/) and [mypy](https://mypy-lang.org/) checking is embedded in the pre-commit hook. Both are also used in the project's GitHub workflows and are run when the `lint` alternative is chosen in the below commands. Any silenced error codes can be found in the
93
90
  [pyproject.toml](https://github.com/CaptorAB/openseries/blob/master/pyproject.toml)
94
91
  file or in in-line comments.
95
92
 
@@ -135,7 +132,7 @@ make lint
135
132
  | [report.py](https://github.com/CaptorAB/openseries/blob/master/openseries/report.py) | Defines the _report_html_ function that is used to create a landscape orientation report on at least two assets. All preceding assets will be measured against the last asset in the input OpenFrame. |
136
133
  | [simulation.py](https://github.com/CaptorAB/openseries/blob/master/openseries/simulation.py) | Defines the class _ReturnSimulation_ to create simulated financial timeseries. Used in the project's test suite |
137
134
 
138
- ### Class methods used to construct objects.
135
+ ### Class methods used to construct objects
139
136
 
140
137
  | Method | Applies to | Description |
141
138
  |:------------------|:------------------------------|:---------------------------------------------------------------------------------------------------|
@@ -144,7 +141,7 @@ make lint
144
141
  | `from_fixed_rate` | `OpenTimeSeries` | Class method to create an OpenTimeSeries object from a fixed rate, number of days and an end date. |
145
142
  | `from_deepcopy` | `OpenTimeSeries`, `OpenFrame` | Creates a copy of an OpenTimeSeries object. |
146
143
 
147
- ### Non-numerical or "helper" properties that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class.
144
+ ### Non-numerical or "helper" properties that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class
148
145
 
149
146
  | Property | type | Applies to | Description |
150
147
  |:----------------|:---------------------|:-----------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -162,7 +159,7 @@ make lint
162
159
  | `markets` | `list[str]` or `str` | `OpenTimeSeries` | (List of) markets code(s) according to market code(s) input for the [pandas-market-calendars](https://pandas-market-calendars.readthedocs.io/en/latest/) package. |
163
160
  | `valuetype` | `ValueType` | `OpenTimeSeries` | Field identifies the type of values in the series. ValueType is an Enum. |
164
161
 
165
- ### Non-numerical or "helper" properties that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
162
+ ### Non-numerical or "helper" properties that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class
166
163
 
167
164
  | Property | type | Applies to | Description |
168
165
  |:-------------------|:---------------------------------|:------------|:-------------------------------------------------------------------------|
@@ -176,7 +173,7 @@ make lint
176
173
  | `lengths_of_items` | `pandas.Series[int]` | `OpenFrame` | Number of items in each of the series in the OpenFrame. |
177
174
  | `span_of_days_all` | `pandas.Series[int]` | `OpenFrame` | Number of days from the first to the last in each of the series. |
178
175
 
179
- ### Non-numerical or "helper" properties that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
176
+ ### Non-numerical or "helper" properties that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class
180
177
 
181
178
  | Property | type | Applies to | Description |
182
179
  |:--------------------|:---------------------------------|:------------------------------|:----------------------------------------------------------------------------------|
@@ -189,7 +186,7 @@ make lint
189
186
  | `periods_in_a_year` | `float` | `OpenTimeSeries`, `OpenFrame` | The number of observations in an average year for all days in the data. |
190
187
  | `yearfrac` | `float` | `OpenTimeSeries`, `OpenFrame` | Length of timeseries expressed as np.float64 fraction of a year with 365.25 days. |
191
188
 
192
- ### Methods that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class.
189
+ ### Methods that apply only to the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) class
193
190
 
194
191
  | Method | Applies to | Description |
195
192
  |:-------------------------|:-----------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|
@@ -197,10 +194,9 @@ make lint
197
194
  | `set_new_label` | `OpenTimeSeries` | Method to change the pandas.DataFrame column MultiIndex. |
198
195
  | `running_adjustment` | `OpenTimeSeries` | Adjusts the series performance with a `float` factor. |
199
196
  | `ewma_vol_func` | `OpenTimeSeries` | Returns a `pandas.Series` with volatility based on [Exponentially Weighted Moving Average](https://www.investopedia.com/articles/07/ewma.asp). |
200
- | `from_1d_rate_to_cumret` | `OpenTimeSeries` | Converts a series of 1-day rates into a cumulative valueseries. |
201
- |
197
+ | `from_1d_rate_to_cumret` | `OpenTimeSeries` | Converts a series of 1-day rates into a cumulative valueseries. |
202
198
 
203
- ### Methods that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
199
+ ### Methods that apply only to the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class
204
200
 
205
201
  | Method | Applies to | Description |
206
202
  |:---------------------------------|:------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -209,7 +205,7 @@ make lint
209
205
  | `add_timeseries` | `OpenFrame` | Adds a given OpenTimeSeries to the OpenFrame. |
210
206
  | `delete_timeseries` | `OpenFrame` | Deletes an OpenTimeSeries from the OpenFrame. |
211
207
  | `relative` | `OpenFrame` | Calculates a new series that is the relative performance of two others. |
212
- | `make_portfolio` | `OpenFrame` | Calculates a portfolio timeseries based on the series and weights. Weights can be provided as a list, or a weight strategy can be set as *equal weights* or *inverted volatility*. |
208
+ | `make_portfolio` | `OpenFrame` | Calculates a portfolio timeseries based on the series and weights. Weights an be provided as a list, or a weight strategy can be set as _equal weights_ or _inverted volatility_. |
213
209
  | `ord_least_squares_fit` | `OpenFrame` | Performs a regression and an [Ordinary Least Squares](https://www.statsmodels.org/stable/examples/notebooks/generated/ols.html) fit. |
214
210
  | `beta` | `OpenFrame` | Calculates [Beta](https://www.investopedia.com/terms/b/beta.asp) of an asset relative a market. |
215
211
  | `jensen_alpha` | `OpenFrame` | Calculates [Jensen's Alpha](https://www.investopedia.com/terms/j/jensensmeasure.asp) of an asset relative a market. |
@@ -223,7 +219,7 @@ make lint
223
219
  | `ewma_risk` | `OpenFrame` | Returns a `pandas.DataFrame` with volatility and correlation based on [Exponentially Weighted Moving Average](https://www.investopedia.com/articles/07/ewma.asp). |
224
220
  | `multi_factor_linear_regression` | `OpenFrame` | Treats one specified series as the dependent variable (y) and uses all remaining series as independent variables (X) in a linear regression and returns a DataFrame with summary output and a series of predicted values. |
225
221
 
226
- ### Methods that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class.
222
+ ### Methods that apply to both the [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) and the [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py) class
227
223
 
228
224
  | Method | Applies to | Description |
229
225
  |:-----------------------------------|:------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -249,7 +245,7 @@ make lint
249
245
  | `rolling_cvar_down` | `OpenTimeSeries`, `OpenFrame` | Returns a pandas.DataFrame with rolling CVaR figures. |
250
246
  | `calc_range` | `OpenTimeSeries`, `OpenFrame` | Returns the start and end dates of a range from specific period definitions. Used by the below numerical methods and not meant to be used independently. |
251
247
 
252
- ### Numerical properties available for individual [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) or on all series in an [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py).
248
+ ### Numerical properties available for individual [OpenTimeSeries](https://github.com/CaptorAB/openseries/blob/master/openseries/series.py) or on all series in an [OpenFrame](https://github.com/CaptorAB/openseries/blob/master/openseries/frame.py)
253
249
 
254
250
  | Property | type | Applies to | Description |
255
251
  |:------------------------|:-------------------------|:------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -275,7 +271,7 @@ make lint
275
271
  | `kurtosis` | `float`, `pandas.Series` | `OpenTimeSeries`, `OpenFrame` | [Kurtosis](https://www.investopedia.com/terms/k/kurtosis.asp) of the return distribution. |
276
272
  | `z_score` | `float`, `pandas.Series` | `OpenTimeSeries`, `OpenFrame` | [Z-score](https://www.investopedia.com/terms/z/zscore.asp) as (last return - mean return) / standard deviation of returns. |
277
273
 
278
- ### Methods below are identical to the Numerical Properties above.
274
+ ### Methods below are identical to the Numerical Properties above
279
275
 
280
276
  _They are simply methods that take different date or length inputs to return the
281
277
  properties for subset periods._