Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor to PEP8 naming #18

Open
eugenkleinschmidt opened this issue Feb 12, 2024 · 3 comments
Open

refactor to PEP8 naming #18

eugenkleinschmidt opened this issue Feb 12, 2024 · 3 comments

Comments

@eugenkleinschmidt
Copy link

Is there any interest to refactor to PEP8 namings.
I would do a PR and also introducing ruff and black if in your interest.

See https://realpython.com/python-pep8/
grafik

@kxtells
Copy link
Owner

kxtells commented Feb 12, 2024

Hi @eugenkleinschmidt , thanks for reaching out.

It is true that we have a popurri here, with some functions like findSubclassesRecursively living alongside instantiate_tenma_class_from_device_response, clearly there was never an aim to adhere to PEP8.

I am not willing on changing the main API on the Tenma classes (which in the end is most of the code on this repo), since some of our users might actually use those APIs via scripts I don't think it's a good idea at all, it would just be unnecessary friction. Additionally the version should be pushed to 2.x on new releases but only because we decided to go with PEP8.

That said, I'm happy if you want to work on a github workflow that checks correctness à la flake8 but adapts to the project, but I don't know if it's worth it since you'll have to skip many of the PEP8 checks.

  • ClassNames will remain the same (so <UNIT_BRAND>_<MODEL>).
  • method names should adhere to CamelCase with some exceptions for ON, OFF, BEEP.
  • Modules.... yes, tenmaDcLib does not match with PEP8 either
  • I don't think there's many many variables, and I wonder if changing from mV to milli_volt or m_v adds anything..

I am not sure how configurable is ruff or black to adapt to this situation.

@eugenkleinschmidt
Copy link
Author

Hi, yes there is some configurability and the use of format exception are possible. A deprecation phase could be introduced where old names and public intefaces are aliased.

@eugenkleinschmidt
Copy link
Author

But makes only sense when in the long run full pep8 is wanted and strived for (maybe with exceptions like class names. Here I'm not sure😅)
So will free to close this issue

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

No branches or pull requests

2 participants