askap-vast / vast-post-processing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functionality Reorganization

hansenjiang opened this issue · comments

The functionality of the project currently resides in both isolated modules and within functions in modules designed to be called from the command line. For effective implementation and separation of logic they should be restructured.

  • Identify purpose, structure, and location of functionality
  • Reorganize by separating logic from operations
  • Restructure package with clear and documented modules and subpackages
  1. Created branch dev-reorg.
  2. Added import statements and updated __init__ modules in each subpackage.
  3. Added utils subpackage.
  4. Added validation module.
  5. Created directories scripts and docker.
  6. Added READMEs to each directory to explain which files belong where.

Now, structure looks like this -

Image

  1. For each module in cli (except run_crop), removed programming logic and placed in relevant base module
    1. e.g. all logic in cli.cleanup was moved to utils.fileutils, all logic in cli.convolve_neighbours to neighbours, etc.
  2. Renamed main functions to corresponding module names
    1. e.g. cli.correct_vast.main() moved to corrections and renamed to corrections.correct_vast()
  3. Made calls to renamed functions from cli modules
    1. Now, each cli module only runs typer, interprets arguments, and calls functions from corresponding modules

Successful run of cli.correct_vast following logic separation. Likely did not break anything during separation.

Marking as closed, as cli functionality and calls formally separated in dev branch. Documentation and organization will be added and addressed by #32.