LAVA icon indicating copy to clipboard operation
LAVA copied to clipboard

Refactor codebase to abstract away functionality from lava.py into separate modules

Open Allan-Cao opened this issue 2 years ago • 3 comments

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/

Allan-Cao avatar Oct 08 '22 20:10 Allan-Cao

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

Steeeephen avatar Oct 09 '22 12:10 Steeeephen

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.

Allan-Cao avatar Oct 09 '22 17:10 Allan-Cao

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

Steeeephen avatar Oct 21 '22 13:10 Steeeephen