wbfdm 1.51.5__py2.py3-none-any.whl → 1.51.6__py2.py3-none-any.whl

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.

Potentially problematic release.


This version of wbfdm might be problematic. Click here for more details.

@@ -1,3 +1,4 @@
1
+ import logging
1
2
  from contextlib import suppress
2
3
  from datetime import date
3
4
  from decimal import Decimal
@@ -21,6 +22,8 @@ from wbcore.contrib.currency.models import CurrencyFXRates
21
22
 
22
23
  from wbfdm.enums import MarketData
23
24
 
25
+ logger = logging.getLogger("pms")
26
+
24
27
 
25
28
  class InstrumentQuerySet(QuerySet):
26
29
  def filter_active_at_date(self, val_date: date):
@@ -150,6 +153,12 @@ class InstrumentQuerySet(QuerySet):
150
153
 
151
154
  for instrument_id, dff in df.groupby("instrument_id", group_keys=False, as_index=False):
152
155
  dff = dff.drop(columns=["instrument_id"]).set_index("date").sort_index()
156
+ if dff.index.duplicated().any():
157
+ dff = dff.groupby(level=0).first()
158
+ logger.warning(
159
+ f"We detected a duplicated index for instrument id {instrument_id}. Please correct the dl parameter which likely introduced this issue."
160
+ )
161
+
153
162
  dff = dff.reindex(pd.date_range(dff.index.min(), dff.index.max(), freq="B"))
154
163
  dff[["close", "market_capitalization"]] = dff[["close", "market_capitalization"]].astype(float).ffill()
155
164
  dff.volume = dff.volume.astype(float).fillna(0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbfdm
3
- Version: 1.51.5
3
+ Version: 1.51.6
4
4
  Summary: The workbench module ensures rapid access to diverse financial data (market, fundamental, forecasts, ESG), with features for storing instruments, classifying them, and conducting financial analysis.
5
5
  Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
6
6
  Requires-Dist: roman==4.*
@@ -239,7 +239,7 @@ wbfdm/models/instruments/instrument_requests.py,sha256=XbpofRS8WHadHlTFjvXJyd0o7
239
239
  wbfdm/models/instruments/instruments.py,sha256=Heyk5cBJJ7ZkoDuZnTuWxB7LMmp_BZb2feW_exs1oIA,40276
240
240
  wbfdm/models/instruments/options.py,sha256=hFprq7B5t4ctz8nVqzFsBEzftq_KDUSsSXl1zJyh7tE,7094
241
241
  wbfdm/models/instruments/private_equities.py,sha256=uzwZi8IkmCKAHVTxnuFya9tehx7kh57sTlTEi1ieDaM,2198
242
- wbfdm/models/instruments/querysets.py,sha256=c9fbHVvIRyaFU7jm_CM90lfIVzB8beOD8YII9-FqdT4,7191
242
+ wbfdm/models/instruments/querysets.py,sha256=HasdW7fzDnQk1L-TN2RhaasPGRZ9ohOqcT_n5VwdwHE,7565
243
243
  wbfdm/models/instruments/utils.py,sha256=88jnWINSSC0OwH-mCEOPLZXuhBCtEsxBpSaZ38GteaE,1365
244
244
  wbfdm/models/instruments/llm/__init__.py,sha256=dSmxRmEWb0A4O_lUoWuRKt2mBtUuLCTPVVJqGyi_n40,52
245
245
  wbfdm/models/instruments/llm/create_instrument_news_relationships.py,sha256=f9MT-8cWYlexUfCkaOJa9erI9RaUNI-nqCEyf2tDkbA,3809
@@ -357,6 +357,6 @@ wbfdm/viewsets/statements/__init__.py,sha256=odxtFYUDICPmz8WCE3nx93EvKZLSPBEI4d7
357
357
  wbfdm/viewsets/statements/statements.py,sha256=gA6RCI8-B__JwjEb6OZxpn8Y-9aF-YQ3HIQ7e1vfJMw,4304
358
358
  wbfdm/viewsets/technical_analysis/__init__.py,sha256=qtCIBg0uSiZeJq_1tEQFilnorMBkMe6uCMfqar6-cLE,77
359
359
  wbfdm/viewsets/technical_analysis/monthly_performances.py,sha256=O1j8CGfOranL74LqVvcf7jERaDIboEJZiBf_AbbVDQ8,3974
360
- wbfdm-1.51.5.dist-info/METADATA,sha256=TaKLWPf99XxSz7Uu_EMluMgcQOHChYLVun8pTrb9uzc,737
361
- wbfdm-1.51.5.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
362
- wbfdm-1.51.5.dist-info/RECORD,,
360
+ wbfdm-1.51.6.dist-info/METADATA,sha256=UajfNZ0qZeffUqv11ysJ6twqExgP0fst9NtxF8KU3uk,737
361
+ wbfdm-1.51.6.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
362
+ wbfdm-1.51.6.dist-info/RECORD,,
File without changes