mcstasscript.tests.test_geometry_viewer.TestPyThreejsIntensity

mcstasscript.tests.test_geometry_viewer.TestPyThreejsIntensity#

class mcstasscript.tests.test_geometry_viewer.TestPyThreejsIntensity(methodName='runTest')#

Tests for PyThreejsRenderer intensity colormode.

__init__(methodName='runTest')#

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Methods

__init__([methodName])

Create an instance of the class that will use the named test method when executed.

addClassCleanup(function, /, *args, **kwargs)

Same as addCleanup, except the cleanup items are called even if setUpClass fails (unlike tearDownClass).

addCleanup(function, /, *args, **kwargs)

Add a function, with arguments, to be called when the test is completed.

addTypeEqualityFunc(typeobj, function)

Add a type specific assertEqual style function to compare a type.

assertAlmostEqual(first, second[, places, ...])

Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is more than the given delta.

assertAlmostEquals(**kwargs)

assertCountEqual(first, second[, msg])

Asserts that two iterables have the same elements, the same number of times, without regard to order.

assertDictContainsSubset(subset, dictionary)

Checks whether dictionary is a superset of subset.

assertDictEqual(d1, d2[, msg])

assertEqual(first, second[, msg])

Fail if the two objects are unequal as determined by the '==' operator.

assertEquals(**kwargs)

assertFalse(expr[, msg])

Check that the expression is false.

assertGreater(a, b[, msg])

Just like self.assertTrue(a > b), but with a nicer default message.

assertGreaterEqual(a, b[, msg])

Just like self.assertTrue(a >= b), but with a nicer default message.

assertIn(member, container[, msg])

Just like self.assertTrue(a in b), but with a nicer default message.

assertIs(expr1, expr2[, msg])

Just like self.assertTrue(a is b), but with a nicer default message.

assertIsInstance(obj, cls[, msg])

Same as self.assertTrue(isinstance(obj, cls)), with a nicer default message.

assertIsNone(obj[, msg])

Same as self.assertTrue(obj is None), with a nicer default message.

assertIsNot(expr1, expr2[, msg])

Just like self.assertTrue(a is not b), but with a nicer default message.

assertIsNotNone(obj[, msg])

Included for symmetry with assertIsNone.

assertLess(a, b[, msg])

Just like self.assertTrue(a < b), but with a nicer default message.

assertLessEqual(a, b[, msg])

Just like self.assertTrue(a <= b), but with a nicer default message.

assertListEqual(list1, list2[, msg])

A list-specific equality assertion.

assertLogs([logger, level])

Fail unless a log message of level level or higher is emitted on logger_name or its children.

assertMultiLineEqual(first, second[, msg])

Assert that two multi-line strings are equal.

assertNoLogs([logger, level])

Fail unless no log messages of level level or higher are emitted on logger_name or its children.

assertNotAlmostEqual(first, second[, ...])

Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is less than the given delta.

assertNotAlmostEquals(**kwargs)

assertNotEqual(first, second[, msg])

Fail if the two objects are equal as determined by the '!=' operator.

assertNotEquals(**kwargs)

assertNotIn(member, container[, msg])

Just like self.assertTrue(a not in b), but with a nicer default message.

assertNotIsInstance(obj, cls[, msg])

Included for symmetry with assertIsInstance.

assertNotRegex(text, unexpected_regex[, msg])

Fail the test if the text matches the regular expression.

assertNotRegexpMatches(**kwargs)

assertRaises(expected_exception, *args, **kwargs)

Fail unless an exception of class expected_exception is raised by the callable when invoked with specified positional and keyword arguments.

assertRaisesRegex(expected_exception, ...)

Asserts that the message in a raised exception matches a regex.

assertRaisesRegexp(**kwargs)

assertRegex(text, expected_regex[, msg])

Fail the test unless the text matches the regular expression.

assertRegexpMatches(**kwargs)

assertSequenceEqual(seq1, seq2[, msg, seq_type])

An equality assertion for ordered sequences (like lists and tuples).

assertSetEqual(set1, set2[, msg])

A set-specific equality assertion.

assertTrue(expr[, msg])

Check that the expression is true.

assertTupleEqual(tuple1, tuple2[, msg])

A tuple-specific equality assertion.

assertWarns(expected_warning, *args, **kwargs)

Fail unless a warning of class warnClass is triggered by the callable when invoked with specified positional and keyword arguments.

assertWarnsRegex(expected_warning, ...)

Asserts that the message in a triggered warning matches a regexp.

assert_(**kwargs)

countTestCases()

debug()

Run the test without collecting errors in a TestResult

defaultTestResult()

doClassCleanups()

Execute all class cleanup functions.

doCleanups()

Execute all cleanup functions.

enterClassContext(cm)

Same as enterContext, but class-wide.

enterContext(cm)

Enters the supplied context manager.

fail([msg])

Fail immediately, with the given message.

failIf(**kwargs)

failIfAlmostEqual(**kwargs)

failIfEqual(**kwargs)

