Skip to content

Code organization and convention

Fabrice edited this page Mar 11, 2023 · 11 revisions

Code organization

A modular approach is attempted to get shorter files. Additional classes are built to reduce the size of objects.

Convention

Formatting

PEP-8 limit of 80 characters is not considered.

Functions

Always start with a verb followed by nouns and additional information if needed. Names of instances must not be used, instead the descriptives names of the object should be used. -> GUI or Application for root window.

Start of name

Change message of status -> set_

For widget creation -> create_

Prepare something -> setup_ or define_

Plot one or several curves or update a plot -> plot_

End of name

Tabbed panel in notebook -> _tab

Modification of curve out of Curve class -> _curve

Variables

Composition in classes links main GUI class to lower level classes. Master class of widget -> self.parent

Constants

Always with UPPER CASE.

End of name

Frame -> _frame

Button -> _btn

Checkbox -> _cbox

Radio button -> _radio

Clone this wiki locally