MCPcopy Create free account
hub / github.com/ScottfreeLLC/AlphaPy / dump_frames

Function dump_frames

alphapy/frame.py:282–311  ·  view source on GitHub ↗

r"""Save a group of data frames to disk. Parameters ---------- group : alphapy.Group The collection of frames to be saved to the file system. directory : str Full directory specification. extension : str File name extension, e.g., ``csv``. separator :

(group, directory, extension, separator)

Source from the content-addressed store, hash-verified

280#
281
282def dump_frames(group, directory, extension, separator):
283 r"""Save a group of data frames to disk.
284
285 Parameters
286 ----------
287 group : alphapy.Group
288 The collection of frames to be saved to the file system.
289 directory : str
290 Full directory specification.
291 extension : str
292 File name extension, e.g., ``csv``.
293 separator : str
294 The delimiter between fields in the file.
295
296 Returns
297 -------
298 None : None
299
300 """
301 logger.info("Dumping frames from %s", directory)
302 gnames = [item.lower() for item in group.members]
303 gspace = group.space
304 for gn in gnames:
305 fname = frame_name(gn, gspace)
306 if fname in Frame.frames:
307 logger.info("Writing Data Frame for %s", fname)
308 df = Frame.frames[fname].df
309 write_frame(df, directory, fname, extension, separator, index=True)
310 else:
311 logger.info("Data Frame for %s not found", fname)
312
313
314#

Callers

nothing calls this directly

Calls 2

frame_nameFunction · 0.85
write_frameFunction · 0.85

Tested by

no test coverage detected