Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "zeiss_inspect_api"
version = "2026.3.0.343"
version = "2026.3.0.984"
authors = [
{ name="Carl Zeiss GOM Metrology GmbH", email="info.optical.metrology@zeiss.com" },
]
Expand Down
2 changes: 1 addition & 1 deletion src/gom/__common__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Constants:

class Request (Enum):
'''
\brief Request id
@brief Request id

This id must match the id in the C++ part
'''
Expand Down
58 changes: 29 additions & 29 deletions src/gom/__encoding__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class Encoder:

class PackageType (Enum):
'''
\brief Package content data type
\attention Must match with the enumeration in the server
@brief Package content data type
@attention Must match with the enumeration in the server
'''
INVALID = 0
INT_8 = 1
Expand Down Expand Up @@ -133,8 +133,8 @@ class CdcEncoder (Encoder):

class Type (Enum):
'''
\brief Data types handled by the CDC encoding scheme.
\attention Must match with the enumeration in the server
@brief Data types handled by the CDC encoding scheme.
@attention Must match with the enumeration in the server
'''
NONE = 0
BOOLEAN = 1
Expand All @@ -160,23 +160,23 @@ class Type (Enum):

def encode(self, obj, context):
'''
\brief Encode data package
@brief Encode data package

Encodes an arbitrary Python object into binary payload package.
\param obj Python object
\param context Context for additional encoding information like used shared memory segments etc.
\return Binary data block
@param obj Python object
@param context Context for additional encoding information like used shared memory segments etc.
@return Binary data block
'''
buffer = bytearray()
self.encodeValue(buffer, obj, context)
return buffer

def encodeValue(self, buffer, obj, context):
'''
\brief Encode object into CDC (compact data container) format
@brief Encode object into CDC (compact data container) format

\param buffer Array chunk buffer the generated data is appended to
\param obj Arbitrary Python object to be encoded
@param buffer Array chunk buffer the generated data is appended to
@param obj Arbitrary Python object to be encoded
'''
if obj is None:
self.encodeType(buffer, CdcEncoder.Type.NONE)
Expand Down Expand Up @@ -347,10 +347,10 @@ def encodeStr(self, buffer, obj):

def decode(self, data, context):
'''
\brief Decode data package
@brief Decode data package

\param data Binary data block
\return Represented Python object
@param data Binary data block
@return Represented Python object
'''
class InStream:

Expand All @@ -368,13 +368,13 @@ def read(self, n):

def decodeValue(self, s, context):
'''
\brief Decode the next encoded Python object in the buffer
@brief Decode the next encoded Python object in the buffer

If the encoded object is a container, the container content is decoded
recursively.

\param s Data stream
\return Python object
@param s Data stream
@return Python object
'''
obj_type = CdcEncoder.Type(s.read(1)[0])

Expand Down Expand Up @@ -550,7 +550,7 @@ def decodeStr(self, s):
#
class JsonEncoder (Encoder):
'''
\brief Payload data encoding/decoding in JSON format
@brief Payload data encoding/decoding in JSON format
'''

#
Expand Down Expand Up @@ -585,12 +585,12 @@ class JsonEncoder (Encoder):

def encode(self, obj, context):
'''
\brief Encode data package
@brief Encode data package

Encodes an arbitrary Python object into binary payload package.

\param obj Python object
\return Binary data block
@param obj Python object
@return Binary data block
'''
return json.dumps(JsonEncoder.encode_traits(obj, context)).encode()

Expand All @@ -601,23 +601,23 @@ def decode(self, data, context):
This function decodes a binary payload data package into the represented
Python object.

\param data Binary data block
\return Python object
@param data Binary data block
@return Python object
'''
return JsonEncoder.decode_traits(json.loads(data.decode()), context)

@staticmethod
def encode_traits(obj, context):
'''
\brief Encode complex Python types into JSON compatible format
@brief Encode complex Python types into JSON compatible format

In JSON there is no way to transmit other than the standard objects (bool, int, ..., list, map).
So types like Item or dynamically registeres types must be converted into a map like representation
before being encoded.

\param obj Python object to be encoded
\param context Encoding context for keeping addition information like the used shared memory segements
\return Python object with complex data types converted into a map like representation
@param obj Python object to be encoded
@param context Encoding context for keeping addition information like the used shared memory segements
@return Python object with complex data types converted into a map like representation
'''

if hasattr(obj, '__json__'):
Expand Down Expand Up @@ -697,8 +697,8 @@ def decode_traits(obj, context):
into native Python objects. This function is then called to convert the dictionary objects
which are representing dynamic types into these types.

\param obj Python object in decoded format
\return Python object with all intermediate types resolved
@param obj Python object in decoded format
@return Python object with all intermediate types resolved
'''

result = None
Expand Down
24 changes: 12 additions & 12 deletions src/gom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@

