Skip to content

Commit

Permalink
Merge pull request #81 from scipp/dependabot/pip/requirements/scipp-2…
Browse files Browse the repository at this point in the history
…2.11.0

Bump scipp from 0.17.0 to 22.11.0 in /requirements
  • Loading branch information
SimonHeybrock authored Nov 28, 2022
2 parents a61b417 + c19bc10 commit 966e8cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ python-dateutil==2.8.2
# via -r base.in
pyyaml==6.0
# via confuse
scipp==0.17.0
scipp==22.11.0
# via -r base.in
scipy==1.9.3
# via -r base.in
Expand Down
13 changes: 8 additions & 5 deletions src/scippnexus/nxtransformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
from typing import Union
import scipp as sc
import scipp.spatial
import scipp.interpolate
try:
from scipp.scipy import interpolate
except ImportError: # scipp<22.11
from scipp import interpolate
from .nxobject import Field, NXobject, ScippIndex


Expand Down Expand Up @@ -85,10 +88,10 @@ def _interpolate_transform(transform, xnew):
# scipy can't interpolate with a single value
if transform.sizes["time"] == 1:
transform = sc.concat([transform, transform], dim="time")
return sc.interpolate.interp1d(transform,
"time",
kind="previous",
fill_value="extrapolate")(xnew=xnew)
return interpolate.interp1d(transform,
"time",
kind="previous",
fill_value="extrapolate")(xnew=xnew)


def _smaller_unit(a, b):
Expand Down

0 comments on commit 966e8cc

Please sign in to comment.