Skip to content

[BUG] _energy_ratio: shape mismatch when exactly one of two limits is infinite (multi-channel EDC) #132

@artur-pa

Description

@artur-pa

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Branch: develop

_energy_ratio raises a ValueError when called with a muli-channel EDC and a limits array where exactly one of the two denominator or numerator limits is np.inf (e.g. limits = [0.08, np.inf, 0.0, 0.08 as used by clarity in #109 and definition in #114 ) .

Code sample

Code run:

import numpy as np
import pyfar as pf
from pyrato.parameters import clarity

energy = np.linspace((1, 0.5), (0, 0), 1000).T  # cshape (2,)
edc = pf.TimeData(energy, np.arange(1000) / 1000)
clarity(edc)  # raises ValueError

Traceback:

ValueError: shape mismatch: value array of shape (2,) could not be
broadcast to indexing result of shape (2,1)

Environment

Details
Paste output of `pipdeptree --package pyrato` here

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions