Skip to content

Commit

Permalink
Replace NaN in X-coordinate with None (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hubert Jaworski authored Aug 26, 2019
1 parent ddc3cc1 commit 44717eb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions neptune/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ def log_metric(self, log_name, x, y=None, timestamp=None):
if not is_float(y):
raise InvalidChannelValue(expected_type='float', actual_type=type(y).__name__)

if x is not None and is_nan_or_inf(x):
x = None

if is_nan_or_inf(y):
# pylint: disable=global-statement
global _nan_warning_sent
Expand Down Expand Up @@ -411,6 +414,9 @@ def log_text(self, log_name, x, y=None, timestamp=None):
"""
x, y = self._get_valid_x_y(x, y)

if x is not None and is_nan_or_inf(x):
x = None

if not isinstance(y, six.string_types):
raise InvalidChannelValue(expected_type='str', actual_type=type(y).__name__)

Expand Down Expand Up @@ -462,6 +468,9 @@ def log_image(self, log_name, x, y=None, image_name=None, description=None, time
"""
x, y = self._get_valid_x_y(x, y)

if x is not None and is_nan_or_inf(x):
x = None

input_image = dict(
name=image_name,
description=description,
Expand Down

0 comments on commit 44717eb

Please sign in to comment.