pyJoules/energy_trace.py
def clean_data(self, guards: List[Callable[[EnergySample], bool]] = []):
        """
        Remove sample with negative energy values from the trace
        Guards can be added to specify rules to remove sample

        :param guards: list of function that is used as rules to remove samples. A guard is a function that take a
                       sample as parameter and return True if it must be keept in the trace, False otherwise
        """

        extended_guards = [lambda s: self._sample_havnt_negative_values(s)] + guards

        valid_samples = []
        for sample in self._samples:

            validity_list = [guard(sample) for guard in extended_guards]
            if reduce(and_, validity_list):
                valid_samples.append(sample)
        self._samples = valid_samples

        Remove sample with negative energy values from the trace
        Guards can be added to specify rules to remove sample

        :param guards: list of function that is used as rules to remove samples. A guard is a function that take a
                       sample as parameter and return True if it must be keept in the trace, False otherwise
        
Remove sample with negative energy values from the trace
Guards can be added to specify rules to remove sample
Remove sample with negative energy values from the trace Guards can be added to specify rules to remove sample
def clean_data(self, guards: List[Callable[[EnergySample], bool]] = []):
        extended_guards = [lambda s: self._sample_havnt_negative_values(s)] + guards
        valid_samples = []
        for sample in self._samples:
            validity_list = [guard(sample) for guard in extended_guards]
            if reduce(and_, validity_list):
                valid_samples.append(sample)
        self._samples = valid_samples
def clean_data ( self , guards : List [ Callable [ [ EnergySample ] , bool ] ] = [ ] ) : extended_guards = [ lambda s : self . _sample_havnt_negative_values ( s ) ] + guards valid_samples = [ ] for sample in self . _samples : validity_list = [ guard ( sample ) for guard in extended_guards ] if reduce ( and_ , validity_list ) : valid_samples . append ( sample ) self . _samples = valid_samples
Remove sample with negative energy values from the trace
Guards can be added to specify rules to remove sample
Remove sample with negative energy values from the trace Guards can be added to specify rules to remove sample
"""
        Remove sample with negative energy values from the trace
        Guards can be added to specify rules to remove sample

        :param guards: list of function that is used as rules to remove samples. A guard is a function that take a
                       sample as parameter and return True if it must be keept in the trace, False otherwise
        """
self
guards
List[Callable[[EnergySample], bool]]
list of function that is used as rules to remove samples. A guard is a function that take a
sample as parameter and return True if it must be keept in the trace, False otherwise
list of function that is used as rules to remove samples . A guard is a function that take a sample as parameter and return True if it must be keept in the trace False otherwise