DASDAE / dascore

A python library for distributed fiber optic sensing
Other
71 stars 16 forks source link

Enforce int dtypes in select when samples is True #380

Closed d-chambers closed 2 months ago

d-chambers commented 3 months ago

Description

We should enforce the inputs are ints when select(samples=True). Right now a cryptic error is raised.

Example

import dascore as dc 

patch = dc.get_example_patch()

sub = patch.select(time=0, samples=True)  # works fine

sub = patch.select(time=0.0, samples=True)  # raises an assertion error.

Expected behavior

We should probably just raise a nicer error message when non-ints are used in patch.select when sample=True, similar to using non-ints for numpy array indices.

Versions

d-chambers commented 2 months ago

closed by #392