Skip to content
Snippets Groups Projects
Commit ac7f44a8 authored by Alán Muñoz's avatar Alán Muñoz
Browse files

change(tiler): print -> log

parent 2665bf22
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ A peak-identifying algorithm recovers the x and y-axis location of traps in the ...@@ -13,6 +13,7 @@ A peak-identifying algorithm recovers the x and y-axis location of traps in the
The experiment is stored as an array with a standard indexing order of (Time, Channels, Z-stack, X, Y). The experiment is stored as an array with a standard indexing order of (Time, Channels, Z-stack, X, Y).
""" """
import logging
import re import re
import typing as t import typing as t
import warnings import warnings
...@@ -26,7 +27,7 @@ from skimage.registration import phase_cross_correlation ...@@ -26,7 +27,7 @@ from skimage.registration import phase_cross_correlation
from agora.abc import ParametersABC, StepABC from agora.abc import ParametersABC, StepABC
from agora.io.writer import BridgeH5 from agora.io.writer import BridgeH5
from aliby.io.image import ImageLocalOME, ImageDir, ImageDummy from aliby.io.image import ImageDummy
from aliby.tile.traps import segment_traps from aliby.tile.traps import segment_traps
...@@ -578,7 +579,7 @@ class Tiler(StepABC): ...@@ -578,7 +579,7 @@ class Tiler(StepABC):
"""Return index of reference channel.""" """Return index of reference channel."""
return self.get_channel_index(self.parameters.ref_channel) return self.get_channel_index(self.parameters.ref_channel)
def get_channel_index(self, channel: str or int): def get_channel_index(self, channel: str or int) -> int:
""" """
Find index for channel using regex. Find index for channel using regex.
...@@ -640,7 +641,7 @@ class Tiler(StepABC): ...@@ -640,7 +641,7 @@ class Tiler(StepABC):
# Alan: do we need these as well as get_channel_index and get_channel_name? # Alan: do we need these as well as get_channel_index and get_channel_name?
# self._log below is not defined # TODO homogenise these into a pair of functions
def find_channel_index(image_channels: t.List[str], channel: str): def find_channel_index(image_channels: t.List[str], channel: str):
""" """
Access Access
...@@ -649,7 +650,10 @@ def find_channel_index(image_channels: t.List[str], channel: str): ...@@ -649,7 +650,10 @@ def find_channel_index(image_channels: t.List[str], channel: str):
found = re.match(channel, ch, re.IGNORECASE) found = re.match(channel, ch, re.IGNORECASE)
if found: if found:
if len(found.string) - (found.endpos - found.start()): if len(found.string) - (found.endpos - found.start()):
self._log(f"Channel {channel} matched {ch} using regex") logging.getLogger("aliby").log(
logging.WARNING,
f"Channel {channel} matched {ch} using regex",
)
return i return i
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment