def _extract_state_monitor(self, monitor):

        self.f_set(varname=monitor.varname)
        self.f_set(unit=repr(monitor.unit))

            
        self.f_set(record=monitor.record)
        
        self.f_set(when=monitor.when)
        
        self.f_set(timestep=monitor.timestep)

        self.f_set(source=str(monitor.P))
        self.f_set(times_unit='second')

        if np.mean(monitor.mean) != 0.0:
            self.f_set(mean=monitor.mean)
            self.f_set(var=monitor.var)
        if len(monitor.times) > 0:
            self.f_set(times=monitor.times)
            self.f_set(values=monitor.values)
dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/brian/parameter.py/BrianMonitorResult._extract_state_monitor/original