torchsig.utils.file_handlers.npy

torchsig.utils.file_handlers.npy

File-handler that exposes a directory of standard NumPy *.npy files as a TorchSig Signal dataset. A TorchSig dataset is described by three co-located artefacts: * One or more ``*.npy`` files - each file stores a 1-D NumPy array of

complex samples.

  • A ``metadata.csv`` file - one row per global waveform index, containing index,label,modcod,sample_rate.

  • An ``info.json`` file - a tiny JSON document that must contain at least {\"size\": <int>} and defines the advertised length of the dataset.

The heavy binary payload lives in the *.npy files; the human-readable description lives in the CSV. This separation keeps loading fast (memory-mapped NumPy) while allowing easy inspection and editing of labels, modulation codes, etc.

Classes

NPYReader

Read a directory that contains *.npy files, a metadata.csv and an info.json.