> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CustomModelTester Class Reference

Part of [Mop](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__mop)

This class can be used in python context to check if all Interface functions of a custom model are implemented correctly.

## Public Member Functions

| Type | Name |
| - | - |
| virtual string | [\_\_str\_\_](#a3031d648b73235d11d64df95db3d84ce) () Function to allow printing instances of this class in python. |
| | [CustomModelTester](#a3343f987a44114a7ec902f90e3a25085) () Constructor. |
| virtual | [deserializeModel](#a450f9bf11531eb63544171e8a826b27d) (string state) Function to deserializatize a model from its former state-string. |
| virtual string | [serializeModel](#aa31948651298e7baa48185a94586a3d8) () Function to call the python models serialization function and return its state as a string. |
| virtual bool | [test](#a5cd36c1eb84f60075b42c405265d0fc1) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) points) Tests the model by invoking all of its API functions. Does not perform correctness checks. Just checks if the Interface is callable. |
| virtual bool | [testSerialization](#a63d9add55ef26eefce14e92c7efbd72b) () Tests if the models serialization functions are working. |

## Public Attributes

| Type | Name |
| - | - |
| apply SWIGTYPE \* | [DISOWN](#aa936348f586ed71a2a8585a4b16b20fc) Destructor. |

## Detailed Description

This class can be used in python context to check if all Interface functions of a custom model are implemented correctly.

## Member Function Documentation

### \_\_str\_\_()

```cpp theme={null}
virtual string __str__()
```

`virtual`

Function to allow printing instances of this class in python.

**Returns**

A string with information on the instance

### deserializeModel()

```cpp theme={null}
virtual deserializeModel(string state)
```

`virtual`

Function to deserializatize a model from its former state-string.

**Parameters**

| Name | Description |
| - | - |
| state | Encoded state of the custom model |

### serializeModel()

```cpp theme={null}
virtual string serializeModel()
```

`virtual`

Function to call the python models serialization function and return its state as a string.

**Returns**

Encoded state of the custom model

### test()

```cpp theme={null}
virtual bool test(Matrix points)
```

`virtual`

Tests the model by invoking all of its API functions. Does not perform correctness checks. Just checks if the Interface is callable.

**Parameters**

| Name | Description |
| - | - |
| points | The points to call the models function with |

**Returns**

True iff all API functions are present.

### testSerialization()

```cpp theme={null}
virtual bool testSerialization()
```

`virtual`

Tests if the models serialization functions are working.

**Returns**

True iff both serialization and deserialization is working

## Member Data Documentation

### DISOWN

```cpp theme={null}
apply SWIGTYPE * DISOWN
```

**Initial value:**

```lua theme={null}
{CustomModelInterface * model}

 virtual  registerModel(CustomModelInterface * model)
```

Destructor.

Internal function for the python classes to interact with the underlying cpp model Should not be called by a user, needs to be public in SWIG context.

Register a custom model with the [CustomModelTester](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_custom_model_tester.md) Needs to be called from Python. Takes ownership of the pointer.

**Parameters**

| Name | Description |
| - | - |
| model | The model to use with the model tester |
| cpp\_model | The C++ wrapper model that can is used to manage the python model |