failUnless(**kwargs)

failUnlessAlmostEqual(**kwargs)

failUnlessEqual(**kwargs)

failUnlessRaises(**kwargs)

id()

run([result])

setUp()

Hook method for setting up the test fixture before exercising it.

setUpClass()

Hook method for setting up class fixture before running tests in the class.

shortDescription()

Returns a one-line description of the test, or None if no description has been provided.

skipTest(reason)

Skip this test.

subTest([msg])

Return a context manager that will return the enclosed block of code in a subtest identified by the optional message and keyword parameters.

tearDown()

Hook method for deconstructing the test fixture after testing it.

tearDownClass()

Hook method for deconstructing the class fixture after running all tests in the class.

test_aggregate_dropdown_options()

Aggregate dropdown includes all aggregation modes.

test_colorbar_stale_intensity()

In intensity mode without data, colorbar VBox has canvas but no colorbar content.

test_colormode_selector_has_intensity()

The colormode selector should include 'Intensity' when intensity_map is set.

test_colormode_selector_with_controls_has_intensity()

Intensity is available when the renderer can run diagnostics.

test_colormode_selector_without_map_omits_intensity()

Intensity is unavailable until a map or controls are provided.

test_data_not_stale_with_map()

With intensity_map, _data_stale should be False.

test_data_stale_default()

Without intensity_map, _data_stale should be True.

test_grey_all_components()

_grey_all_components sets all component colors to grey.

test_init_with_intensity_map()

Renderer should store intensity params and compute min/max.

test_intensity_controls_exist()

create_intensity_controls returns a VBox with hidden display.

test_intensity_widgets_populated()

After creating controls, _intensity_widgets dict is populated.

test_log_scale_control_requires_nonnegative_data()

Log scale is enabled only for nonnegative intensity data.

test_negative_intensity_data_uses_linear_colorbar()

Negative values disable logarithmic scaling and remain visible.

test_no_intensity_map_falls_through()

Without intensity_map, default colormode should work as before.

test_orders_of_mag_control_updates_renderer()

Changing orders of magnitude updates the renderer range setting.

test_orders_of_mag_limits_log_colorbar()

Log colorbar keeps the maximum and limits its lower decade range.

test_render_component_intensity_color()

Rendering a component in intensity mode should set _temp_color.

test_render_component_missing_intensity()

A component not in the intensity_map should use 0.0 intensity.

test_run_failure_warns_and_marks_data_stale()

Intensity failures should be visible and leave the widget stale.

test_run_uses_diagnostic_ncount_setting()

The ncount widget value persists through the diagnostic reset.

test_selecting_stale_intensity_mode_greys_components()

Selecting intensity mode greys components until data is available.

test_variable_dropdown_options()

Variable dropdown includes common McStas variables.

Attributes

longMessage

maxDiff

setUp()#

Hook method for setting up the test fixture before exercising it.

test_aggregate_dropdown_options()#

Aggregate dropdown includes all aggregation modes.

test_colorbar_stale_intensity()#

In intensity mode without data, colorbar VBox has canvas but no colorbar content.

test_colormode_selector_has_intensity()#

The colormode selector should include ‘Intensity’ when intensity_map is set.

test_colormode_selector_with_controls_has_intensity()#

Intensity is available when the renderer can run diagnostics.

test_colormode_selector_without_map_omits_intensity()#

Intensity is unavailable until a map or controls are provided.

test_data_not_stale_with_map()#

With intensity_map, _data_stale should be False.

test_data_stale_default()#

Without intensity_map, _data_stale should be True.

test_grey_all_components()#

_grey_all_components sets all component colors to grey.

test_init_with_intensity_map()#

Renderer should store intensity params and compute min/max.

test_intensity_controls_exist()#

create_intensity_controls returns a VBox with hidden display.

test_intensity_widgets_populated()#

After creating controls, _intensity_widgets dict is populated.

test_log_scale_control_requires_nonnegative_data()#

Log scale is enabled only for nonnegative intensity data.

test_negative_intensity_data_uses_linear_colorbar()#

Negative values disable logarithmic scaling and remain visible.

test_no_intensity_map_falls_through()#

Without intensity_map, default colormode should work as before.

test_orders_of_mag_control_updates_renderer()#

Changing orders of magnitude updates the renderer range setting.

test_orders_of_mag_limits_log_colorbar()#

Log colorbar keeps the maximum and limits its lower decade range.

test_render_component_intensity_color()#

Rendering a component in intensity mode should set _temp_color.

test_render_component_missing_intensity()#

A component not in the intensity_map should use 0.0 intensity.

test_run_failure_warns_and_marks_data_stale()#

Intensity failures should be visible and leave the widget stale.

test_run_uses_diagnostic_ncount_setting()#

The ncount widget value persists through the diagnostic reset.

test_selecting_stale_intensity_mode_greys_components()#

Selecting intensity mode greys components until data is available.

test_variable_dropdown_options()#

Variable dropdown includes common McStas variables.