pynapple.io.folder.Folder#

class pynapple.io.folder.Folder(path)[source]#

Bases: UserDict

Dictionnary like object to walk and loop through nested folders. Handles files and sub-folders discovery

data#

Dictionary holidng all the pynapple objects found in the folder.

Type:

dict

name#

Name of the folder

Type:

str

npz_files#

List of npz files found in the folder

Type:

list

nwb_files#

List of nwb files found in the folder

Type:

list

path#

Absolute path of the folder

Type:

str

subfolds#

Dictionary of all the subfolders

Type:

dict

__init__(path)[source]#

Initialize the Folder object

Parameters:

path (str) – Path to the folder

Methods

__init__(path)

Initialize the Folder object

clear()

copy()

doc(name)

Display the metadata within the json sidecar of a NPZ file

expand()

Display the full tree view.

fromkeys(iterable[, value])

get(k[,d])

info(name)

Display the metadata within the json sidecar of a NPZ file

items()

keys()

load()

Load all compatible NPZ files.

metadata(name)

Display the metadata within the json sidecar of a NPZ file

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()

as a 2-tuple; but raise KeyError if D is empty.

save(name, obj[, description])

Save a pynapple object in the folder in a single file in uncompressed .npz format.

setdefault(k[,d])

update([E, ]**F)

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values()

Attributes

view

Summary

clear() None.  Remove all items from D.#
copy()#
doc(name)[source]#

Display the metadata within the json sidecar of a NPZ file

Parameters:

name (str) – Name of the npz file

expand()[source]#

Display the full tree view. Equivalent to Folder.view

classmethod fromkeys(iterable, value=None)#
get(k[, d]) D[k] if k in D, else d.  d defaults to None.#
info(name)[source]#

Display the metadata within the json sidecar of a NPZ file

Parameters:

name (str) – Name of the npz file

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
load()[source]#

Load all compatible NPZ files.

metadata(name)[source]#

Display the metadata within the json sidecar of a NPZ file

Parameters:

name (str) – Name of the npz file

pop(k[, d]) v, remove specified key and return the corresponding value.#

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() (k, v), remove and return some (key, value) pair#

as a 2-tuple; but raise KeyError if D is empty.

save(name, obj, description='')[source]#

Save a pynapple object in the folder in a single file in uncompressed .npz format. By default, the save function overwrite previously save file with the same name.

Parameters:
  • name (str) – Filename

  • obj (Ts, Tsd, TsdFrame, TsGroup or IntervalSet) – Pynapple object.

  • description (str, optional) – Metainformation added as a json sidecar.

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D#
update([E, ]**F) None.  Update D from mapping/iterable E and F.#

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values() an object providing a view on D's values#
property view#

Summary