Skip to content

Global variables #3

Description

@hkatty

Global variables defined from command line using parse_args at module level prevents usage of individual functions outside of set workflows.

A quick temporary workaround is to put parse_args (and config_args/mip_info) under if __name__ == "__main__", then define each variable as needed in the script where the functions are used.

e.g.:

import isimip_func
isimip_func.MIPNAME = 'isimip3b'
sorted_cube = isimip_func.sort_isimip_cube(cube, '')

However, this would break current command line workflows where e.g. isimip_func is used in process_jules and both contain an identical parse_args().

Ideally, refactoring all global variables to be passed as function arguments should help with usability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions