Skip to content

Issue when rotating 3D probes by specifying the axis as "xy"/"yz"/"zx" #273

@DrTaDa

Description

@DrTaDa

It is written in the docstring of the method .rotate of the class Probe that the axis is to be specified as a string:

axis : "xy" | "yz" | "xz" | None, default: None
            Axis of rotation.
            It must be None for 2D probes
            It must be given for 3D probes

Howver, that leads to an error:

File "/home/tanguy.damart/virt_env/mozaik/lib/python3.8/site-packages/probeinterface/probe.py", line 1422, in _rotation_matrix_3d
    axis = axis / np.linalg.norm(axis)
  File "<__array_function__ internals>", line 180, in norm
  File "/home/tanguy.damart/virt_env/mozaik/lib/python3.8/site-packages/numpy/linalg/linalg.py", line 2511, in norm
    x = x.astype(float)
ValueError: could not convert string to float: 'xy'

Which hapens because the function _rotation_matrix_3d expects a list or array instead of a string:

axis : np.array or list

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions