Skip to content

ForLoopPT duration evaluation fails with floor arguments #612

@shumpohl

Description

@shumpohl
from qupulse.pulses import *
body = FunctionPT('sin(2*pi*i*t*f)', '1/f')
pt = ForLoopPT(body , 'i', 'floor(total_time*f)')
pt.duration.evaluate_in_scope({'f': 1., 'total_time': 500})

fails with

  File "<lambdifygenerated-1>", line 2, in _lambdifygenerated
    return select([less_equal(floor(f*total_time), 0),True], [0,(builtins.sum(f**(-1.0) for i in range(0, amax((1,floor(f*total_time)), axis=0) - 1+1)))], default=nan)

TypeError: 'numpy.float64' object cannot be interpreted as an integer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions