Skip to content

Commit

Permalink
Add j2000_to_datetime pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzomag committed Aug 8, 2024
1 parent 062f66b commit 3bf17b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_halo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime

import pandas as pd
from wimprates import j2000, StandardHaloModel, j2000_from_ymd
from wimprates import j2000, StandardHaloModel, j2000_from_ymd, j2000_to_datetime
import numericalunits as nu
import numpy as np

Expand All @@ -21,6 +21,11 @@ def test_j2000_datetime():
assert j2000(date) == 3318.25


def test_datetime_j2000():
date = 3318.25
assert j2000_to_datetime(date) == datetime(year=2009, month=1, day=31, hour=18)


def test_j2000_ns_int():
date = datetime(year=2009, month=1, day=31, hour=18)
value = pd.to_datetime(date).value
Expand Down

0 comments on commit 3bf17b6

Please sign in to comment.