Vladimír Vondruš
7a35f405b4
python: raise exceptions for Math API usage errors.
...
Originally those were assertions that were kept even in release builds,
which meant that calling math.angle() on non-normalized vectors aborted
the whole Python interpreted. Not great. But then the assertions were
made debug-only, which means invalid usage from Python (where the
bindings are usually only built as Release) now silently gives back a
wrong result, which is perhaps even worse.
Because the Python overhead is already massive due to all string lookup
and such, doing one more check in the implementations isn't really going
to slow down anything. Thus I'm mirroring all (debug-only) Magnum
assertions on the Python side, turning them into exceptions. With proper
messages as well, because those are extremely useful.
2 years ago
Vladimír Vondruš
daa78626fe
python: don't be lazy and name arguments in math APIs.
...
Otherwise can't reference them from docs, can't match the function
signatures from external docs...
2 years ago
Vladimír Vondruš
6330b6cc19
python: significantly improve matrix and quaternion test coverage.
...
Can't do any changes to that code because none of these were tested in
the first place. Ugh!
2 years ago
Vladimír Vondruš
1303032829
python: add actual exception messages to all Trade and *Tools APIs.
...
The time saved on not writing those messages back then was really not
worth the time wasted on figuring out what the hell every time one of
these fires.
And yet, somehow Python itself and a ton of libraries raises just an
IndexError alone, with nothing saying *how* wrong it was. Those details,
present in Magnum's own C++ asserts, proved to be extremely valuable for
being able to quickly figure out what's wrong, often even without even
having to look at the code or step through in the debugger.
Also fixes an issue where SceneData.field_object_offset() was rejecting
offsets right at the end of the field. Wasn't caught by tests because
apparently LookupError is a base of IndexError and as there was no
message it just failed elsewhere without being noticed.
3 years ago
Vladimír Vondruš
619b8a51bf
python: fix normalized signed VertexFormat enum values.
...
Haha :/
3 years ago
Vladimír Vondruš
f561337caa
python: implement pickling for all math types.
3 years ago
Vladimír Vondruš
08ff96da0b
python: adapt test to Magnum Text library changes.
3 years ago
Vladimír Vondruš
6212e36fda
python: expose new Range scaled() and scaledFromCenter() overloads.
3 years ago
Vladimír Vondruš
11060aa30f
python: properly test all Range APIs.
...
I saved myself some minor amount of time in 2019 to spend significantly
more time catching up with missing tests in 2023.
3 years ago
Vladimír Vondruš
25849d3e27
python: actually adapt to Text::AbstractGlyphCache changes, ugh.
3 years ago
Vladimír Vondruš
eee7bf002b
python: adapt to Text::AbstractGlyphCache changes.
3 years ago
Vladimír Vondruš
a9174def9b
modules: update Magnum Find modules.
3 years ago
Vladimír Vondruš
8ca1c30187
python: expose new text.AbstractFont APIs.
...
And add a bounds check for glyph_advance() and the new glyph_size() too.
3 years ago
Vladimír Vondruš
1e0559bc0b
python: oops, forgot to adapt Vector::minmax().
...
Because it wasn't tested, at all. So test it.
3 years ago
Vladimír Vondruš
ecb6351497
python: adapt to std::pair cleanup in Magnum.
...
Also expand the math function tests to explicitly test both the integer
and float variants. Yes, I should have exposed Containers::Pair directly
instead of doing this. No time.
3 years ago
Vladimír Vondruš
561b8ca901
python: consistently use "out of range" instead of "out of bounds".
3 years ago
Vladimír Vondruš
f26cfcde2e
package/ci: use Xcode 12.
3 years ago
Vladimír Vondruš
26749e56dc
modules: updated Magnum find modules.
3 years ago
Vladimír Vondruš
ff32ae2824
package/archlinux: enable colored output in dev PKGBUILDs.
3 years ago
Vladimír Vondruš
93f9eb814b
python: adapt to deprecated Math::angle() for quaternions.
...
It's renamed to half_angle() here as well. No API deprecation, sorry.
3 years ago
Vladimír Vondruš
a81071eae4
CMake: allow both <PackageName>_ROOT and <PACKAGENAME>_ROOT variables.
3 years ago
Vladimír Vondruš
74767f4db4
Bump minimal CMake version to 3.5 to silence a CMake 3.27 warning.
3 years ago
Vladimír Vondruš
cec30658ed
modules: updated FindCorrade and FindMagnum.
3 years ago
Vladimír Vondruš
2b09a43f99
python: ugh, once again hit the "let's interpret an int as enum" bug.
3 years ago
Vladimír Vondruš
46d6777315
doc: update copyright year in site footer as well.
3 years ago
Vladimír Vondruš
9950b9fca4
python: adapt to Magnum changes re MeshData morph target support.
3 years ago
Vladimír Vondruš
305fdf81ee
It's 2023 already!
3 years ago
Vladimír Vondruš
0a2488d474
modules: updated Find modules from Corrade and Magnum.
3 years ago
Vladimír Vondruš
12230c93b8
python: update some test TODOs.
3 years ago
Vladimír Vondruš
85e8fae9b8
python: expose compressed image APIs in AbstractImageConverter.
3 years ago
Vladimír Vondruš
c9515bbd1d
python: exposed CompressedImage and ImageView classes.
3 years ago
Vladimír Vondruš
f9473638fc
python: turns out documenting function overloads *is* possible.
...
Some documentation content was already using this, I just completely
forgot it was there. Heh.
3 years ago
Vladimír Vondruš
f9d1fdecf3
package/archlinux: adapt to lcov 2.0 changes.
3 years ago
Vladimír Vondruš
6d473cf2aa
python: expose various pixel format helpers.
3 years ago
Vladimír Vondruš
7c78ee34a0
python: expose the CompressedPixelFormat enum.
...
And related Trade::ImageData APIs.
3 years ago
Vladimír Vondruš
6d8ab441e8
python: expose the new expanded() API on strided (bit) array views.
...
Not collapsed() yet, as it has the return type depending on the count
parameter, and I'm not yet decided how to express that here.
3 years ago
Vladimír Vondruš
5747d58049
python: expose 2D image APIs in AbstractSceneConverter.
3 years ago
Vladimír Vondruš
f7c026fbd3
python: expose image-to-image ImageConverter APIs as well.
3 years ago
Vladimír Vondruš
d1a7a7c6c8
python: convert more Trade assertions to Python exceptions.
3 years ago
Vladimír Vondruš
0858c844e8
python: minor, doc++
3 years ago
Vladimír Vondruš
229ec2cb18
python: the WHAT was done in the test here and then copied 100 times?
3 years ago
Vladimír Vondruš
cfaa484147
python: test SceneData mutable access failures now that it's possible.
3 years ago
Vladimír Vondruš
738c3f8d38
python: improve test coverage for new SceneConverter APIs.
3 years ago
Vladimír Vondruš
05fad9ccdd
python: expose scene-related APIs in AbstractSceneConverter.
3 years ago
Vladimír Vondruš
8d9d7d3230
python: expose scenetools.{parents_breadth,children_depth}_first().
3 years ago
Vladimír Vondruš
561ba51805
python: test the remaining scenetools assertion now that we can.
3 years ago
Vladimír Vondruš
3b799fcad9
python: expose scenetools.filter_objects().
3 years ago
Vladimír Vondruš
f83c2cb1aa
python: expose scenetools.filter_field_entries().
3 years ago
Vladimír Vondruš
b3517b0411
python: doc++
3 years ago
Vladimír Vondruš
4be2d4d9c0
python: expose scenetools.filter_fields(), filter_{only,except}_fields().
3 years ago