Browse Source

Typo fixing

pull/11/head
Aaron Gokaslan 5 years ago
parent
commit
31785426d8
  1. 2
      doc/python/corrade.containers.rst
  2. 6
      doc/python/magnum.math.rst
  3. 2
      src/python/corrade/PyBuffer.h
  4. 4
      src/python/magnum/math.range.cpp
  5. 4
      src/python/magnum/math.vectorfloat.cpp
  6. 4
      src/python/magnum/math.vectorintegral.cpp

2
doc/python/corrade.containers.rst

@ -32,7 +32,7 @@
both from and to Python objects supporting the Buffer Protocol, with one
dimension and stride of :py:`1`. See :ref:`StridedArrayView1D` and others
for more generic views. :ref:`ArrayView` is immutable, see
:ref:`MutableArrayView` for the mutable alterantive. All slicing operations
:ref:`MutableArrayView` for the mutable alternative. All slicing operations
are supported, specifying a non-trivial stride will return
:ref:`StridedArrayView1D` instead of :ref:`ArrayView`. Example usage:

6
doc/python/magnum.math.rst

@ -158,7 +158,7 @@
To simplify the implementation, Magnum matrices are convertible only from
32-bit and 64-bit floating-point types (:py:`'f'` and :py:`'d'` numpy
``dtype``). In the other direction, unless overriden using ``dtype`` or
``dtype``). In the other direction, unless overridden using ``dtype`` or
``order``, the created numpy array matches Magnum data type and layout:
.. code:: pycon
@ -181,9 +181,9 @@
.. code:: pycon
>>> c = np.array(Matrix3.rotation(Deg(45.0)), order='C', dtype='d')
>>> c.strides[0] # row-major storage (overriden)
>>> c.strides[0] # row-major storage (overridden)
24
>>> c[0] # first column, 64-bit floats (overriden)
>>> c[0] # first column, 64-bit floats (overridden)
array([ 0.70710677, -0.70710677, 0. ])
`Major differences to the C++ API`_

2
src/python/corrade/PyBuffer.h

@ -61,7 +61,7 @@ template<class Class, bool(*getter)(Class&, Py_buffer&, int)> void enableBetterB
/* Set the memory owner to the object and increase its reference count.
We need to keep the object around because buffer->shapes /
buffer->strides might be refering to it, moreover setting it to
buffer->strides might be referring to it, moreover setting it to
something else (like ArrayView's memory owner object) would mean
Python calls the releasebuffer on that object instead of on us,
leading to reference count getting negative in many cases. */

4
src/python/magnum/math.range.cpp

@ -52,8 +52,8 @@ template<class T> void range(py::module_& m, py::class_<T>& c) {
return T{Math::ZeroInit};
}, "Construct a zero range")
.def(py::init(), "Default constructor")
.def(py::init<typename T::VectorType, typename T::VectorType>(), "Construct a range from minimal and maximal coordiantes")
.def(py::init<std::pair<typename T::VectorType, typename T::VectorType>>(), "Construct a range from minimal and maximal coordiantes")
.def(py::init<typename T::VectorType, typename T::VectorType>(), "Construct a range from minimal and maximal coordinates")
.def(py::init<std::pair<typename T::VectorType, typename T::VectorType>>(), "Construct a range from minimal and maximal coordinates")
/* Comparison */
.def(py::self == py::self, "Equality comparison")

4
src/python/magnum/math.vectorfloat.cpp

@ -83,10 +83,10 @@ template<class T> void vectorsFloat(py::module_& m, py::class_<Math::Vector2<T>>
void mathVectorFloat(py::module_& root, py::module_& m) {
py::class_<Vector2> vector2{root, "Vector2", "Two-component float vector", py::buffer_protocol{}};
py::class_<Vector3> vector3{root, "Vector3", "Threee-component float vector", py::buffer_protocol{}};
py::class_<Vector3> vector3{root, "Vector3", "Three-component float vector", py::buffer_protocol{}};
py::class_<Vector4> vector4{root, "Vector4", "Four-component float vector", py::buffer_protocol{}};
py::class_<Vector2d> vector2d{root, "Vector2d", "Two-component double vector", py::buffer_protocol{}};
py::class_<Vector3d> vector3d{root, "Vector3d", "Threee-component double vector", py::buffer_protocol{}};
py::class_<Vector3d> vector3d{root, "Vector3d", "Three-component double vector", py::buffer_protocol{}};
py::class_<Vector4d> vector4d{root, "Vector4d", "Four-component double vector", py::buffer_protocol{}};
/* The subclasses don't have buffer protocol enabled, as that's already

4
src/python/magnum/math.vectorintegral.cpp

@ -109,10 +109,10 @@ template<class T> void vectorsIntegralSigned(py::class_<Math::Vector2<T>>& vecto
void mathVectorIntegral(py::module_& root, py::module_& m) {
py::class_<Vector2i> vector2i{root, "Vector2i", "Two-component signed integer vector", py::buffer_protocol{}};
py::class_<Vector3i> vector3i{root, "Vector3i", "Threee-component signed integral vector", py::buffer_protocol{}};
py::class_<Vector3i> vector3i{root, "Vector3i", "Three-component signed integral vector", py::buffer_protocol{}};
py::class_<Vector4i> vector4i{root, "Vector4i", "Four-component signed integral vector", py::buffer_protocol{}};
py::class_<Vector2ui> vector2ui{root, "Vector2ui", "Two-component unsigned integral vector", py::buffer_protocol{}};
py::class_<Vector3ui> vector3ui{root, "Vector3ui", "Threee-component unsigned integral vector", py::buffer_protocol{}};
py::class_<Vector3ui> vector3ui{root, "Vector3ui", "Three-component unsigned integral vector", py::buffer_protocol{}};
py::class_<Vector4ui> vector4ui{root, "Vector4ui", "Four-component unsigned integral vector", py::buffer_protocol{}};
/* First register type conversions as those should have a priority over

Loading…
Cancel
Save