How to use the phylib.utils._types._is_integer function in phylib

To help you get started, we’ve selected a few phylib 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 cortex-lab / phy / phy / plot / axes.py View on Github external
def set_nbins(self, nbinsx=None, nbinsy=None):
        """Change the number of bins on the x and y axes."""
        nbinsx = self._bins_margin * nbinsx if _is_integer(nbinsx) else self._default_nbinsx
        nbinsy = self._bins_margin * nbinsy if _is_integer(nbinsy) else self._default_nbinsy
        self.locx = MaxNLocator(nbins=nbinsx, steps=self._default_steps)
        self.locy = MaxNLocator(nbins=nbinsy, steps=self._default_steps)
github cortex-lab / phy / phy / plot / axes.py View on Github external
def set_nbins(self, nbinsx=None, nbinsy=None):
        """Change the number of bins on the x and y axes."""
        nbinsx = self._bins_margin * nbinsx if _is_integer(nbinsx) else self._default_nbinsx
        nbinsy = self._bins_margin * nbinsy if _is_integer(nbinsy) else self._default_nbinsy
        self.locx = MaxNLocator(nbins=nbinsx, steps=self._default_steps)
        self.locy = MaxNLocator(nbins=nbinsy, steps=self._default_steps)
github cortex-lab / phy / phy / gui / widgets.py View on Github external
def select(self, ids, callback=None, **kwargs):
        """Select some rows in the table from Python.

        This function calls `table.select()` in Javascript, which raises a Javascript event
        relayed to Python. This sequence of actions is the same when the user selects
        rows directly in the HTML view.

        """
        ids = _uniq(ids)
        assert all(_is_integer(_) for _ in ids)
        self.eval_js('table.select({}, {});'.format(dumps(ids), dumps(kwargs)), callback=callback)