def tr(text, id=None):
'''
\brief Return translated version of the given test
@brief Return translated version of the given test

This function is added to the global namespace of the executed script and can be used
to receive translations from the packages *.xlf files.

Being a global function, this function will be available in the executed script, too.

\param text Text to be translated
\param id Translation id of the text. Optional, used in the GOM internal translation process.
\return Translation in the current locale
@param text Text to be translated
@param id Translation id of the text. Optional, used in the GOM internal translation process.
@return Translation in the current locale
'''
translated = text

Expand All @@ -86,7 +86,7 @@ def tr(text, id=None):

class RequestError (RuntimeError):
'''
\brief Exception type raised from an failed request
@brief Exception type raised from an failed request
'''

def __init__(self, description, error_code, error_log):
Expand Down Expand Up @@ -122,7 +122,7 @@ def __reduce__(self):

class BreakError (Exception):
'''
\brief Exception raised if the running script is to be terminated
@brief Exception raised if the running script is to be terminated
'''

def __init__(self, text=''):
Expand All @@ -134,7 +134,7 @@ def __repr__(self):

class Indexable (object):
'''
\brief Object representing a indexable proxy to some partially resolved item.
@brief Object representing a indexable proxy to some partially resolved item.

Example: 'gom.app.project.inspection['Point cloud'].coordinate' does not provide
a token itself. Instead, it can be used together with an index to access single
Expand Down Expand Up @@ -189,7 +189,7 @@ def from_params(params):

class Item (object):
'''
\brief An object of this class represents a single item in the applications item space
@brief An object of this class represents a single item in the applications item space

Each Tom::ScriptObject has a unique item id, like 'I#!1234', which is used to
link an item to the corresponding C++ object.
Expand Down Expand Up @@ -297,7 +297,7 @@ def from_params(params):

class Array (object):
'''
\brief Data array container representation
@brief Data array container representation

An object of this type is being returned if the 'data' token is queried from
an item, like in 'element.data.coordinate'. So after the 'data' part of the
Expand Down Expand Up @@ -415,7 +415,7 @@ def numpy_imported_hook(module):

class ResourceAccess (object):
'''
\brief Resource accessing class
@brief Resource accessing class

This object represents the virtual script object 'gom.app.resource' which can
be used to access script resources. The resource is returned as a 'bytes ()' array.
Expand Down Expand Up @@ -446,7 +446,7 @@ def from_params(params):

class Command (object):
'''
\brief Command or command namespace representing object.
@brief Command or command namespace representing object.

This is anything starting with 'gom.script' or 'gom.interactive'
'''
Expand Down Expand Up @@ -517,7 +517,7 @@ def create_overload_group(name):

class Object (object):
'''
\brief Value representing a generic object instance without specialized script type interface
@brief Value representing a generic object instance without specialized script type interface
'''

def __init__(self, params):
Expand Down
4 changes: 2 additions & 2 deletions src/gom/__network__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

class EncoderContext:
'''
\brief Encoding context caring for shared memory segments
@brief Encoding context caring for shared memory segments
'''

def __init__(self):
Expand All @@ -65,7 +65,7 @@ def __exit__(self, exception, value, traceback):

class DecoderContext:
'''
\brief Decoding context caring for shared memory segments
@brief Decoding context caring for shared memory segments
'''

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion src/gom/__test__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

class TestInterface:
'''
\brief Function collection for debugging and testing
@brief Function collection for debugging and testing
'''

def reflect(self, value):
Expand Down
12 changes: 6 additions & 6 deletions src/gom/__tools__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def filter_exception_traceback(tb):

class StdoutFlusher:
'''
\brief This class writes stdout events and flushes the text buffer immediately
@brief This class writes stdout events and flushes the text buffer immediately
'''

def __init__(self):
Expand Down Expand Up @@ -122,7 +122,7 @@ def __exit__(self, ext_type, exc_value, traceback):

class StderrFlusher:
'''
\brief This class writes stderr events and flushes the text buffer immediately
@brief This class writes stderr events and flushes the text buffer immediately
'''

def __init__(self):
Expand Down Expand Up @@ -258,7 +258,7 @@ def find_spec(self, fullname, path, target=None):

class EnvironmentListener (collections.abc.Mapping):
'''
\brief Listener for changes to the environment variables
@brief Listener for changes to the environment variables
'''

def __enter__(self):
Expand Down Expand Up @@ -341,7 +341,7 @@ def __str__(self):

class ExitHandler:
'''
\brief This class wraps the standard 'sys.exit ()' functions
@brief This class wraps the standard 'sys.exit ()' functions
'''

original_exit = None
Expand Down Expand Up @@ -380,7 +380,7 @@ def emit(self, record):

class Console:
'''
\brief Unfiltered stream for direct console output (for test script purposes)
@brief Unfiltered stream for direct console output (for test script purposes)
'''

def write(self, text):
Expand All @@ -392,7 +392,7 @@ def flush(self):

class NumpyErrorMessageFacade:
'''
\brief Numpy error message facade
@brief Numpy error message facade

This class is used to raise a self speaking error message in case of using
numpy functions without prior importing the numpy library. This is needed because
Expand Down
Loading