-
Notifications
You must be signed in to change notification settings - Fork 7
Convention
Benjamin Loire edited this page Mar 30, 2023
·
1 revision
- Class names are written in PascalCase (eg
Dataset). - Everything else (variables, functions...) are in snake_case (eg
dataset_path). - Weak privacy : class attributes and methods with one leading underscore are intended for internal use, although the privacy is not effectively enforced (eg
_find_or_create_original_folder). - Strong privacy : class attributes and methods with two leading underscores are private, and not easily accessible from outside the class (eg
self.__sr_analysis).
- Units are not written in variable names.
- Variables follow the convention
name_descriptorwhen possible (egdataset_name,spectro_duration). - Only shorten names when their meaning is unambiguous (frequency =>
freq, spectrogram =>spectro). - The term
originrefers to the initial state of a dataset (describing the raw data). - If a module has to create specific folders or create temporary/metadata files before it is ready to be used, all such operations must be in an
initialize()method.