diff --git a/src/vector/backends/numpy.py b/src/vector/backends/numpy.py index 69f6488f..da6a6af3 100644 --- a/src/vector/backends/numpy.py +++ b/src/vector/backends/numpy.py @@ -1424,14 +1424,46 @@ def __repr__(self) -> str: @property def azimuthal(self) -> AzimuthalNumpy: - """Returns the azimuthal type class for the given ``VectorNumpy3D`` object.""" - # TODO: Add an example here - see https://github.com/scikit-hep/vector/issues/194 + """ + Returns the azimuthal type class for the given ``VectorNumpy3D`` object. + + Example: + >>> import vector + >>> vec = vector.array( + ... [ + ... (1.1, 2.1, 3.1), + ... (1.2, 2.2, 3.2), + ... (1.3, 2.3, 3.3), + ... (1.4, 2.4, 4.4), + ... (1.5, 2.5, 5.5) + ... ], dtype=[("x", float), ("y", float), ("z", float)] + ... ) + >>> vec.azimuthal + AzimuthalNumpyXY([(1.1, 2.1), (1.2, 2.2), (1.3, 2.3), (1.4, 2.4), + (1.5, 2.5)], dtype=[('x', ' LongitudinalNumpy: - """Returns the longitudinal type class for the given ``VectorNumpy3D`` object.""" - # TODO: Add an example here - see https://github.com/scikit-hep/vector/issues/194 + """ + Returns the longitudinal type class for the given ``VectorNumpy3D`` object. + + Example: + >>> import vector + >>> vec = vector.array( + ... [ + ... (1.1, 2.1, 3.1), + ... (1.2, 2.2, 3.2), + ... (1.3, 2.3, 3.3), + ... (1.4, 2.4, 4.4), + ... (1.5, 2.5, 5.5) + ... ], dtype=[("x", float), ("y", float), ("z", float)] + ... ) + >>> vec.longitudinal + LongitudinalNumpyZ([(3.1,), (3.2,), (3.3,), (4.4,), (5.5,)], + dtype=[('z', ' str: @property def azimuthal(self) -> AzimuthalNumpy: - """Returns the azimuthal type class for the given ``VectorNumpy4D`` object.""" - # TODO: Add an example here - see https://github.com/scikit-hep/vector/issues/194 + """ + Returns the azimuthal type class for the given ``VectorNumpy4D`` object. + + Example: + >>> import vector + >>> vec = vector.array( + ... [ + ... (1.1, 2.1, 3.1, 4.1), + ... (1.2, 2.2, 3.2, 4.2), + ... (1.3, 2.3, 3.3, 4.3), + ... (1.4, 2.4, 3.4, 4.4), + ... (1.5, 2.5, 3.5, 4.5) + ... ], dtype=[("x", float), ("y", float), ("z", float), ("t", float)] + ... ) + >>> vec.azimuthal + AzimuthalNumpyXY([(1.1, 2.1), (1.2, 2.2), (1.3, 2.3), (1.4, 2.4), + (1.5, 2.5)], dtype=[('x', ' LongitudinalNumpy: - """Returns the longitudinal type class for the given ``Vectornumpy4D`` object.""" - # TODO: Add an example here - see https://github.com/scikit-hep/vector/issues/194 + """ + Returns the longitudinal type class for the given ``VectorNumpy4D`` object. + + Example: + >>> import vector + >>> vec = vector.array( + ... [ + ... (1.1, 2.1, 3.1, 4.1), + ... (1.2, 2.2, 3.2, 4.2), + ... (1.3, 2.3, 3.3, 4.3), + ... (1.4, 2.4, 3.4, 4.4), + ... (1.5, 2.5, 3.5, 4.5) + ... ], dtype=[("x", float), ("y", float), ("z", float), ("t", float)] + ... ) + >>> vec.longitudinal + LongitudinalNumpyZ([(3.1,), (3.2,), (3.3,), (3.4,), (3.5,)], + dtype=[('z', '