Skip to content

Code Style: pre commit #266

Merged
rpartzsch merged 6 commits into
SiLab-Bonn:masterfrom
rpartzsch:pre-commit
Apr 22, 2026
Merged

Code Style: pre commit #266
rpartzsch merged 6 commits into
SiLab-Bonn:masterfrom
rpartzsch:pre-commit

Conversation

@rpartzsch
Copy link
Copy Markdown
Contributor

Added and applied pre-commit hooks. The hooks are basically the same as used in obelix1-daq and are also checked in the CI.

The code style hooks consist of:

Isort sorts imports
ruff Checks and fixed code-style. The maximum line length is set to 180.
pre-commit from this package the end-of-file-fixer and trailing-whitespace are used and applied.

This applies of course many changes to the repository but these changes are only style based.

In response to #257.

@rpartzsch rpartzsch requested a review from cbespin April 21, 2026 07:38
Comment thread basil/HL/arduino_env_readout.py
Comment thread basil/HL/arduino_ntc_readout.py Outdated
Comment thread basil/HL/binder_mk53.py Outdated
Comment thread basil/HL/gpio.py Outdated
Comment thread basil/HL/NTCRegister.py
Comment on lines -41 to -42
self.R_RATIO = np.array([18.85, 14.429, 11.133, 8.656, 6.779, 5.346, 4.245, 3.393, 2.728, 2.207, 1.796, 1.47, 1.209, 1.0, 0.831, 0.694, 0.583, 0.491, 0.416, 0.354, 0.302, 0.259, 0.223, 0.192, 0.167, 0.145, 0.127, 0.111, 0.0975, 0.086, 0.076, 0.0674, 0.0599, 0.0534])
self.B_CONST = np.array([3140, 3159, 3176, 3194, 3210, 3226, 3241, 3256, 3270, 3283, 3296, 3308, 3320, 3332, 3343, 3353, 3363, 3373, 3382, 3390, 3399, 3407, 3414, 3422, 3428, 3435, 3441, 3447, 3453, 3458, 3463, 3468, 3473, 3478])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another occurrence that should be wrapped with magic comment to prevent the line breaks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can still think whats better, a exception and a single line or this long array over multiple line. I am fine with both. I think both are not really nicely readable...

Comment thread basil/HL/weiss_labevent.py
Comment thread basil/HL/weiss_sb22.py Outdated
Comment thread examples/tdc_bdaq/tdc_bdaq.py Outdated
Comment thread pyproject.toml Outdated
@cbespin
Copy link
Copy Markdown
Contributor

cbespin commented Apr 21, 2026

I think some of the remarks solve themselves when the line length is smaller. Not sure if we want to proceed anyway and then make a follow-up reducing the line length.

This was linked to issues Apr 21, 2026
Copy link
Copy Markdown
Contributor

@cbespin cbespin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for the work

@rpartzsch rpartzsch merged commit a7c349b into SiLab-Bonn:master Apr 22, 2026
6 checks passed
@rpartzsch rpartzsch deleted the pre-commit branch April 22, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pre-commit Use Black for formating

2 participants