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 codebase to abstract away functionality from lava.py into separate modules #25

Open
Allan-Cao opened this issue Oct 8, 2022 · 3 comments

Comments

@Allan-Cao
Copy link
Contributor

Currently, almost all logic is in the lava.py module. This makes the code hard to maintain and difficult to manage. This also makes the code impossible to unit test, which should be something done in the future. Logic should be abstracted into separate folders and made into python modules by adding an init.py file. See: https://packaging.python.org/en/latest/guides/packaging-namespace-packages/

@Steeeephen
Copy link
Owner

Yeah the plan is to separate the app from the LAVA module and make LAVA more of a standalone module with a pip installation

For context, the current format is a result of 'college project that has everything in one place' and it just kinda grew from there as more and more was added - resulting in a bit of a mess. But the refactor currently in progress is something along these lines

lava
├── app.py
├── requirements.txt
├── app_assets/ 
├── README.md
├── docker/
     └── everything for deploying the app on docker
└── lava
    ├── __init__.py
    ├── setup.py
    ├── README.md
    ├── requirements.txt
    ├── lava.py - heavily cleaned up, pretty much just a wrapper for all the functions in the subfolders
    ├── utils/
        └── blah blah any and all util files, separated more granularly
    ├── graphing/
        └── everything to do with graphing, also separated more granularly
    ├── assets/
        └── all the images needed for tracking
    ├── tests/
    ├── docs/

with the lava/ subdirectory serving as a standalone project that'll be installable via pip. Much more like the structure we used for Buzzwords rather than the mess that LAVA is right now

@Allan-Cao
Copy link
Contributor Author

Yeah this format is good. Do you have an ETA on when you will be able to finish this as it is a blocker for any development moving forwards. Not sure if my current PR blocks this but just incase I will fix the issues by end of day.

@Steeeephen
Copy link
Owner

ETA would be ~2 weeks, we've just finished a big project at work so I'll have more time for open source in the next couple of weeks. Will keep you updated.

Nothing you do will be a blocker, I'll sort out the rebase when the refactor is good to go

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