py_pol.stokes.Stokes.__repr__ raises error if py_pol.stokes.Stokes.M has multiple columns

Issue #6 resolved
Leon van der Graaff created an issue

This is a minimum working example:

# Create a Stokes object with two columns.
S = py_pol.stokes.Stokes('S')
S.from_matrix(np.matrix([[1, 1, 0, 0], [1, 0, 1, 0]]).T)

# Note that plotting is supported,
ax, fig = py_pol.drawings.draw_poincare_sphere(
    stokes_points=S,
    kind='scatter',
    color='r')

# but printing raises a TypeError
print(S)

# TypeError: unsupported format string passed to numpy.ndarray.__format__

OS: Windows 10

Version

py_pol.__version__

'0.2.3'

Comments (4)

  1. JESUS DEL HOYO MUÑOZ

    Currently, py_pol is not designed to contain several vectors/matrices in the same object. However, we are currently developing a ¡n upgrade to the module so it can work with multiple elements in the same objects. We will upload an alpha version with this functionality.

  2. Leon van der Graaff reporter

    Dear Jesu,

    Thank you for the fast reply. I’ll keep watching the new releases.

    Best, Leon

  3. Log in to comment