xopto.mcbase.mctest module

class McTest(mc_obj: xopto.mcbase.mcobject.McObject, reference: numpy.ndarray, description: str)[source]

Bases: object

Base class of Simulator tests.

Parameters
  • mc (McObject) – Simulator instance.

  • reference (np.ndarray) – Reference data expected to be produced by the test.

  • description (str) – Description of the test.

property description: str

Test description.

property error: numpy.ndarray

Test error.

property mc: xopto.mcbase.mcobject.McObject

Simulator instance.

passed()bool[source]

Implement this method in the derived calass. Return True if the test is successful or False if it fails.

progress_str(ndone: int, ntotal: int, tjob: float)str[source]

Create a progress message.

Parameters
  • ndone (int) – The number of completed tasks.

  • ntotal (int) – The total number of tasks.

  • job (float) – Time since start of the job.

  • Returns

  • report (str) – Progress report string.

property reference: numpy.ndarray

Reference/expected results.

property simulated: numpy.ndarray

Simulated results.