matplotlib/matplotlib · error · ValueError

Invalid inputs. Must enter sec and jd together, daynum by i

Error message

Invalid inputs.  Must enter sec and jd together, daynum by itself, or dt (must be a python datetime).\nSec = %s\nJD  = %s\ndnum= %s\ndt  = %s

What it means

Error "Invalid inputs. Must enter sec and jd together, daynum by itself, or dt (must be a python datetime).\nSec = %s\nJD = %s\ndnum= %s\ndt = %s" thrown in matplotlib/matplotlib.

Source

Thrown at lib/matplotlib/testing/jpl_units/Epoch.py:55

        - If the input units are not in the allowed list, an error is thrown.

        = INPUT VARIABLES
        - frame     The frame of the epoch.  Must be 'ET' or 'UTC'
        - sec        The number of seconds past the input JD.
        - jd         The Julian date of the epoch.
        - daynum    The matplotlib day number of the epoch.
        - dt         A python datetime instance.
        """
        if ((sec is None and jd is not None) or
                (sec is not None and jd is None) or
                (daynum is not None and
                 (sec is not None or jd is not None)) or
                (daynum is None and dt is None and
                 (sec is None or jd is None)) or
                (daynum is not None and dt is not None) or
                (dt is not None and (sec is not None or jd is not None)) or
                ((dt is not None) and not isinstance(dt, DT.datetime))):
            raise ValueError(
                "Invalid inputs.  Must enter sec and jd together, "
                "daynum by itself, or dt (must be a python datetime).\n"
                "Sec = %s\n"
                "JD  = %s\n"
                "dnum= %s\n"
                "dt  = %s" % (sec, jd, daynum, dt))

        _api.check_in_list(self.allowed, frame=frame)
        self._frame = frame

        if dt is not None:
            daynum = date2num(dt)

        if daynum is not None:
            # 1-JAN-0001 in JD = 1721425.5
            jd = float(daynum) + 1721425.5
            self._jd = math.floor(jd)
            self._seconds = (jd - self._jd) * 86400.0

View on GitHub (pinned to b379c1b69e)

When it happens

Trigger: Thrown at lib/matplotlib/testing/jpl_units/Epoch.py:55 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of matplotlib/matplotlib@b379c1b69e (2026-08-21). Data as JSON: /api/errors/36102f0b06f53dc0. Report an issue: GitHub.