Project-OSmOSE / datarmor-toolkit

This repo gathers all our analytical codes to process big (mostly audio) data (eg related to machine learning, ambient noise analysis…)
0 stars 6 forks source link

choice of project_name instead of campaign_name in notebook spectrogram_generator : why ? #53

Closed cazaudo closed 1 month ago

cazaudo commented 1 month ago

we should stick to metadata standards here

mathieudpnt commented 1 month ago

yes that is the reason we changed campaign to project ...

cazaudo commented 1 month ago

ok so we should remove all occurrences of "campaign" and be consistent with dataset attributes , this is weird : dataset.campaign = project_name

Gautzilla commented 1 month ago

dataset.campaign: neither Dataset nor Spectrogram classes have a campaign field, so yeah this line doesn't make much sense.

cazaudo commented 1 month ago

yes indeed , very weird it does not generate attribute errors! or does it ?

I removed all occurrences of "campaign" and replaced them with "project" on the related branch

Gautzilla commented 1 month ago

It doesn't because the attribute is added, not read:

class A:
    def __init__(self, value: int):
        self.value = value

a = A(5)
a.new_attribute = "new attribute" # No exception
print(a.new_attribute) # prints "new attribute"
print(a.unexisting_attribute) # exception

You can add an attribute from outside the class without raising an exception. It's just that I don't think the dataset.campaign attribute is read anywhere and could thus be removed from the notebook.

cazaudo commented 1 month ago

yes indeed thank you for the reminder:)

and @MaelleTtrt has already created a PR https://github.com/Project-OSmOSE/datarmor-toolkit/pull/50 so i close this issue now