mcstasscript.tests.test_geometry_viewer

mcstasscript.tests.test_geometry_viewer#

Functions

load_fixture()

make_mock_component([name])

Create a minimal mock component object compatible with ComponentModel.

make_mock_component_with_params([xwidth, ...])

Create a mock component with xwidth/yheight parameters (rectangle type).

Classes

TestAggregateIntensity([methodName])

Tests for _aggregate_intensity: reduces 1D monitor data to a scalar.

TestAggregateNcount([methodName])

Tests for _aggregate_intensity with 'ncount' aggregation.

TestApi([methodName])

Tests for the public API functions (without heavy rendering).

TestApiComponentColors([methodName])

Tests for component_colors parameter threading through the API.

TestApiComponentOpacities([methodName])

Tests for component_opacity parameter threading through the API.

TestComponentModel([methodName])

Tests for ComponentModel class.

TestConfig([methodName])

Verify config constants exist and have expected values.

TestDrawcallParsers([methodName])

Tests for individual drawcall parsing functions.

TestEulerToRotationMatrix([methodName])

Tests for euler_to_rotation_matrix.

TestGeometryGuessFailureSkip([methodName])

Tests for graceful handling of geometry guess failures in view_with_guess.

TestGeometryRule([methodName])

Tests for GeometryRule and GeometryRuleRegistry.

TestGuessGeometryBuiltins([methodName])

Tests for built-in geometry guess rules.

TestInstrumentModel([methodName])

Tests for InstrumentModel class.

TestIntensityToColor([methodName])

Tests for intensity_to_color: maps intensity values to hex colors.

TestMaterialIsolation([methodName])

Tests for component-scoped material isolation in PyThreejsRenderer.

TestMaterialIsolationOpacity([methodName])

Tests for component-scoped material isolation with opacity changes.

TestMatplotlibColorbar([methodName])

Tests for MatplotlibRenderer colorbar.

TestMatplotlibIntensity([methodName])

Tests for MatplotlibRenderer intensity colormode.

TestMatplotlibLineSegments([methodName])

Tests for disconnected LineSegmentsShape rendering.

TestMatplotlibTransformPoints([methodName])

Tests for MatplotlibRenderer._transform_points with quaternion transforms.

TestNcountDropdownAndLabel([methodName])

Tests for ncount dropdown option and 'N rays' colorbar label.

TestNcountPreservesExistingBehavior([methodName])

Ensure ncount addition does not break existing aggregate modes.

TestNormalize([methodName])

Tests for the normalize vector utility.

TestNormalizeQuaternion([methodName])

Tests for normalize_quaternion: scales a quaternion to unit length.

TestPosRotFromList([methodName])

Tests for pos_rot_from_list: extracts position and rotation from a 16-element m4 matrix.

TestPyThreejsColorbar([methodName])

Tests for PyThreejsRenderer colorbar widget.

TestPyThreejsComponentSelection([methodName])

Tests for picking a visual and showing its source component.

TestPyThreejsCustomColors([methodName])

Tests for PyThreejsRenderer custom component colors feature.

TestPyThreejsCustomOpacities([methodName])

Tests for PyThreejsRenderer custom component opacities feature.

TestPyThreejsIntensity([methodName])

Tests for PyThreejsRenderer intensity colormode.

TestQuaternionFromRotationMatrix([methodName])

Tests for quaternion_from_rotation_matrix: converts a 3x3 rotation matrix to quaternion.

TestQuaternionFromVectors([methodName])

Tests for quaternion_from_vectors: computes quaternion that rotates v0 onto v1.

TestQuaternionMultiply([methodName])

Tests for quaternion_multiply: Hamilton product of two quaternions.

TestQuaternionToRotationMatrix([methodName])

Tests for quaternion_to_rotation_matrix: converts a quaternion to a 3x3 rotation matrix.

TestResolveTransforms([methodName])

Tests for resolve_transforms.

TestSafeEval([methodName])

Tests for safe_eval expression evaluation.

TestShapes([methodName])

Tests for shape dataclasses and Style.

TestSphereShape([methodName])

Tests for SphereShape.

TestTransform([methodName])

Tests for Transform dataclass and its point transformation methods.

TestTransformFailureDiagnostics([methodName])

Tests for transform failure diagnostics in view_with_guess.

TestTriangulateFaces([methodName])

Tests for triangulate_faces: converts face definitions into flat triangle indices.