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

Code maintainability - utils/__init__.py split (?) #1677

Open
stan-dot opened this issue Apr 4, 2024 · 3 comments · May be fixed by #1734
Open

Code maintainability - utils/__init__.py split (?) #1677

stan-dot opened this issue Apr 4, 2024 · 3 comments · May be fixed by #1734
Assignees
Labels
design-discussion good first issue hackathon Good issues for the upcoming bluesky hackathon maintenance

Comments

@stan-dot
Copy link
Contributor

stan-dot commented Apr 4, 2024

At the moment the class in question is 1870 lines of code. Some of them do with await logic, some are syntactic sugar, some format outputs (ProgressBar), callbacks (CallbackRegistry), and control signals (SigIntHandler).

Expected Behavior

We get about a dozen files in /utils instead.

Current Behavior

Easier to locate where a change needs to happen and to recognize what changed.

Possible Solution

Just a new file for every logical chunk - likely bundling 2-3 connected classes at a time, or a set of functions all dealing with one functionality.

@stan-dot stan-dot added maintenance good first issue design-discussion hackathon Good issues for the upcoming bluesky hackathon labels Apr 4, 2024
@callumforrester
Copy link
Contributor

There has been a lot of previous philosophical discussion on whether lots of small files or a few large files are more maintainable in Python projects. I think it is one of these things that will never have much consensus. This particular repo goes for the "few large files" route so I think we should stick to that. One thing we could do is put the utils code inside __init__.py in a more obvious place i.e. utils/_utils.py and shim via __all__, but not sure that would be worth the effort.

@callumforrester
Copy link
Contributor

Reviewers: @RobertSchaffer1

@callumforrester
Copy link
Contributor

@prjemian suggests breaking up further in #1723

@skarakuzu skarakuzu linked a pull request Apr 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-discussion good first issue hackathon Good issues for the upcoming bluesky hackathon maintenance
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants