File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11
11
import matplotlib .pyplot as plt
12
12
from matplotlib .testing .decorators import image_comparison
13
13
import matplotlib .ticker as mticker
14
+ import matplotlib ._api as _api
14
15
15
16
16
17
def test_date_numpyx ():
@@ -1090,3 +1091,16 @@ def test_julian2num():
1090
1091
mdates .set_epoch ('1970-01-01T00:00:00' )
1091
1092
assert mdates .julian2num (2440588.5 ) == 1.0
1092
1093
assert mdates .num2julian (2.0 ) == 2440589.5
1094
+
1095
+
1096
+ def test_epoch2num ():
1097
+ with _api .suppress_matplotlib_deprecation_warning ():
1098
+ mdates ._reset_epoch_test_example ()
1099
+ mdates .set_epoch ('0000-12-31' )
1100
+ assert mdates .epoch2num (86400 ) == 719164.0
1101
+ assert mdates .num2epoch (719165.0 ) == 86400 * 2
1102
+ # set back to the default
1103
+ mdates ._reset_epoch_test_example ()
1104
+ mdates .set_epoch ('1970-01-01T00:00:00' )
1105
+ assert mdates .epoch2num (86400 ) == 1.0
1106
+ assert mdates .num2epoch (2.0 ) == 86400 * 2
You can’t perform that action at this time.
0 commit comments