Skip to content

Convention

Benjamin Loire edited this page Mar 30, 2023 · 1 revision

PEP8 reminders

  • 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).

OSmOSE conventions

  • Units are not written in variable names.
  • Variables follow the convention name_descriptor when possible (eg dataset_name, spectro_duration).
  • Only shorten names when their meaning is unambiguous (frequency => freq, spectrogram => spectro).
  • The term origin refers 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.

Clone this wiki locally