How to use the pyodesys.util._default function in pyodesys

To help you get started, we’ve selected a few pyodesys examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bjodah / pyodesys / pyodesys / core.py View on Github external
def _plot(self, cb, internal_xout=None, internal_yout=None,
              internal_params=None, **kwargs):
        kwargs = kwargs.copy()
        if 'x' in kwargs or 'y' in kwargs or 'params' in kwargs:
            raise ValueError("x and y from internal_xout and internal_yout")

        _internal = getattr(self, '_internal', [None]*3)
        x, y, p = (_default(internal_xout, _internal[0]),
                   _default(internal_yout, _internal[1]),
                   _default(internal_params, _internal[2]))
        for post_processor in self.post_processors:
            x, y, p = post_processor(x, y, p)

        if 'names' not in kwargs:
            kwargs['names'] = getattr(self, 'names', None)
        else:
            if 'indices' not in kwargs and getattr(self, 'names', None) is not None:
                kwargs['indices'] = [self.names.index(n) for n in kwargs['names']]
                kwargs['names'] = self.names
        return cb(x, y, **kwargs)
github bjodah / pyodesys / pyodesys / core.py View on Github external
def _plot(self, cb, internal_xout=None, internal_yout=None,
              internal_params=None, **kwargs):
        kwargs = kwargs.copy()
        if 'x' in kwargs or 'y' in kwargs or 'params' in kwargs:
            raise ValueError("x and y from internal_xout and internal_yout")

        _internal = getattr(self, '_internal', [None]*3)
        x, y, p = (_default(internal_xout, _internal[0]),
                   _default(internal_yout, _internal[1]),
                   _default(internal_params, _internal[2]))
        for post_processor in self.post_processors:
            x, y, p = post_processor(x, y, p)

        if 'names' not in kwargs:
            kwargs['names'] = getattr(self, 'names', None)
        else:
            if 'indices' not in kwargs and getattr(self, 'names', None) is not None:
                kwargs['indices'] = [self.names.index(n) for n in kwargs['names']]
                kwargs['names'] = self.names
        return cb(x, y, **kwargs)
github bjodah / pyodesys / pyodesys / core.py View on Github external
def _plot(self, cb, internal_xout=None, internal_yout=None,
              internal_params=None, **kwargs):
        kwargs = kwargs.copy()
        if 'x' in kwargs or 'y' in kwargs or 'params' in kwargs:
            raise ValueError("x and y from internal_xout and internal_yout")

        _internal = getattr(self, '_internal', [None]*3)
        x, y, p = (_default(internal_xout, _internal[0]),
                   _default(internal_yout, _internal[1]),
                   _default(internal_params, _internal[2]))
        for post_processor in self.post_processors:
            x, y, p = post_processor(x, y, p)

        if 'names' not in kwargs:
            kwargs['names'] = getattr(self, 'names', None)
        else:
            if 'indices' not in kwargs and getattr(self, 'names', None) is not None:
                kwargs['indices'] = [self.names.index(n) for n in kwargs['names']]
                kwargs['names'] = self.names
        return cb(x, y, **kwargs)