bucky.model.state#

Provide a class to hold the internal state vector to the compartment model (and track compartment indices).

Module Contents#

Classes#

buckyState

Class to manage the state of the bucky compartments (and their indices).

Functions#

slice_to_cpu(s)

Ensure the values of the slice aren't cupy arrays to prevent an unsupported implict conversion in xp.r_.

class bucky.model.state.buckyState(structure_cfg, Nij, state=None, dtype=xp.float32)[source]#

Class to manage the state of the bucky compartments (and their indices).

__getattribute__(self, attr)[source]#

Allow for . access to the compartment indices, otherwise return the ‘normal’ attribute.

__setattr__(self, attr, x)[source]#

Allow setting of compartments using . notation, otherwise default to normal attribute behavior.

init_S(self)[source]#

Init the S compartment such that N=1.

property state_shape(self)#

Return the shape of the internal state ndarray.

validate_state(self)[source]#

Validate that the state is valid (finite, nonnegative, N=1).

zeros_like(self)[source]#

Return a mostly shallow copy of self but with a zeroed out self.state.

bucky.model.state.slice_to_cpu(s)[source]#

Ensure the values of the slice aren’t cupy arrays to prevent an unsupported implict conversion in xp.r_.