-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test pandas and xarray time conversion remove pypy from travis since travis pypy3 is old
- Loading branch information
Showing
11 changed files
with
105 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ git: | |
python: | ||
- 3.6 | ||
- 3.5 | ||
- pypy3 | ||
|
||
os: | ||
- linux | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = pymap3d | ||
version = 1.7.9 | ||
version = 1.7.10 | ||
author = Michael Hirsch, Ph.D. | ||
author_email = [email protected] | ||
description = pure Python coordinate conversions, following convention of several popular Matlab routines. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
import pytest | ||
from pymap3d.timeconv import str2dt | ||
from datetime import datetime | ||
|
||
t0 = datetime(2014, 4, 6, 8) | ||
|
||
|
||
def test_str2dt(): | ||
assert str2dt(t0) == t0 # passthrough | ||
assert str2dt('2014-04-06T08:00:00') == t0 | ||
ti = [str2dt('2014-04-06T08:00:00'), str2dt('2014-04-06T08:01:02')] | ||
to = [t0, datetime(2014, 4, 6, 8, 1, 2)] | ||
assert ti == to # even though ti is numpy array of datetime and to is list of datetime | ||
|
||
|
||
def test_xarray_time(): | ||
xarray = pytest.importorskip('xarray') | ||
|
||
t = {'time': t0} | ||
|
||
ds = xarray.Dataset(t) | ||
assert str2dt(ds['time']) == t0 | ||
|
||
|
||
def test_pandas_time(): | ||
pandas = pytest.importorskip('pandas') | ||
|
||
t = pandas.Series(t0) | ||
assert str2dt(t) == t0 | ||
|
||
|
||
if __name__ == '__main__': | ||
pytest.main([__file__]) |