|
9 | 9 | """ |
10 | 10 |
|
11 | 11 | import tempfile |
12 | | -from collections.abc import Iterable |
13 | 12 | from io import BytesIO |
14 | 13 | from pathlib import Path |
15 | 14 | from zipfile import ZipFile |
@@ -548,9 +547,9 @@ def save_to_zarr_region(ds_in, store, already_aligned=False, storage_options={}) |
548 | 547 | n_valid = len(valid_ixs) |
549 | 548 | st = valid_ixs[0] |
550 | 549 | end = valid_ixs[-1] |
551 | | - assert ( |
552 | | - end - st == n_valid - 1 |
553 | | - ), f"Indices are not continuous along dimension {r}" |
| 550 | + assert end - st == n_valid - 1, ( |
| 551 | + f"Indices are not continuous along dimension {r}" |
| 552 | + ) |
554 | 553 | regions[r] = slice(st, end + 1) |
555 | 554 |
|
556 | 555 | # align coords |
@@ -692,7 +691,7 @@ def load_ciam_inputs( |
692 | 691 | seg_vals, |
693 | 692 | # dropping the "refA_scenario_selectors" b/c this doesn't need to be added to |
694 | 693 | # the input dataset object |
695 | | - constants=params[params.map(type) != dict].to_dict(), |
| 694 | + constants=params[params.map(type) != dict].to_dict(), # noqa: E721 |
696 | 695 | seg_var=seg_var, |
697 | 696 | selectors=selectors, |
698 | 697 | storage_options=storage_options, |
@@ -791,7 +790,7 @@ def load_diaz_inputs( |
791 | 790 | inputs = prep_sliiders( |
792 | 791 | input_store, |
793 | 792 | seg_vals, |
794 | | - constants=params[params.map(type) != dict].to_dict(), |
| 793 | + constants=params[params.map(type) != dict].to_dict(), # noqa: E721 |
795 | 794 | seg_var="seg", |
796 | 795 | calc_popdens_with_wetland_area=False, |
797 | 796 | storage_options=storage_options, |
@@ -861,7 +860,7 @@ def download_and_extract_partial_zip(lpath, url, zip_glob, n_retries=5): |
861 | 860 | if not fl.is_file(): |
862 | 861 | retries = 0 |
863 | 862 | while retries < n_retries: |
864 | | - print(f"...Downloading {fl.name} (attempt {retries+1}/{n_retries})") |
| 863 | + print(f"...Downloading {fl.name} (attempt {retries + 1}/{n_retries})") |
865 | 864 | try: |
866 | 865 | data = z.cat_file(fr) |
867 | 866 | break |
|
0 commit comments