sgpykit.util.struct

Functions

is_list_math_equal(list1, list2[, tol])

Recursively compares two nested lists or arrays to check if they are equal.

Classes

Struct(**kwargs)

A simple struct-like class that allows attribute access and dictionary-like item access.

class sgpykit.util.struct.Struct(**kwargs)[source]

Bases: object

A simple struct-like class that allows attribute access and dictionary-like item access.

This class is designed to mimic MATLAB struct behavior, allowing flexible field access and comparison operations.

Attributes:
**kwargsdict

Arbitrary keyword arguments that become attributes of the struct.

Methods

fieldnames()

Return a list of the struct's field names.

isequal_to(obj2)

Check if this struct is equal to another struct-like object.

fieldnames()[source]

Return a list of the struct’s field names.

Returns:
list

A list of the struct’s field names.

isequal_to(obj2)[source]

Check if this struct is equal to another struct-like object.

Parameters:
obj2Struct or StructArray

The structure object to compare with.

Returns:
bool

True if the structs are equal, False otherwise.