pyvsimJSONDecoder

class pyvsim.System.pyvsimJSONDecoder(encoding=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)[source]

Extension of the python JSONDecoder class aware of pyvsim objects (via the PyvsimObject interface) and numpy.ndarrays

Methods

default(obj)[source]

Objects are encoded in a special-purpose dictionary with the magic entry “object_type”. When this key is found, an object of the type is instantiated and receives the data contained in the dictionary.

Another problem is dealing with object copies. The variable cornFlakes stores a reference to each object that was already unpacked, and when the internal identifiers match, the pointer is reused.

treatArray(obj)[source]

This is a tricky method when the numpy.ndarray contains objects (for example in the list of ray tracing intersections).

This Page