diff --git a/README.md b/README.md index 6d8378da..57b928bc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Please refer to [Goldman Sachs Developer](https://developer.gs.com/docs/gsquant/ ## Requirements -* Python 3.6 or greater +* Python 3.8 or greater * Access to PIP package manager ## Installation diff --git a/gs_quant/api/gs/assets.py b/gs_quant/api/gs/assets.py index d982b9af..15b87ead 100644 --- a/gs_quant/api/gs/assets.py +++ b/gs_quant/api/gs/assets.py @@ -382,7 +382,7 @@ def get_asset_positions_for_dates( start_date_str = start_date.isoformat() if periods > 1: - end_dates = pd.date_range(start=start_date, end=end_date, periods=periods, closed='right') + end_dates = pd.date_range(start=start_date, end=end_date, periods=periods, inclusive='right') for date in end_dates: end_date_str = date.date().isoformat() url = f'/assets/{asset_id}/positions?startDate={start_date_str}&endDate={end_date_str}&type={position_type}' diff --git a/gs_quant/models/epidemiology.py b/gs_quant/models/epidemiology.py index 44da6cd5..57dafb4f 100644 --- a/gs_quant/models/epidemiology.py +++ b/gs_quant/models/epidemiology.py @@ -444,10 +444,16 @@ def get_parameters(cls, # add initial state conditions that vary by age group initial_conditions = [] - for param in ['S0', 'E0', 'I0', 'R0', 'C0', 'M0']: + for param, param_value, param_value_max, param_fixed in [ + ('S0', S0, S0_max, S0_fixed), + ('E0', E0, E0_max, E0_fixed), + ('I0', I0, I0_max, I0_fixed), + ('R0', R0, R0_max, R0_fixed), + ('C0', C0, C0_max, C0_fixed), + ('M0', M0, M0_max, M0_fixed), + ]: for k in range(K): - parameters.add(f'{param}_{k}', value=eval(param)[k], min=0, max=eval(f'{param}_max'), - vary=not eval(f'{param}_fixed')) + parameters.add(f'{param}_{k}', value=param_value[k], min=0, max=param_value_max, vary=not param_fixed) initial_conditions.append(f'{param}_{k}') return parameters, initial_conditions diff --git a/gs_quant/timeseries/measures_countries.py b/gs_quant/timeseries/measures_countries.py index 8a407502..bf40d317 100644 --- a/gs_quant/timeseries/measures_countries.py +++ b/gs_quant/timeseries/measures_countries.py @@ -22,6 +22,7 @@ from gs_quant.api.gs.data import QueryType, GsDataApi from gs_quant.data import Dataset +from gs_quant.data.core import DataContext from gs_quant.entities.entity import EntityType from gs_quant.timeseries import plot_measure_entity from gs_quant.timeseries.measures import _market_data_timed, _extract_series_from_df, \ @@ -63,9 +64,10 @@ def fci(country_id: str, measure: _FCI_MEASURE = _FCI_MEASURE.FCI, *, source: st raise NotImplementedError('real-time FCI data is not available') type_ = QueryType(inflection.titleize(measure.value)) + start, end = DataContext.current.start_date, DataContext.current.end_date if measure == _FCI_MEASURE.REAL_FCI or measure == _FCI_MEASURE.REAL_TWI_CONTRIBUTION: ds = Dataset('FCI') - df = ds.get_data(geographyId=country_id) + df = ds.get_data(geographyId=country_id, start=start, end=end) if measure == _FCI_MEASURE.REAL_FCI: measure = 'realFCI' else: diff --git a/setup.py b/setup.py index f6951e2f..7b3182e6 100644 --- a/setup.py +++ b/setup.py @@ -57,8 +57,6 @@ "backoff", "cachetools", "certifi", - "dataclasses;python_version<'3.7'", - "contextvars;python_version<'3.7'", "dataclasses_json", "deprecation", "funcsigs", @@ -69,20 +67,15 @@ "nest-asyncio", "opentracing", "numpy<2.0.0", - "pandas>1.0.0,<2.0.0;python_version<'3.7'", - "pandas>=1.4;python_version>'3.7'", + "pandas>=1.4", "pydash<7.0.0", "python-dateutil>=2.7.0", "pytz==2024.1", "requests", - "httpx>=0.23.3;python_version>'3.6'", - "scipy>=1.2.0;python_version>'3.8'", - "scipy>=1.2.0,<1.6.0;python_version<'3.7'", - "scipy>=1.2.0,<1.8.0;python_version<'3.8'", - "statsmodels<=0.12.2;python_version<'3.7'", - "statsmodels>=0.13.0;python_version>'3.6'", + "httpx>=0.23.3", + "scipy>=1.2.0", + "statsmodels>=0.13.0", "tqdm", - "typing;python_version<'3.7'", "websockets" ], extras_require={ @@ -96,7 +89,6 @@ }, classifiers=[ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10",