# Path: beyond/dates/eop.py
# class Eop:
#     """Earth Orientation Parameters"""
# 
#     def __init__(self, **kwargs):
#         self.x = kwargs["x"]
#         self.y = kwargs["y"]
#         self.dx = kwargs["dx"]
#         self.dy = kwargs["dy"]
#         self.deps = kwargs["deps"]
#         self.dpsi = kwargs["dpsi"]
#         self.lod = kwargs["lod"]
#         self.ut1_utc = kwargs["ut1_utc"]
#         self.tai_utc = kwargs["tai_utc"]
# 
#     def __repr__(self):
#         return "{name}(x={x}, y={y}, dx={dx}, dy={dy}, deps={deps}, dpsi={dpsi}, lod={lod}, ut1_utc={ut1_utc}, tai_utc={tai_utc})".format(
#             name=self.__class__.__name__, **self.__dict__
#         )
# 
# Path: beyond/dates/date.py
# class Timescale(Node):
# class Date:
# class DateRange:
#     class DateConverter(mdates.DateConverter):
#     def __repr__(self):  # pragma: no cover
#     def __str__(self):
#     def _scale_ut1_minus_utc(self, mjd, eop):
#     def _scale_tai_minus_utc(self, mjd, eop):
#     def _scale_tt_minus_tai(self, mjd, eop):
#     def _scale_tai_minus_gps(self, mjd, eop):
#     def _scale_tdb_minus_tt(self, mjd, eop):
#     def offset(self, mjd, new_scale, eop):
# def get_scale(name):
#     def __init__(self, *args, scale=DEFAULT_SCALE, **kwargs):
#     def __getstate__(self):  # pragma: no cover
#     def __setstate__(self, state):  # pragma: no cover
#     def __setattr__(self, *args):  # pragma: no cover
#     def __delattr__(self, *args):  # pragma: no cover
#     def __add__(self, other):
#     def __sub__(self, other):
#     def __gt__(self, other):
#     def __ge__(self, other):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __eq__(self, other):
#     def __repr__(self):  # pragma: no cover
#     def __str__(self):  # pragma: no cover
#     def __format__(self, fmt):  # pragma: no cover
#     def __hash__(self):
#     def _convert_dt(cls, dt):
#     def _convert_to_scale(self):
#     def d(self):
#     def s(self):
#     def datetime(self):
#     def _datetime(self):
#     def strptime(cls, data, format, scale=DEFAULT_SCALE):  # pragma: no cover
#     def now(cls, scale=DEFAULT_SCALE):
#     def strftime(self, fmt):  # pragma: no cover
#     def change_scale(self, new_scale):
#     def _julian_century(cls, jd):
#     def julian_century(self):
#     def jd(self):
#     def _mjd(self):
#     def mjd(self):
#     def range(cls, *args, **kwargs):
#     def __init__(self, start, stop, step, *, inclusive=False):
#     def dur(self):
#     def _sign(cls, x):
#     def __iter__(self):
#     def __contains__(self, date):
#     def __len__(self):
#         def _conv(v):
#         def convert(values, unit, axis):
# UT1 = Timescale("UT1")  # Universal Time
# GPS = Timescale("GPS")  # GPS Time
# TDB = Timescale("TDB")  # Barycentric Dynamical Time
# UTC = Timescale("UTC")  # Coordinated Universal Time
# TAI = Timescale("TAI")  # International Atomic Time
# TT = Timescale("TT")  # Terrestrial Time
#     MJD_T0 = datetime(1858, 11, 17)
#     JD_MJD = 2400000.5
#     J2000 = 2451545.0
#     REF_SCALE = "TAI"
#     DEFAULT_SCALE = "UTC"


from pytest import raises, mark
from unittest.mock import patch
from pickle import dumps, loads
from datetime import datetime, timedelta, timezone
from beyond.dates.eop import Eop
from beyond.dates.date import Date, DateError, UnknownScaleError, DateRange
import numpy as np
    import matplotlib.pyplot as plt
    plt.draw()  # draws the figure, but does not show it
    plt.close(fig)  # Delete the figure


def test_daterange():

    start = Date(2016, 11, 16, 22, 38)
    stop = timedelta(hours=1)
    step = timedelta(seconds=30)

    # classic range
    l1 = Date.range(start, stop, step)
    assert len(l1) == stop // step
    assert len(l1) == len(list(l1))

    # Inclusive range
    l2 = Date.range(start, stop, step, inclusive=True)
    assert len(l2) == stop // step + 1
    assert len(l2) == len(list(l2))

    r = Date.range(start, stop, step)
    rlist = list(r)
    assert len(r) == len(rlist)
    assert isinstance(r, DateRange)
    assert rlist[0] == r.start
    assert rlist[-1] == r.stop - r.step

    r = Date.range(start, stop, step, inclusive=True)
    rlist = list(r)
    assert len(r) == len(rlist)

