Skip to content

Commit

Permalink
Chore: Make release 1.0.79
Browse files Browse the repository at this point in the history
  • Loading branch information
martinroberson committed May 22, 2024
1 parent e9e365e commit 32316fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gs_quant/markets/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def __init__(self,
:param market_behaviour: the behaviour to build the curve for pricing ('ContraintsBased' or 'Calibrated'
(defaults to ContraintsBased))
:param set_parameters_only: if true don't stop embedded pricing contexts submitting their jobs.
:param use_historical_diddles_only: if true only use historical diddles
:param provider: GenericRiskApi implementation to use for pricing requests
**Examples**
Expand Down Expand Up @@ -215,6 +216,7 @@ def __save_attrs_to(self, attr_dict):
attr_dict['provider'] = self.__provider
attr_dict['_max_concurrent'] = self.__max_concurrent
attr_dict['_max_per_batch'] = self.__max_per_batch
attr_dict['use_historical_diddles_only'] = self.__use_historical_diddles_only

def _inherited_val(self, parameter, default=None, from_active=False):
if from_active:
Expand Down Expand Up @@ -253,6 +255,7 @@ def _on_enter(self):
self.__provider = self.provider
self.__max_concurrent = self._max_concurrent
self.__max_per_batch = self._max_per_batch
self.__use_historical_diddles_only = self.use_historical_diddles_only

def __reset_atts(self):
self.__pricing_date = self.__attrs_on_entry.get('pricing_date')
Expand Down Expand Up @@ -322,7 +325,7 @@ def run_requests(requests_: list, provider_, create_event_loop: bool, pc_attrs:

for (params, scenario, dates_markets, risk_measures), instruments in grouped_requests.items():
date_chunk_size = (1 if self._group_by_date else self._max_per_batch) if provider.batch_dates \
else len(dates_markets)
else len(dates_markets)
for insts_chunk in [tuple(filter(None, i)) for i in
zip_longest(*[iter(instruments)] * self._max_per_batch)]:
for dates_chunk in [tuple(filter(None, i)) for i in
Expand Down Expand Up @@ -490,6 +493,12 @@ def visible_to_gs(self) -> Optional[bool]:
def set_parameters_only(self) -> bool:
return self.__set_parameters_only

@property
def use_historical_diddles_only(self) -> bool:
if self.__use_historical_diddles_only is not None:
return self.__use_historical_diddles_only
return self._inherited_val('self.__use_historical_diddles_only', default=False)

def clone(self, **kwargs):
clone_kwargs = {k: getattr(self, k, None) for k in signature(self.__init__).parameters.keys()}
clone_kwargs.update(kwargs)
Expand Down

0 comments on commit 32316fd

Please sign in to comment.