Merge branch 'master' into cluster-m

This commit is contained in:
Fabian Neumann 2023-02-22 18:57:21 +01:00 committed by GitHub
commit 8512129f2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 13 deletions

View File

@ -39,7 +39,7 @@ repos:
# Make docstrings PEP 257 compliant
- repo: https://github.com/PyCQA/docformatter
rev: v1.6.0.rc1
rev: v1.5.1
hooks:
- id: docformatter
args: ["--in-place", "--make-summary-multi-line", "--pre-summary-newline"]
@ -67,7 +67,7 @@ repos:
# Do YAML formatting (before the linter checks it for misses)
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.6.0
rev: v2.7.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, "2", --preserve-quotes]

View File

@ -33,7 +33,6 @@ dependencies:
- networkx
- scipy
- shapely>=2.0
- progressbar2
- pyomo
- matplotlib<3.6
- proj

View File

@ -3,9 +3,11 @@
#
# SPDX-License-Identifier: MIT
import urllib
from pathlib import Path
import pandas as pd
from tqdm import tqdm
REGION_COLS = ["geometry", "name", "x", "y", "country"]
@ -251,16 +253,14 @@ def aggregate_costs(n, flatten=False, opts=None, existing_only=False):
def progress_retrieve(url, file):
import urllib
with tqdm(unit="B", unit_scale=True, unit_divisor=1024, miniters=1) as t:
from progressbar import ProgressBar
def update_to(b=1, bsize=1, tsize=None):
if tsize is not None:
t.total = tsize
t.update(b * bsize - t.n)
pbar = ProgressBar(0, 100)
def dlProgress(count, blockSize, totalSize):
pbar.update(int(count * blockSize * 100 / totalSize))
urllib.request.urlretrieve(url, file, reporthook=dlProgress)
urllib.request.urlretrieve(url, file, reporthook=update_to)
def get_aggregation_strategies(aggregation_strategies):

View File

@ -187,7 +187,6 @@ import time
import atlite
import geopandas as gpd
import numpy as np
import progressbar as pgb
import xarray as xr
from _helpers import configure_logging
from dask.distributed import Client, LocalCluster
@ -203,7 +202,6 @@ if __name__ == "__main__":
snakemake = mock_snakemake("build_renewable_profiles", technology="solar")
configure_logging(snakemake)
pgb.streams.wrap_stderr()
nprocesses = int(snakemake.threads)
noprogress = not snakemake.config["atlite"].get("show_progress", False)