Skip to content

Commit

Permalink
Fix check_numeric_no_unit [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Sep 10, 2023
1 parent 4340983 commit 54035db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions astropy/time/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2822,15 +2822,16 @@ def __init__(
in_subfmt=in_subfmt,
out_subfmt=out_subfmt,
)
self._check_numeric_no_unit(val)
self._check_numeric_no_unit(val, format)

if scale is not None:
self.SCALES = TIME_DELTA_TYPES[scale]

def _check_numeric_no_unit(self, val):
def _check_numeric_no_unit(self, val, format):
if (
isinstance(self._time, TimeDeltaNumeric)
and getattr(val, "unit", None) is None
and format is None
):
warn(
"Numerical value without unit or explicit format passed to"
Expand Down

0 comments on commit 54035db

Please sign in to comment.