diff --git a/bluecellulab/cell/serialized_sections.py b/bluecellulab/cell/serialized_sections.py index aea59d4b..c0e54686 100644 --- a/bluecellulab/cell/serialized_sections.py +++ b/bluecellulab/cell/serialized_sections.py @@ -14,11 +14,13 @@ """Module that allows morphology sections to be accessed from an array by index.""" +import logging import warnings import neuron from bluecellulab.type_aliases import HocObjectType +logger = logging.getLogger(__name__) warnings.filterwarnings("once", category=UserWarning, module=__name__) @@ -31,7 +33,7 @@ def __init__(self, cell: HocObjectType) -> None: for index, sec in enumerate(cell.all, start=1): v_value = sec(0.0001).v if v_value >= n: - print(f"{sec.name()} v(1)={sec(1).v} n3d()={sec.n3d()}") + logging.debug(f"{sec.name()} v(1)={sec(1).v} n3d()={sec.n3d()}") raise ValueError("Error: failure in mk2_isec2sec()") if v_value < 0: diff --git a/bluecellulab/importer.py b/bluecellulab/importer.py index 1e85932a..c4149ed6 100644 --- a/bluecellulab/importer.py +++ b/bluecellulab/importer.py @@ -13,14 +13,19 @@ # limitations under the License. """Main importer of bluecellulab.""" +import logging import os from types import ModuleType import pkg_resources + import neuron from bluecellulab.exceptions import BluecellulabError +logger = logging.getLogger(__name__) + + def import_mod_lib(neuron: ModuleType) -> str: """Import mod files.""" res = "" @@ -62,8 +67,8 @@ def import_neurodamus(neuron: ModuleType) -> None: def print_header(neuron: ModuleType, mod_lib_path: str) -> None: """Print bluecellulab header to stdout.""" - print("Imported NEURON from: %s" % neuron.__file__) - print('Mod lib: ', mod_lib_path) + logger.info("Imported NEURON from: %s" % neuron.__file__) + logger.info('Mod lib: ', mod_lib_path) mod_lib_paths = import_mod_lib(neuron)