NREL / reV

Renewable Energy Potential (reV) Model
https://nrel.github.io/reV/
BSD 3-Clause "New" or "Revised" License
107 stars 24 forks source link

Generation `max_workers` defaults to `None` if omitted from config file #435

Closed ppinchuk closed 1 year ago

ppinchuk commented 1 year ago

Mostly a QOL change - it has no impact if the user explicitly specifies max_workers in their config file. However, if the user omits this input from their config file altogether, the default value is set to None instead of 1. The default value for the API is still 1.

ppinchuk commented 1 year ago

Yea the setdefault() function will add the key to the dictionary if it's missing with a value of None by default. If the key is in the dictionary, the function just returns the value and leaves the dictionary unchanged.

No need for any new GAPs functionality - we simply perform a pre-processing check on the config and force a default value if needbe.

codecov-commenter commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (2763063) 87.00% compared to head (ec710b6) 87.07%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #435 +/- ## ========================================== + Coverage 87.00% 87.07% +0.06% ========================================== Files 122 122 Lines 17016 17057 +41 ========================================== + Hits 14805 14852 +47 + Misses 2211 2205 -6 ``` | [Flag](https://app.codecov.io/gh/NREL/reV/pull/435/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/NREL/reV/pull/435/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL) | `87.07% <100.00%> (+0.06%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NREL#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.