def _recusiveReplaceArrayWithPlaceholder(self, state):
        """
        replace all numpy.array within the state dict
        with a placeholder
        this allows to save the arrays extra using numpy.save_compressed
        """
        arrays = {}

        def recursive(state):
            for key, val in state.items():
                if isinstance(val, dict):
                    recursive(val)
                else:
                    if isinstance(val, np.ndarray):
                        name = 'arr_%i' % recursive.c
                        arrays[name] = val
                        state[key] = name
                        recursive.c += 1
        recursive.c = 0
        recursive(state)
        return arrays
replace all numpy.array within the state dict
        with a placeholder
        this allows to save the arrays extra using numpy.save_compressed