From e4a38e54a6c01d236112f73f85dd90c531b0641e Mon Sep 17 00:00:00 2001 From: Dobson Date: Tue, 19 Mar 2024 21:45:16 +0000 Subject: [PATCH] Undo that, didn't seem to work --- swmmanywhere/geospatial_utilities.py | 9 +-------- swmmanywhere/paper/experimenter.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/swmmanywhere/geospatial_utilities.py b/swmmanywhere/geospatial_utilities.py index 954a92ee..528b9075 100644 --- a/swmmanywhere/geospatial_utilities.py +++ b/swmmanywhere/geospatial_utilities.py @@ -10,7 +10,6 @@ import json import math import operator -import os from copy import deepcopy from functools import lru_cache from pathlib import Path @@ -21,6 +20,7 @@ import numpy as np import pandas as pd import pyproj +import pysheds import rasterio as rst import rioxarray from pysheds import grid as pgrid @@ -31,13 +31,6 @@ from shapely.strtree import STRtree from tqdm import tqdm -# Set the number of threads to 1 to avoid conflicts with parallel processing -# for pysheds (at least I think that is what is happening) -os.environ['NUMBA_NUM_THREADS'] = '1' -os.environ['OMP_NUM_THREADS'] = '1' - -import pysheds # noqa: E402 - TransformerFromCRS = lru_cache(pyproj.transformer.Transformer.from_crs) def get_utm_epsg(x: float, diff --git a/swmmanywhere/paper/experimenter.py b/swmmanywhere/paper/experimenter.py index b77151bd..2c44da64 100644 --- a/swmmanywhere/paper/experimenter.py +++ b/swmmanywhere/paper/experimenter.py @@ -11,9 +11,14 @@ import pandas as pd from SALib.sample import sobol -from swmmanywhere import swmmanywhere -from swmmanywhere.logging import logger -from swmmanywhere.parameters import FilePaths, get_full_parameters_flat +# Set the number of threads to 1 to avoid conflicts with parallel processing +# for pysheds (at least I think that is what is happening) +os.environ['NUMBA_NUM_THREADS'] = '1' +os.environ['OMP_NUM_THREADS'] = '1' + +from swmmanywhere import swmmanywhere # noqa: E402 +from swmmanywhere.logging import logger # noqa: E402 +from swmmanywhere.parameters import FilePaths, get_full_parameters_flat # noqa: E402 os.environ['SWMMANYWHERE_VERBOSE'] = "true"