datfid 0.1.14__py3-none-any.whl → 0.1.16__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.
datfid/client.py CHANGED
@@ -145,7 +145,7 @@ class DATFIDClient:
145
145
  self.logger.error(f"Forecast generation failed: {str(e)}")
146
146
  raise
147
147
 
148
- def fit_model_ind(
148
+ def fit_model_ind(
149
149
  self,
150
150
  df: pd.DataFrame,
151
151
  id_col: str,
@@ -156,7 +156,7 @@ def fit_model_ind(
156
156
  current_features: Optional[list] = None,
157
157
  filter_by_significance: bool = False,
158
158
  meanvar_test: bool = False
159
- ) -> SimpleNamespace:
159
+ ) -> Dict[str, SimpleNamespace]:
160
160
  """
161
161
  Fit a model individual by individual using the DATFID API.
162
162
 
@@ -200,10 +200,12 @@ def fit_model_ind(
200
200
  if response.status_code != 200:
201
201
  raise Exception(f"Model fit failed: {response.text}")
202
202
 
203
- result_dict = response.json()
204
- return SimpleNamespace(**result_dict)
203
+ raw = response.json() # { "<id>": { ... per-id result ... }, ... }
204
+ # Wrap each per-id result into a SimpleNamespace for dot access:
205
+ result_per_id = {str(k): SimpleNamespace(**v) for k, v in raw.items()}
206
+ return result_per_id # Dict[str, SimpleNamespace]
205
207
 
206
- def forecast_model_ind(
208
+ def forecast_model_ind(
207
209
  self,
208
210
  df_forecast: pd.DataFrame
209
211
  ) -> pd.DataFrame:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datfid
3
- Version: 0.1.14
3
+ Version: 0.1.16
4
4
  Summary: SDK to access the DATFID API hosted on Hugging Face Spaces
5
5
  Author: DATFID
6
6
  Author-email: igor.schapiro@datfid.com
@@ -0,0 +1,7 @@
1
+ datfid/__init__.py,sha256=PojdUQsimZvawR8lgqVpzs3EkRtkA7iwuDk7fovJF54,34
2
+ datfid/client.py,sha256=uza0OZBtm5aQF0xdFF2TIBUOYeQ9zYmX-hS8-OBXWqw,8267
3
+ datfid-0.1.16.dist-info/licenses/LICENSE,sha256=5b2JLb1-P8Nt919phjUmP0umS82SxGMlIF2QFn9ILgM,1084
4
+ datfid-0.1.16.dist-info/METADATA,sha256=frz6VkxxFwrNeY7-ZbN2U4H7nCwN3-DIH9WkEQyHJtU,5146
5
+ datfid-0.1.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ datfid-0.1.16.dist-info/top_level.txt,sha256=VFG23u9NMNQJ8S_IFfW-S5d8oSUd71SFA346ovh_uxA,7
7
+ datfid-0.1.16.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- datfid/__init__.py,sha256=PojdUQsimZvawR8lgqVpzs3EkRtkA7iwuDk7fovJF54,34
2
- datfid/client.py,sha256=U2fuj2nPadXAQ0lGdVinu0ShWdeC4pHWwK1nNhPQD0E,8045
3
- datfid-0.1.14.dist-info/licenses/LICENSE,sha256=5b2JLb1-P8Nt919phjUmP0umS82SxGMlIF2QFn9ILgM,1084
4
- datfid-0.1.14.dist-info/METADATA,sha256=KHLb4wwu5ZIaFfI5R_GMa-_nhVFXo053t3CqYi_C6VE,5146
5
- datfid-0.1.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- datfid-0.1.14.dist-info/top_level.txt,sha256=VFG23u9NMNQJ8S_IFfW-S5d8oSUd71SFA346ovh_uxA,7
7
- datfid-0.1.14.dist-info/RECORD,,