-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
🐳 SPRING CLEANING TIME
Before releasing a v1.0.0 of OSEkit, I'd like to make some changes in the API naming because lots of it seem quite confusing.
e.g. the single Dataset word means several different things, Analysis is unclear, analysis_dataset makes me wake up in tears in the middle of the night.
I'll use this issue to suggest some renamings, with a full example using a new naming convention.
If OSEkit users (@PaulCarvaillo @PCarvaillo @MaelleTtrt @mathieudpnt @ElodieENSTA @cazaudo @naiscd ...) have some feedback on these suggestions or want to add some, it'd be great!
🐬 Suggested changes
| old name | new name | example |
|---|---|---|
Dataset |
Project |
project = Project(folder=..., ...) |
Analysis |
Transform |
transform = Transform() |
AnalysisType |
OutputType |
transform = Transform(outputs=OutputType.AUDIO) |
AnalysisType.MATRIX |
OutputType.SPECTRUM |
|
Dataset.run_analysis() |
Project.run() |
|
Dataset.get_analysis_audiodataset() |
Project.prepare_audio() |
|
Dataset.get_analysis_spectrodataset() |
Project.prepare_spectrum() |
|
core_api |
core |
from osekit.core.audio_dataset import AudioDataset |
public_api |
public |
from osekit.public.transform import Transform |
🐬 Exemple
It would lead to something like that, which IMO is a bit cleaner than the current semantics of the API:
from osekit.public.project import Project
from pathlib import Path
from osekit.core.audio_dataset import AudioDataset
from osekit.public.transform import Transform, OutputType
# PROJECT BUILD
project = Project(
folder = Path(r"cool_folder"),
...
)
project.build()
# TRANSFORM DECLARATION
transform = Transform(
outputs = OutputType.AUDIO | OutputType.SPECTRUM,
...
)
## WITH CORE FILTERING
ads = project.prepare_audio(transform=transform)
ads.data = ads.data[:10]
# TRANSFORM RUN
project.run(transform=transform, audio_dataset=ads)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels