-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Title: Avoid Global Variables and Potential Name Collisions: Use args Directly
Body:
The script uses global GLOBAL_VERBOSE and global GLOBAL_CONFIG.
- Explicitly defining global variables, especially when they can be easily accessed from the
argsnamespace, is generally considered bad practice. It makes the code harder to reason about and can lead to unintended side effects. It's generally best to avoid globals. - There is a potential name collision between
GLOBAL_DEBUGinanalyze_ccw.pyandGLOBAL_FORCEinata.pyfiles.
Consider these changes:
- Instead of using
global GLOBAL_VERBOSEandglobal GLOBAL_CONFIGinmain()function, pass the necessary variables as arguments:
def main(results_csv, output_file, verbose, config):
df = pd.read_csv(results_csv)
# access the configs via config dict.
...
if __name__ == "__main__":
#...
main(args.results, args.output, args.verbose, GLOBAL_CONFIG)File: ata.py
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels