PYME.LMVis.tests.gl_test_objects module

class PYME.LMVis.tests.gl_test_objects.Cloud(amount_points)

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
DISTANCE = 200.0
class PYME.LMVis.tests.gl_test_objects.Clusterizer(test_object, multiply, distance)

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
get_offsets()
get_points()
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
get_offsets()
get_points()
to_json()
class PYME.LMVis.tests.gl_test_objects.Ellipsoid(amount_points, axis_a=4, axis_b=5, axis_c=2, size=5)

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Parameters:

amount_points amount of points in this ellipsoid

axis_a

axis_b

axis_c

size the maximum dimension of axis_a, axis_b, axis_c is max_size micrometers big

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
AXIS_A = 4
AXIS_B = 5
AXIS_C = 2
to_json()
class PYME.LMVis.tests.gl_test_objects.ExponentialClusterizer(test_object, expectation_value, distance)

Bases: PYME.LMVis.tests.gl_test_objects.Clusterizer

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
get_offsets()
get_points()
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
get_points()
to_json()
class PYME.LMVis.tests.gl_test_objects.GridContainer(size, offsets)

Bases: PYME.LMVis.tests.gl_test_objects.TestObjectContainer

Parameters:

size (rows, columns) in nm, all > 0

offsets (row_offset, column_offset) in nm, all > 0

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
get_column(value)
get_row(value)
re_enumerate()
save(file_name)
scale([x, y, z])
shuffle()
to_json()
translate([x, y, z])
Parameters:
get_column(value)
get_row(value)
re_enumerate()
shuffle()
to_json()
x
y
class PYME.LMVis.tests.gl_test_objects.HarmonicCell(input_file, dimensions)

Bases: PYME.LMVis.tests.gl_test_objects.TestObjectContainer

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
class PYME.LMVis.tests.gl_test_objects.HarmonicCellBackground(file_name, dimensions, density=40)

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Parameters:

self

file hdf file that contains the models parameters

dimensions dimensions of the bounding box in micrometer

density density of the bounding box/the HarmonicCellBackground per micrometer^2

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
get_coordinates(theta, phi, radius) this method will create a point within the surface in coordinates
get_radius(theta, phi)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
get_coordinates(theta, phi, radius)

this method will create a point within the surface in coordinates Parameters ———- theta [0, pi[ phi [0, 2pi[ radius [0,1[

Returns:(x, y, z) in micrometers
get_radius(theta, phi)
to_json()
class PYME.LMVis.tests.gl_test_objects.NineCollections

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
class PYME.LMVis.tests.gl_test_objects.NoisePlane(diameter=1.0, density=20.0)

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Parameters:

diameter in micrometer

density per micrometer^2

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
to_json()
class PYME.LMVis.tests.gl_test_objects.TestObject(x, y, z, probe=0)

Bases: object

This object represents a general test object. It handles the coordinates for the specific object. It allows translation and scaling for the object. It handles a list of added sub_objects. Adding sub_objects is thread safe. Changing values of the objects is not secured while multi-threading.

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
Parameters:

x

y

z

probe either scalar value or list of scalars which matches the size of x,y and z

as numpy.ndarray

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
MICROMETER_CONVERSION_CONSTANT = 1000
add(other)

This method adds a new sub_object to this test object. This operation is thread safe. So many threads could try to add objects, but it won’t result in a strange situation. Parameters ———- other new sub_object

add_probe(probe_list=None, values=0, size=0)
Parameters:

probe_list list that the new values should be added to

values if value is scalar, use size to create a fitting list

size scalar value

add_to_json(key, value)
probe
probe_value
save(file_name)
scale(x=1, y=1, z=1)
to_json()
translate(x=0, y=0, z=0)
Parameters:

x translation in x direction in micrometer

y translation in y direction in micrometer

z translation in z direction in micrometer

x
y
z
class PYME.LMVis.tests.gl_test_objects.TestObjectContainer

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
probe
scale(x=1, y=1, z=1)
translate(x=0, y=0, z=0)
Parameters:

x translation in x direction in micrometer

y translation in y direction in micrometer

z translation in z direction in micrometer

x
y
z
class PYME.LMVis.tests.gl_test_objects.TestObjectEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, encoding='utf-8', default=None)

Bases: json.encoder.JSONEncoder

Constructor for JSONEncoder, with sensible defaults.

If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped.

If ensure_ascii is true (the default), all non-ASCII characters in the output are escaped with uXXXX sequences, and the results are str instances consisting of ASCII characters only. If ensure_ascii is False, a result may be a unicode instance. This usually happens if the input contains unicode strings or the encoding parameter is used.

If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place.

If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats.

If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis.

If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. Since the default item separator is ‘, ‘, the output might include trailing whitespace when indent is specified. You can use separators=(‘,’, ‘: ‘) to avoid this.

If specified, separators should be a (item_separator, key_separator) tuple. The default is (‘, ‘, ‘: ‘). To get the most compact JSON representation you should specify (‘,’, ‘:’) to eliminate whitespace.

If specified, default is a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError.

If encoding is not None, then all input strings will be transformed into unicode using that encoding prior to JSON-encoding. The default is UTF-8.

Methods

default(obj)
default(obj)
class PYME.LMVis.tests.gl_test_objects.Vesicle(diameter=1.0, amount_points=100, hole_size=1.5707963267948966, hole_pos=0)

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Parameters:

diameter of the vesicle in micrometer

hole_size in rad [0-2*pi]

hole_pos in rad [0-2*pi]

0 => y=0, x=1 => right

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
has_hole()
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
WIDTH = 1
has_hole()
to_json()
class PYME.LMVis.tests.gl_test_objects.Worm(kbp=100, length_per_kbp=10.0, step_length=20.0, persist_length=50, probe=0)

Bases: PYME.LMVis.tests.gl_test_objects.TestObject

Attributes

probe
probe_value
x
y
z

Methods

add(other) This method adds a new sub_object to this test object.
add_probe([probe_list, values, size])
Parameters:
add_to_json(key, value)
save(file_name)
scale([x, y, z])
to_json()
translate([x, y, z])
Parameters:
to_json()