Skip to content

Remove xfails and workarounds for datetime inputs into pygmt.info #1236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions pygmt/tests/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,13 @@ def test_info_numpy_array_time_column():
Make sure info works on a numpy.ndarray input with a datetime type.
"""
table = pd.date_range(start="2020-01-01", periods=5).to_numpy()
# Please remove coltypes="0T" workaround after
# https://github.com/GenericMappingTools/gmt/issues/4241 is resolved
output = info(table=table, coltypes="0T")
output = info(table=table)
expected_output = (
"<vector memory>: N = 5 <2020-01-01T00:00:00/2020-01-05T00:00:00>\n"
)
assert output == expected_output


@pytest.mark.xfail(
reason="UNIX timestamps returned instead of ISO datetime, should work on GMT 6.2.0 "
"after https://github.com/GenericMappingTools/gmt/issues/4241 is resolved",
)
def test_info_pandas_dataframe_time_column():
"""
Make sure info works on pandas.DataFrame inputs with a time column.
Expand All @@ -85,10 +79,6 @@ def test_info_pandas_dataframe_time_column():
assert output == expected_output


@pytest.mark.xfail(
reason="UNIX timestamp returned instead of ISO datetime, should work on GMT 6.2.0 "
"after https://github.com/GenericMappingTools/gmt/issues/4241 is resolved",
)
def test_info_xarray_dataset_time_column():
"""
Make sure info works on xarray.Dataset 1D inputs with a time column.
Expand Down Expand Up @@ -143,9 +133,7 @@ def test_info_per_column_with_time_inputs():
Make sure the per_column option works with time inputs.
"""
table = pd.date_range(start="2020-01-01", periods=5).to_numpy()
# Please remove coltypes="0T" workaround after
# https://github.com/GenericMappingTools/gmt/issues/4241 is resolved
output = info(table=table, per_column=True, coltypes="0T")
output = info(table=table, per_column=True)
npt.assert_equal(
actual=output, desired=["2020-01-01T00:00:00", "2020-01-05T00:00:00"]
)
Expand Down