py21cmfast.wrapper.structs.StructInstanceWrapper

class py21cmfast.wrapper.structs.StructInstanceWrapper(wrapped, ffi)

A wrapper for instances of C structs.

This is as opposed to StructWrapper, which is for the un-instantiated structs.

Parameters:
  • wrapped – The reference to the C object to wrap (contained in the cffi.lib object).

  • ffi – The cffi.ffi object.

__iter__()

Iterate over the object like a dict.

__repr__()

Return a unique representation of the instance.

__setattr__(name, value)

Set an attribute of the instance, attempting to change it in the C struct as well.

filtered_repr(filter_params)

Get a fully unique representation of the instance that filters out some parameters.

Parameters:

filter_params (list of str) – The parameter names which should not appear in the representation.

items()

Yield (name, value) pairs for each element of the struct.

keys()

Return a list of names of elements in the struct.