Skip to content

Commit

Permalink
format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
headtr1ck committed May 20, 2022
1 parent 9796fe3 commit ff5ad1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 1 addition & 5 deletions xarray/core/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1958,11 +1958,7 @@ def to_floatable(x: DataArray) -> DataArray:
else type(x.data[0])(1970, 1, 1)
)
return x.copy(
data=datetime_to_numeric(
x.data,
offset=offset,
datetime_unit="ns"
),
data=datetime_to_numeric(x.data, offset=offset, datetime_unit="ns"),
)
elif x.dtype.kind == "m":
# timedeltas
Expand Down
9 changes: 7 additions & 2 deletions xarray/tests/test_computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2020,13 +2020,18 @@ def test_where_attrs() -> None:
),
pytest.param(
xr.DataArray(
xr.date_range('1970-01-01', freq='1S', periods=3, use_cftime=True), dims="x"
xr.date_range("1970-01-01", freq="1S", periods=3, use_cftime=True),
dims="x",
),
xr.DataArray([0, 1], dims="degree", coords={"degree": [0, 1]}),
xr.DataArray(
[0, 1e9, 2e9],
dims="x",
coords={"x": xr.date_range('1970-01-01', freq='1S', periods=3, use_cftime=True)},
coords={
"x": xr.date_range(
"1970-01-01", freq="1S", periods=3, use_cftime=True
)
},
),
id="cftime",
),
Expand Down

0 comments on commit ff5ad1e

Please sign in to comment.