How to use the jupyter-innotater.jupyter_innotater.data.Innotation function in jupyter-innotater

To help you get started, we’ve selected a few jupyter-innotater 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 ideonate / jupyter-innotater / jupyter-innotater / jupyter_innotater / combine.py View on Github external
__all__ = ['GroupedInnotation', 'RepeatInnotation']

from ipywidgets import HBox, VBox, Button

from .data import Innotation
from .mixins import ChildrenChangeNotifierMixin


class GroupedInnotation(Innotation):

    def __init__(self, *args, **kwargs):

        super().__init__(**kwargs)

        self.childinnotations = args

    def post_register(self, datamanager):
        for innot in self.childinnotations:
            innot.post_register(datamanager)

    def post_widget_create(self, datamanager):
        for innot in self.childinnotations:
            innot.post_widget_create(datamanager)

    def _create_widget(self):
github ideonate / jupyter-innotater / jupyter-innotater / jupyter_innotater / manager.py View on Github external
def __init__(self, inputs, targets, indexes=None):

        if inputs is None: inputs = []
        if targets is None: targets = []

        self.inputs = [inputs] if isinstance(inputs, Innotation) else inputs
        self.targets = [targets] if isinstance(targets, Innotation) else targets

        self.alldws = {}

        l = -1

        for dw in self.inputs+self.targets:
            l = self._add_to_alldws(dw, l)

        self.underlying_len = l

        self.indexes = indexes
        if indexes is not None:
            if len(indexes) == 0:
                raise Exception("indexes must be a non-empty array-like containing integers or booleans")

            # boolean or numpy.bool_ - and might be a col vector
github ideonate / jupyter-innotater / jupyter-innotater / jupyter_innotater / manager.py View on Github external
def __init__(self, inputs, targets, indexes=None):

        if inputs is None: inputs = []
        if targets is None: targets = []

        self.inputs = [inputs] if isinstance(inputs, Innotation) else inputs
        self.targets = [targets] if isinstance(targets, Innotation) else targets

        self.alldws = {}

        l = -1

        for dw in self.inputs+self.targets:
            l = self._add_to_alldws(dw, l)

        self.underlying_len = l

        self.indexes = indexes
        if indexes is not None:
            if len(indexes) == 0:
                raise Exception("indexes must be a non-empty array-like containing integers or booleans")