Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix footprint return type of get_runtime_config
This is arguably one of those places where static type checking and python do not play particually well together, but this does allow mypy to report all is well. The issue here is that the optional command line argument 'footprint' results in get_runtime_config getting hold of values for PUE and jobinfo. These are used by carbonFootprint.py's get_footprint_reduction_estimate. If footprint is not passed in we should return some null value. The presence of the same command line argument is checked in main before dispatching to get_footprint_reduction_estimate so it does not really matter what those values are if footprint is not selected. It feels "pythonic" to return None, but get_footprint_reduction_estimate cannot handle None so mypy is unhappy. Instead we return 'zero' values in the "correct" types. A better solution, probably, would be to bundle jobinfo and PUE into a container of some sort that can be tested in main and passed into get_footprint_reduction_estimate.
- Loading branch information