You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it is mandatory to rethink the way we structure/access/manipulate the data in OSEkit.
Global thoughts
Audio data, auxiliary data...
Data logic should be managed by base classes (e.g. Data, DataItem...). A Data instance would be as simple as some values associated with timestamps.
Specific data, like audio, should be adressed by specialized classes that inherit from the base classes: AudioData(Data), AudioDataItem(DataItem), which should contain only the audio-related stuff.
This would make the base classes code reusable for all data type: If we add an AuxiliaryData which values are just floats stored in a csv, we could reshape this data using the general methods (e.g. super().reshape(...))
Base classes structure
At the moment, I'm thinking of:
Splitting the relationship between the data and the actual files, with separate Data and DataFile classes.
In the present context, Data would represent the audio items contained within the dataset, with the user-specified duration, sampling rate, etc.
DataFile points to a file on disk, with timestamps for its begin/end date and methods to access the data within a timestamp range.
Since a single Data object could either be shorter than a file, or covering multiple files, an intermediate DataItem class should help recover the whole Data values from the files:
Data would have a list of DataItem as attribute. Methods from Data that read the data would in fact concatenate the data accessed through each DataItem
The Dataset class would just have a list of Data as attribute, and only interact with this class.
Examples of simplified operations
This would help simplifying the workflow and separing the concerns: We could do lots of stuff on the dataset without touching the original audio files (e.g. Reshape in the drawing herebelow), and add methods that consolidate the audio files on demand:
Example code
Kind of a code dump here, but that's a very simple implementation without any reshaping methods or anything:
@ElodieENSTA I have marked this as APLOSE related since it might change the relationship between the Data (with which the spectrograms are plotted) and the audio files.
Context
I think it is mandatory to rethink the way we structure/access/manipulate the data in OSEkit.
Global thoughts
Audio data, auxiliary data...
Data logic should be managed by base classes (e.g.
Data
,DataItem
...). AData
instance would be as simple as some values associated with timestamps.Specific data, like audio, should be adressed by specialized classes that inherit from the base classes:
AudioData(Data)
,AudioDataItem(DataItem)
, which should contain only the audio-related stuff.This would make the base classes code reusable for all data type: If we add an AuxiliaryData which values are just floats stored in a csv, we could reshape this data using the general methods (e.g.
super().reshape(...)
)Base classes structure
At the moment, I'm thinking of:
Data
andDataFile
classes.Data
would represent the audio items contained within the dataset, with the user-specified duration, sampling rate, etc.DataFile
points to a file on disk, with timestamps for its begin/end date and methods to access the data within a timestamp range.Data
object could either be shorter than a file, or covering multiple files, an intermediateDataItem
class should help recover the wholeData
values from the files:Data
would have a list ofDataItem
as attribute. Methods fromData
that read the data would in fact concatenate the data accessed through eachDataItem
Dataset
class would just have a list ofData
as attribute, and only interact with this class.Examples of simplified operations
This would help simplifying the workflow and separing the concerns: We could do lots of stuff on the dataset without touching the original audio files (e.g. Reshape in the drawing herebelow), and add methods that consolidate the audio files on demand:
Example code
Kind of a code dump here, but that's a very simple implementation without any reshaping methods or anything:
The text was updated successfully, but these errors were encountered: