This commit is contained in:
@@ -6,6 +6,9 @@ import pdme.util
|
||||
import logging
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Model():
|
||||
"""
|
||||
Interface for models.
|
||||
@@ -43,7 +46,7 @@ class Model():
|
||||
----------
|
||||
Returns the model's cost function.
|
||||
'''
|
||||
logging.debug(f"Constructing costs for dots: {dots}")
|
||||
_logger.debug(f"Constructing costs for dots: {dots}")
|
||||
|
||||
def costs_to_return(pts: numpy.ndarray) -> numpy.ndarray:
|
||||
return numpy.array([self.cost_for_dot(dot, pts) for dot in dots])
|
||||
|
||||
@@ -8,6 +8,9 @@ SIGN_ARRAY_7 = numpy.array((-1, -1, -1, 1, 1, 1, 1))
|
||||
SIGN_ARRAY_4 = numpy.array((-1, 1, 1, 1))
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def flip_chunk_to_positive_px(pt: numpy.ndarray) -> numpy.ndarray:
|
||||
if pt[0] > 0:
|
||||
return pt
|
||||
@@ -18,7 +21,7 @@ def flip_chunk_to_positive_px(pt: numpy.ndarray) -> numpy.ndarray:
|
||||
elif len(pt) == 4:
|
||||
return SIGN_ARRAY_4 * pt
|
||||
else:
|
||||
logging.warning(f"Could not normalise pt: {pt}. Returning as is...")
|
||||
_logger.warning(f"Could not normalise pt: {pt}. Returning as is...")
|
||||
return pt
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user