openseries 1.7.5__tar.gz → 1.7.6__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.1
2
2
  Name: openseries
3
- Version: 1.7.5
3
+ Version: 1.7.6
4
4
  Summary: Tools for analyzing financial timeseries.
5
5
  Home-page: https://github.com/CaptorAB/openseries
6
6
  License: BSD-3-Clause
@@ -24,7 +24,7 @@ Requires-Dist: numpy (>=1.23.2,<3.0.0)
24
24
  Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
25
25
  Requires-Dist: pandas (>=2.1.2,<3.0.0)
26
26
  Requires-Dist: plotly (>=5.18.0,<6.0.0)
27
- Requires-Dist: pyarrow (>=14.0.2,<18.0.0)
27
+ Requires-Dist: pyarrow (>=14.0.2,<19.0.0)
28
28
  Requires-Dist: pydantic (>=2.5.2,<3.0.0)
29
29
  Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
30
30
  Requires-Dist: requests (>=2.20.0,<3.0.0)
@@ -43,7 +43,11 @@ from ._risk import (
43
43
  _cvar_down_calc,
44
44
  _var_down_calc,
45
45
  )
46
- from .datefixer import date_offset_foll, holiday_calendar
46
+ from .datefixer import (
47
+ _do_resample_to_business_period_ends,
48
+ date_offset_foll,
49
+ holiday_calendar,
50
+ )
47
51
  from .load_plotly import load_plotly_dict
48
52
  from .types import (
49
53
  CountriesType,
@@ -52,6 +56,7 @@ from .types import (
52
56
  LiteralJsonOutput,
53
57
  LiteralLinePlotMode,
54
58
  LiteralNanMethod,
59
+ LiteralPandasReindexMethod,
55
60
  LiteralPlotlyJSlib,
56
61
  LiteralPlotlyOutput,
57
62
  LiteralQuantileInterp,
@@ -358,9 +363,17 @@ class _CommonModel(BaseModel):
358
363
  Most negative month
359
364
 
360
365
  """
366
+ method: LiteralPandasReindexMethod = "nearest"
367
+ countries = "SE"
361
368
  wmdf = self.tsdf.copy()
369
+ dates = _do_resample_to_business_period_ends(
370
+ data=wmdf,
371
+ freq="BME",
372
+ countries=countries,
373
+ )
374
+ wmdf = wmdf.reindex(index=[deyt.date() for deyt in dates], method=method)
362
375
  wmdf.index = DatetimeIndex(wmdf.index)
363
- result = wmdf.resample("BME").last().ffill().pct_change().min()
376
+ result = wmdf.ffill().pct_change().min()
364
377
 
365
378
  if self.tsdf.shape[1] == 1:
366
379
  return float(result.iloc[0])
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "openseries"
3
- version = "1.7.5"
3
+ version = "1.7.6"
4
4
  description = "Tools for analyzing financial timeseries."
5
5
  authors = ["Martin Karrin <martin.karrin@captor.se>"]
6
6
  repository = "https://github.com/CaptorAB/openseries"
@@ -38,7 +38,7 @@ numpy = ">=1.23.2,<3.0.0"
38
38
  openpyxl = ">=3.1.2,<4.0.0"
39
39
  pandas = ">=2.1.2,<3.0.0"
40
40
  plotly = ">=5.18.0,<6.0.0"
41
- pyarrow = ">=14.0.2,<18.0.0"
41
+ pyarrow = ">=14.0.2,<19.0.0"
42
42
  pydantic = ">=2.5.2,<3.0.0"
43
43
  python-dateutil = ">=2.8.2,<3.0.0"
44
44
  requests = ">=2.20.0,<3.0.0"
@@ -47,19 +47,19 @@ statsmodels = ">=0.14.0,!=0.14.2,<1.0.0"
47
47
 
48
48
  [tool.poetry.group.dev.dependencies]
49
49
  black = ">=24.4.2,<25.0.0"
50
- coverage = ">=7.6.0,<8.0.0"
50
+ coverage = "^7.6.4"
51
51
  genbadge = {version = ">=1.1.1,<2.0.0", extras = ["coverage"]}
52
- mypy = "^1.11.2"
52
+ mypy = "^1.13.0"
53
53
  pandas-stubs = ">=2.1.2,<3.0.0"
54
54
  pre-commit = ">=3.7.1,<6.0.0"
55
55
  pytest = ">=8.2.2,<9.0.0"
56
- ruff = "^0.6.9"
56
+ ruff = "^0.7.1"
57
57
  types-openpyxl = ">=3.1.2,<4.0.0"
58
58
  types-python-dateutil = ">=2.8.2,<3.0.0"
59
59
  types-requests = ">=2.20.0,<3.0.0"
60
60
 
61
61
  [build-system]
62
- requires = ["poetry-core>=1.8.3"]
62
+ requires = ["poetry-core>=1.8.4"]
63
63
  build-backend = "poetry.core.masonry.api"
64
64
 
65
65
  [tool.coverage.run]
File without changes
File without changes