build_renewable_profiles: improve logging of time passed
This commit is contained in:
parent
838ee4d913
commit
92df7bbb9c
@ -277,15 +277,14 @@ if __name__ == "__main__":
|
|||||||
snakemake.input.country_shapes, buffer=buffer, invert=True
|
snakemake.input.country_shapes, buffer=buffer, invert=True
|
||||||
)
|
)
|
||||||
|
|
||||||
kwargs = dict(nprocesses=nprocesses, disable_progressbar=noprogress)
|
logger.info("Calculate landuse availability...")
|
||||||
if noprogress:
|
|
||||||
logger.info("Calculate landuse availabilities...")
|
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
|
||||||
|
kwargs = dict(nprocesses=nprocesses, disable_progressbar=noprogress)
|
||||||
availability = cutout.availabilitymatrix(regions, excluder, **kwargs)
|
availability = cutout.availabilitymatrix(regions, excluder, **kwargs)
|
||||||
|
|
||||||
duration = time.time() - start
|
duration = time.time() - start
|
||||||
logger.info(f"Completed availability calculation ({duration:2.2f}s)")
|
logger.info(f"Completed landuse availability calculation ({duration:2.2f}s)")
|
||||||
else:
|
|
||||||
availability = cutout.availabilitymatrix(regions, excluder, **kwargs)
|
|
||||||
|
|
||||||
# For Moldova and Ukraine: Overwrite parts not covered by Corine with
|
# For Moldova and Ukraine: Overwrite parts not covered by Corine with
|
||||||
# externally determined available areas
|
# externally determined available areas
|
||||||
@ -304,8 +303,19 @@ if __name__ == "__main__":
|
|||||||
func = getattr(cutout, resource.pop("method"))
|
func = getattr(cutout, resource.pop("method"))
|
||||||
if client is not None:
|
if client is not None:
|
||||||
resource["dask_kwargs"] = {"scheduler": client}
|
resource["dask_kwargs"] = {"scheduler": client}
|
||||||
|
|
||||||
|
logger.info("Calculate average capacity factor...")
|
||||||
|
start = time.time()
|
||||||
|
|
||||||
capacity_factor = correction_factor * func(capacity_factor=True, **resource)
|
capacity_factor = correction_factor * func(capacity_factor=True, **resource)
|
||||||
layout = capacity_factor * area * capacity_per_sqkm
|
layout = capacity_factor * area * capacity_per_sqkm
|
||||||
|
|
||||||
|
duration = time.time() - start
|
||||||
|
logger.info(f"Completed average capacity factor calculation ({duration:2.2f}s)")
|
||||||
|
|
||||||
|
logger.info("Calculate weighted capacity factor time series...")
|
||||||
|
start = time.time()
|
||||||
|
|
||||||
profile, capacities = func(
|
profile, capacities = func(
|
||||||
matrix=availability.stack(spatial=["y", "x"]),
|
matrix=availability.stack(spatial=["y", "x"]),
|
||||||
layout=layout,
|
layout=layout,
|
||||||
@ -315,6 +325,9 @@ if __name__ == "__main__":
|
|||||||
**resource,
|
**resource,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
duration = time.time() - start
|
||||||
|
logger.info(f"Completed weighted capacity factor time series calculation ({duration:2.2f}s)")
|
||||||
|
|
||||||
logger.info(f"Calculating maximal capacity per bus (method '{p_nom_max_meth}')")
|
logger.info(f"Calculating maximal capacity per bus (method '{p_nom_max_meth}')")
|
||||||
if p_nom_max_meth == "simple":
|
if p_nom_max_meth == "simple":
|
||||||
p_nom_max = capacity_per_sqkm * availability @ area
|
p_nom_max = capacity_per_sqkm * availability @ area
|
||||||
|
Loading…
Reference in New Issue
Block a user