Strengthen test suite: shapes, dtypes, array consistency, and error paths#42
Draft
Copilot wants to merge 2 commits into
Draft
Strengthen test suite: shapes, dtypes, array consistency, and error paths#42Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Add 21 new tests to tests/test_e57.py: - Array shape assertions: (n, 3) for points/color, (n, 1) for intensity - Dtype assertions: float64 for points, float32 for color/intensity - Partial-attribute shape tests: empty arrays have (0, 3) and (0, 1) shapes - Consistency tests: row counts match for full and partial-attribute files - Color value range: all float values in [0.0, 1.0] - Spherical-to-Cartesian: output is finite and 3-column - raw_xml structure: valid XML with e57Root element - Modern pytest.raises error-path tests alongside existing ones - Named constants BUNNY_N_POINTS / PIPE_N_POINTS to replace magic numbers in new tests
Copilot
AI
changed the title
[WIP] Improve automated test suite for Python API
Strengthen test suite: shapes, dtypes, array consistency, and error paths
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing tests only asserted
len()on returned arrays and used verbose try/except error patterns, leaving dtype, shape, and cross-array consistency unverified.Changes
Named constants
BUNNY_N_POINTS = 30_571,PIPE_N_POINTS = 1_220— eliminate magic numbers in new shape testsShape assertions (new tests verify 2-D structure, not just row count)
points → (n, 3),color → (n, 3),intensity → (n, 1)(0, 3)/(0, 1)rather than a flat empty arrayDtype assertions
pointsisfloat64;colorandintensityarefloat32Cross-array consistency
points,color,intensityshare the same row countbunnyFloat): absent arrays have 0 rows whilepointsis non-emptyValue-range and transformation checks
[0.0, 1.0]raw_xmlstructuree57RootelementModern error-path tests
pytest.raisesequivalents for all existing try/except error tests; original tests retained