# Path: beyond/dates/eop.py
# class Eop:
#     """Earth Orientation Parameters"""
# 
#     def __init__(self, **kwargs):
#         self.x = kwargs["x"]
#         self.y = kwargs["y"]
#         self.dx = kwargs["dx"]
#         self.dy = kwargs["dy"]
#         self.deps = kwargs["deps"]
#         self.dpsi = kwargs["dpsi"]
#         self.lod = kwargs["lod"]
#         self.ut1_utc = kwargs["ut1_utc"]
#         self.tai_utc = kwargs["tai_utc"]
# 
#     def __repr__(self):
#         return "{name}(x={x}, y={y}, dx={dx}, dy={dy}, deps={deps}, dpsi={dpsi}, lod={lod}, ut1_utc={ut1_utc}, tai_utc={tai_utc})".format(
#             name=self.__class__.__name__, **self.__dict__
#         )
# 
# Path: beyond/dates/date.py
# class Timescale(Node):
# class Date:
# class DateRange:
#     class DateConverter(mdates.DateConverter):
#     def __repr__(self):  # pragma: no cover
#     def __str__(self):
#     def _scale_ut1_minus_utc(self, mjd, eop):
#     def _scale_tai_minus_utc(self, mjd, eop):
#     def _scale_tt_minus_tai(self, mjd, eop):
#     def _scale_tai_minus_gps(self, mjd, eop):
#     def _scale_tdb_minus_tt(self, mjd, eop):
#     def offset(self, mjd, new_scale, eop):
# def get_scale(name):
#     def __init__(self, *args, scale=DEFAULT_SCALE, **kwargs):
#     def __getstate__(self):  # pragma: no cover
#     def __setstate__(self, state):  # pragma: no cover
#     def __setattr__(self, *args):  # pragma: no cover
#     def __delattr__(self, *args):  # pragma: no cover
#     def __add__(self, other):
#     def __sub__(self, other):
#     def __gt__(self, other):
#     def __ge__(self, other):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __eq__(self, other):
#     def __repr__(self):  # pragma: no cover
#     def __str__(self):  # pragma: no cover
#     def __format__(self, fmt):  # pragma: no cover
#     def __hash__(self):
#     def _convert_dt(cls, dt):
#     def _convert_to_scale(self):
#     def d(self):
#     def s(self):
#     def datetime(self):
#     def _datetime(self):
#     def strptime(cls, data, format, scale=DEFAULT_SCALE):  # pragma: no cover
#     def now(cls, scale=DEFAULT_SCALE):
#     def strftime(self, fmt):  # pragma: no cover
#     def change_scale(self, new_scale):
#     def _julian_century(cls, jd):
#     def julian_century(self):
#     def jd(self):
#     def _mjd(self):
#     def mjd(self):
#     def range(cls, *args, **kwargs):
#     def __init__(self, start, stop, step, *, inclusive=False):
#     def dur(self):
#     def _sign(cls, x):
#     def __iter__(self):
#     def __contains__(self, date):
#     def __len__(self):
#         def _conv(v):
#         def convert(values, unit, axis):
# UT1 = Timescale("UT1")  # Universal Time
# GPS = Timescale("GPS")  # GPS Time
# TDB = Timescale("TDB")  # Barycentric Dynamical Time
# UTC = Timescale("UTC")  # Coordinated Universal Time
# TAI = Timescale("TAI")  # International Atomic Time
# TT = Timescale("TT")  # Terrestrial Time
#     MJD_T0 = datetime(1858, 11, 17)
#     JD_MJD = 2400000.5
#     J2000 = 2451545.0
#     REF_SCALE = "TAI"
#     DEFAULT_SCALE = "UTC"


# Path: tests/test_date.py
from pytest import raises, mark
from unittest.mock import patch
from pickle import dumps, loads
from datetime import datetime, timedelta, timezone
from beyond.dates.eop import Eop
from beyond.dates.date import Date, DateError, UnknownScaleError, DateRange
import numpy as np
    import matplotlib.pyplot as plt

    plt.draw()  # draws the figure, but does not show it
    plt.close(fig)  # Delete the figure


def test_daterange():

    start = Date(2016, 11, 16, 22, 38)
    stop = timedelta(hours=1)
    step = timedelta(seconds=30)

    # classic range
    l1 = Date.range(start, stop, step)
    assert len(l1) == stop // step
    assert len(l1) == len(list(l1))

    # Inclusive range
    l2 = Date.range(start, stop, step, inclusive=True)
    assert len(l2) == stop // step + 1
    assert len(l2) == len(list(l2))

    r = Date.range(start, stop, step)
    rlist = list(r)
    assert len(r) == len(rlist)
    assert isinstance(r, DateRange)
    assert rlist[0] == r.start
    assert rlist[-1] == r.stop - r.step

    r = Date.range(start, stop, step, inclusive=True)
    rlist = list(r)
    assert len(r) == len(rlist)

    assert isinstance(r, DateRange)