diff --git a/swmmanywhere/logging.py b/swmmanywhere/custom_logging.py similarity index 95% rename from swmmanywhere/logging.py rename to swmmanywhere/custom_logging.py index 1906886e..c563a40e 100644 --- a/swmmanywhere/logging.py +++ b/swmmanywhere/custom_logging.py @@ -4,7 +4,7 @@ >>> import os >>> os.environ["SWMMANYWHERE_VERBOSE"] = "true" >>> # logging is now enabled in any swmmanywhere module ->>> from swmmanywhere.logging import logger # You can now log yourself +>>> from swmmanywhere.custom_logging import logger # You can now log yourself >>> logger.info("This is an info message.") # Write to stdout # doctest: +SKIP This is an info message. >>> logger.add("file.log") # Add a log file # doctest: +SKIP diff --git a/swmmanywhere/geospatial_utilities.py b/swmmanywhere/geospatial_utilities.py index bf24f331..86d1c458 100644 --- a/swmmanywhere/geospatial_utilities.py +++ b/swmmanywhere/geospatial_utilities.py @@ -36,7 +36,7 @@ import pysheds # noqa: E402 from pysheds import grid as pgrid # noqa: E402 -from swmmanywhere.logging import logger # noqa: E402 +from swmmanywhere.custom_logging import logger # noqa: E402 TransformerFromCRS = lru_cache(pyproj.transformer.Transformer.from_crs) diff --git a/swmmanywhere/graph_utilities.py b/swmmanywhere/graph_utilities.py index 602d888c..89b1d4a4 100644 --- a/swmmanywhere/graph_utilities.py +++ b/swmmanywhere/graph_utilities.py @@ -24,7 +24,7 @@ from swmmanywhere import geospatial_utilities as go from swmmanywhere import parameters, shortest_path_utils -from swmmanywhere.logging import logger +from swmmanywhere.custom_logging import logger def load_graph(fid: Path) -> nx.Graph: diff --git a/swmmanywhere/metric_utilities.py b/swmmanywhere/metric_utilities.py index def653b4..cff290b4 100644 --- a/swmmanywhere/metric_utilities.py +++ b/swmmanywhere/metric_utilities.py @@ -19,7 +19,7 @@ import shapely from scipy import stats -from swmmanywhere.logging import logger +from swmmanywhere.custom_logging import logger from swmmanywhere.parameters import MetricEvaluation diff --git a/swmmanywhere/paper/experimenter.py b/swmmanywhere/paper/experimenter.py index 018c0e12..27a3beaa 100644 --- a/swmmanywhere/paper/experimenter.py +++ b/swmmanywhere/paper/experimenter.py @@ -20,7 +20,7 @@ os.environ['OMP_NUM_THREADS'] = '1' from swmmanywhere import swmmanywhere # noqa: E402 -from swmmanywhere.logging import logger # noqa: E402 +from swmmanywhere.custom_logging import logger # noqa: E402 from swmmanywhere.parameters import get_full_parameters_flat # noqa: E402 os.environ['SWMMANYWHERE_VERBOSE'] = "true" diff --git a/swmmanywhere/paper/perform_sa.py b/swmmanywhere/paper/perform_sa.py index 8a4a220e..d9f8d5a8 100644 --- a/swmmanywhere/paper/perform_sa.py +++ b/swmmanywhere/paper/perform_sa.py @@ -8,7 +8,7 @@ from SALib.analyze import sobol from tqdm import tqdm -from swmmanywhere.logging import logger +from swmmanywhere.custom_logging import logger from swmmanywhere.paper import experimenter from swmmanywhere.paper import plotting as swplt from swmmanywhere.preprocessing import check_bboxes diff --git a/swmmanywhere/prepare_data.py b/swmmanywhere/prepare_data.py index 266c664f..55fa9ae1 100644 --- a/swmmanywhere/prepare_data.py +++ b/swmmanywhere/prepare_data.py @@ -17,7 +17,7 @@ import yaml from geopy.geocoders import Nominatim -from swmmanywhere.logging import logger +from swmmanywhere.custom_logging import logger def get_country(x: float, diff --git a/swmmanywhere/preprocessing.py b/swmmanywhere/preprocessing.py index dfd91638..b1fbb5af 100644 --- a/swmmanywhere/preprocessing.py +++ b/swmmanywhere/preprocessing.py @@ -18,7 +18,7 @@ from swmmanywhere import geospatial_utilities as go from swmmanywhere import graph_utilities as gu from swmmanywhere import parameters, prepare_data -from swmmanywhere.logging import logger +from swmmanywhere.custom_logging import logger def next_directory(keyword: str, directory: Path) -> int: diff --git a/tests/test_graph_utilities.py b/tests/test_graph_utilities.py index f328455e..48f45c44 100644 --- a/tests/test_graph_utilities.py +++ b/tests/test_graph_utilities.py @@ -15,9 +15,9 @@ from shapely import geometry as sgeom from swmmanywhere import parameters +from swmmanywhere.custom_logging import logger from swmmanywhere.graph_utilities import graphfcns as gu from swmmanywhere.graph_utilities import iterate_graphfcns, load_graph, save_graph -from swmmanywhere.logging import logger def load_street_network(): diff --git a/tests/test_logging.py b/tests/test_logging.py index fb1f212c..ca94551a 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -9,7 +9,7 @@ from pathlib import Path from tempfile import NamedTemporaryFile -from swmmanywhere.logging import logger +from swmmanywhere.custom_logging import logger def test_logger(): @@ -48,7 +48,7 @@ def test_logger_disable(): def test_logger_reimport(): """Reimport logger to check that changes from disable are persistent.""" - from swmmanywhere.logging import logger + from swmmanywhere.custom_logging import logger with NamedTemporaryFile(suffix='.log', mode = 'w+b', delete=False) as temp_file: