Skip to content

[FIX] Spectrum edited name#365

Merged
Gautzilla merged 5 commits intoProject-OSmOSE:mainfrom
Gautzilla:fix/spectrum-edited-name
Apr 3, 2026
Merged

[FIX] Spectrum edited name#365
Gautzilla merged 5 commits intoProject-OSmOSE:mainfrom
Gautzilla:fix/spectrum-edited-name

Conversation

@Gautzilla
Copy link
Copy Markdown
Contributor

🐳 What's up?

There was a bug where deserializing a Dataset would not keep the Data names: it supposed the names were still the default names, and tried to parse the timestamp from it, rather than using the timestamp stored in the serialized file.

It should now work properly:

ads = AudioDataset(
    ...
)

for idx, ad in enumerate(ads.data):
    ad.name = str(idx)
    
ads.write_json(folder)

for idx, ad in enumerate(AudioDataset.from_json(folder / f"{ads.name}.json").data):
    assert ad.name == str(idx)

🐠 Note

This PR closes #363

@Gautzilla Gautzilla requested a review from mathieudpnt April 2, 2026 15:05
@Gautzilla Gautzilla self-assigned this Apr 2, 2026
@Gautzilla Gautzilla added the bug Something isn't working label Apr 2, 2026
@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 98.834% (+0.006%) from 98.828%
when pulling fda0f77 on Gautzilla:fix/spectrum-edited-name
into 23ef208 on Project-OSmOSE:main.

@Gautzilla Gautzilla merged commit 4bf1dbf into Project-OSmOSE:main Apr 3, 2026
2 checks passed
@Gautzilla Gautzilla deleted the fix/spectrum-edited-name branch April 3, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SPECTRUM | SPECTROGRAM transform fails if the SpectroData name has been edited

3 participants