PyPSA / atlite

Atlite: A Lightweight Python Package for Calculating Renewable Power Potentials and Time Series
https://atlite.readthedocs.io
264 stars 89 forks source link

fix: disable_progressbar in compute_availabilitymatrix #356

Closed Irieo closed 1 month ago

Irieo commented 1 month ago

Changes proposed in this Pull Request

The function compute_availabilitymatrix() includes an option to disable the progress bar (disable_progressbar). However, for non-parallel computation path (i.e., when nprocesses is None, the code uses tqdm directly, w/o passing the disable_progressbar check. This PR fixes it. User is informed if progress bar is disabled.

Why bother: it seems that progress bar makes computation much slower. For a test case (UA, solar availability matrix, local computation, nprocesses is None) disabling progress bar speeds the process from 2000 seconds to 760 seconds. Similar behavior was observed for other atlite processes, such as build_renewable_profiles (rumor evidence).

Closes #pypsa-eur/1090

Checklist