Skip to content

Commit

Permalink
Remove tests written during feature development
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHeybrock committed Nov 4, 2024
1 parent e62c27e commit 16955ab
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions tests/nexus/workflow_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest
import scipp as sc
import scippnexus as snx
from scipp.core import label_based_index_to_positional_index
from scipp.testing import assert_identical

from ess.reduce import data
Expand All @@ -29,43 +28,6 @@
)


def test_transformation_chain_time_slicing() -> None:
value = sc.DataArray(
sc.arange('time', 10, unit='m'),
coords={'time': sc.arange('time', 10.0, unit='s')},
)
time = sc.concat([value.coords['time'], sc.scalar(1e9, unit='s')], 'time')

idx = label_based_index_to_positional_index(
sizes=value.sizes, coord=time, index=sc.scalar(0.5, unit='s')
)
assert idx == ('time', 0)

idx = label_based_index_to_positional_index(
sizes=value.sizes, coord=time, index=sc.scalar(5.0, unit='s')
)
assert idx == ('time', 5)

idx = label_based_index_to_positional_index(
sizes=value.sizes, coord=time, index=sc.scalar(10.0, unit='s')
)
assert idx == ('time', 9)


@pytest.mark.skip(reason='scipp/scipp#3584')
def test_transformation_chain_time_slicing_raises_if_out_of_range() -> None:
value = sc.DataArray(
sc.arange('time', 10, unit='m'),
coords={'time': sc.arange('time', 10.0, unit='s')},
)
time = sc.concat([value.coords['time'], sc.scalar(1e9, unit='s')], 'time')

with pytest.raises(KeyError):
label_based_index_to_positional_index(
sizes=value.sizes, coord=time, index=sc.scalar(-0.1, unit='s')
)


@pytest.fixture(params=[{}, {'aux': 1}])
def group_with_no_position(request) -> workflow.NeXusComponent[snx.NXsample, SampleRun]:
return workflow.NeXusComponent[snx.NXsample, SampleRun](sc.DataGroup(request.param))
Expand Down

0 comments on commit 16955ab

Please sign in to comment.