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 / Revise how file Paths are handled #39

Open
franTarkenton opened this issue Mar 11, 2023 · 0 comments
Open

Refactor / Revise how file Paths are handled #39

franTarkenton opened this issue Mar 11, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@franTarkenton
Copy link
Member

While there is some centralization of the file path configurations in the admin.constants.py module, code in the script is frequently building new paths from the constants provided in that module. Having the path manipulation code with business logic makes it difficult to read, and understand.

This ticket would create a path library that centralizes the calculation of paths and directories. Instead of code like:

    if sat == 'modis':
        mosaic = glob(os.path.join(const.INTERMEDIATE_TIF_MODIS, date, 'modis_composite*.tif'))[0]
    elif sat == 'viirs':
        mosaic = glob(os.path.join(const.OUTPUT_TIF_VIIRS, date.split('.')[0], f'{date}.tif'))[0]
    else:

Methods would be created to request the paths, example:

mosaic = snow_pathlib.get_intermediate_composite_tifs(sat='modis', date=date)

Long term objective is to make the code easier to understand / maintain.

@franTarkenton franTarkenton transferred this issue from bcgov/nr-rfc-admin Mar 11, 2023
@franTarkenton franTarkenton added the enhancement New feature or request label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: New Issues
Development

No branches or pull requests

1 participant