MCPcopy
hub / github.com/dask/dask / __call__

Method __call__

dask/dataframe/dask_expr/datasets.py:159–183  ·  view source on GitHub ↗
(self, start, end, state_data)

Source from the content-addressed store, hash-verified

157 self.kwargs = kwargs
158
159 def __call__(self, start, end, state_data):
160 dtypes = self.dtypes
161 columns = self.columns
162 freq = self.freq
163 kwargs = self.kwargs
164 state = np.random.RandomState(state_data)
165 index = pd.date_range(start=start, end=end, freq=freq, name="timestamp")
166 data = {}
167 for k, dt in dtypes.items():
168 kws = {
169 kk.rsplit("_", 1)[1]: v
170 for kk, v in kwargs.items()
171 if kk.rsplit("_", 1)[0] == k
172 }
173 # Note: we compute data for all dtypes in order, not just those in the output
174 # columns. This ensures the same output given the same state_data, regardless
175 # of whether there is any column projection.
176 # cf. https://github.com/dask/dask/pull/9538#issuecomment-1267461887
177 result = make[dt](len(index), state, **kws)
178 if k in columns:
179 data[k] = result
180 df = pd.DataFrame(data, index=index, columns=columns)
181 if df.index[-1] == end:
182 df = df.iloc[:-1]
183 return df
184
185
186def timeseries(

Callers

nothing calls this directly

Calls 3

rsplitMethod · 0.80
RandomStateMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected