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

Python refactoring? #99

Open
techdragon opened this issue Feb 22, 2023 · 0 comments
Open

Python refactoring? #99

techdragon opened this issue Feb 22, 2023 · 0 comments

Comments

@techdragon
Copy link

techdragon commented Feb 22, 2023

Currently the python component is... a bit quirky.

The a few things I've found which seem sort of easy to fix if your interested in getting PRs for each of them:

  • app.py getting transformed into __main__.py and the __init__.py being echoed into the python package from a shell script, definitely resulted in several minutes of confusion looking for the python library code (which I'd like to be able to save other devs in future)
  • The level of code duplication between Python app.py and JavaScript app.js seems like it could be improved but that would require one to depend on the other.
  • The need to use the import module to import it as the package doesn't use a "normal import mechanism" compatible name. Some find and replace work will get this taken care of.
  • Performing re.compile()(import aliased from re import compile as recompile) during class init instead of as part of a module load
  • Having everything in __main__.py makes it more challenging to read and understand things than it needs to be.
  • The deeply nested sections of data processing use a lot of helper functions that could be moved to the module level and tidied a bit by inverting some if conditions to remove unnecessary use of pass and putting the actually desired output inside the else

I suppose the TLDR is... There's quite a lot of refactoring opportunities in the python code (and the python packaging) but the code also looks like it has a very personal style, so if you would prefer to not have significant refactoring PRs submitted, then it would be good to know before I went ahead and wrote one, or multiple 😅

@qeeqbox qeeqbox deleted a comment from kingstar788 Apr 28, 2023
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

1 participant