Steeeephen / LAVA

LoL Automated Video Analytics: Open-Source VoD Analytics Tool for League of Legends
https://github.com/Steeeephen/LAVA/wiki
Apache License 2.0
27 stars 2 forks source link

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

Open Allan-Cao opened 2 years ago

Allan-Cao commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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