You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation of audinterface.Segment states that we can use any callable that returns a pandas.MultiIndex with the entries start and end as entries as processing function.
>>>interface.process_index(db.files[:1], root=db.root)
---------------------------------------------------------------------------TypeErrorTraceback (mostrecentcalllast)
CellIn[5], line1---->1interface.process_index(db.files[:1], root=db.root)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/audinterface/core/segment.py:400, inSegment.process_index(self, index, root)
397ifindex.empty:
398returnindex-->400returnself.process_files(
401index.get_level_values('file'),
402starts=index.get_level_values('start'),
403ends=index.get_level_values('end'),
404root=root,
405 )
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/audinterface/core/segment.py:330, inSegment.process_files(self, files, starts, ends, root)
328for (file, start, _), indexiny.items():
329files.extend([file] *len(index))
-->330starts.extend(index.levels[0] +start)
331ends.extend(index.levels[1] +start)
333returnaudformat.segmented_index(files, starts, ends)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/core/ops/common.py:81, in_unpack_zerodim_and_defer.<locals>.new_method(self, other)
77returnNotImplemented79other=item_from_zerodim(other)
--->81returnmethod(self, other)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/core/arraylike.py:186, inOpsMixin.__add__(self, other)
98 @unpack_zerodim_and_defer("__add__")
99def__add__(self, other):
100""" 101 Get Addition of DataFrame and other, column-wise. 102 (...) 184 moose 3.0 NaN 185 """-->186returnself._arith_method(other, operator.add)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/core/indexes/base.py:6814, inIndex._arith_method(self, other, op)
6804if (
6805isinstance(other, Index)
6806andis_object_dtype(other.dtype)
(...)
6810# a chance to implement ops before we unwrap them.6811# See https://github.com/pandas-dev/pandas/issues/311096812returnNotImplemented->6814returnsuper()._arith_method(other, op)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/core/base.py:1348, inIndexOpsMixin._arith_method(self, other, op)
1345rvalues=ensure_wrapped_if_datetimelike(rvalues)
1347withnp.errstate(all="ignore"):
->1348result=ops.arithmetic_op(lvalues, rvalues, op)
1350returnself._construct_result(result, name=res_name)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/core/ops/array_ops.py:224, inarithmetic_op(left, right, op)
211# NB: We assume that extract_array and ensure_wrapped_if_datetimelike212# have already been called on `left` and `right`,213# and `maybe_prepare_scalar_for_op` has already been called on `right`214# We need to special-case datetime64/timedelta64 dtypes (e.g. because numpy215# casts integer dtypes to timedelta64 when operating with timedelta64 - GH#22390)217if (
218should_extension_dispatch(left, right)
219orisinstance(right, (Timedelta, BaseOffset, Timestamp))
(...)
222# Timedelta/Timestamp and other custom scalars are included in the check223# because numexpr will fail on it, see GH#31457-->224res_values=op(left, right)
225else:
226# TODO we should handle EAs consistently and move this check before the if/else227# (https://github.com/pandas-dev/pandas/issues/41165)228_bool_arith_check(op, left, right)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/core/ops/common.py:81, in_unpack_zerodim_and_defer.<locals>.new_method(self, other)
77returnNotImplemented79other=item_from_zerodim(other)
--->81returnmethod(self, other)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/core/arraylike.py:186, inOpsMixin.__add__(self, other)
98 @unpack_zerodim_and_defer("__add__")
99def__add__(self, other):
100""" 101 Get Addition of DataFrame and other, column-wise. 102 (...) 184 moose 3.0 NaN 185 """-->186returnself._arith_method(other, operator.add)
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/core/arrays/string_.py:541, inStringArray._cmp_method(self, other, op)
539result=np.empty_like(self._ndarray, dtype="object")
540result[mask] =libmissing.NA-->541result[valid] =op(self._ndarray[valid], other)
542returnStringArray(result)
543else:
544# logicalFile/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/_libs/tslibs/timedeltas.pyx:778, inpandas._libs.tslibs.timedeltas._binary_op_method_timedeltalike.f()
File/data/hwierstorf/.envs/projectsmile-bison-agent-tone-11.0.0/lib/python3.8/site-packages/pandas/_libs/tslibs/timedeltas.pyx:1903, inpandas._libs.tslibs.timedeltas.Timedelta.lambda4()
TypeError: unsupportedoperandtype(s) for+: 'Timedelta'and'str'
The text was updated successfully, but these errors were encountered:
The issue can be solved by providing vad instead of vad.process_signal as process_func. But as vad.process_signal does also return the desired multi index it is not obvious why it should not work.
hagenw
changed the title
audinterface.Segment fails
audinterface.Segment fails with using *.process_signal as process_func
May 31, 2023
The documentation of
audinterface.Segment
states that we can use any callable that returns apandas.MultiIndex
with the entriesstart
andend
as entries as processing function.This means it should work with the following VAD:
Then we get:
But when trying to use this with
audinterface.Segment
we get:
The text was updated successfully, but these errors were encountered: