How to use the orange3.Orange.widgets.visualize.owvenndiagram.ComparableInstance function in Orange3

To help you get started, we’ve selected a few Orange3 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 BioDepot / BioDepot-workflow-builder / orange3 / Orange / widgets / visualize / owvenndiagram.py View on Github external
if self.useidentifiers:
                attr = self.itemsetAttr(key)
                if attr is not None:
                    mask = list(map(match, (inst[attr] for inst in input.table)))
                else:
                    mask = [False] * len(input.table)

                def instance_key(inst):
                    return str(inst[attr])

                def instance_key_all(inst):
                    return str(inst[attr])

            else:
                mask = [
                    ComparableInstance(inst) in selected_items for inst in input.table
                ]
                _map = {item: str(i) for i, item in enumerate(selected_items)}
                _map_all = {
                    ComparableInstance(i): hash(ComparableInstance(i))
                    for i in input.table
                }

                def instance_key(inst):
                    return _map[ComparableInstance(inst)]

                def instance_key_all(inst):
                    return _map_all[ComparableInstance(inst)]

            mask = numpy.array(mask, dtype=bool)
            subset = input.table[mask]
github BioDepot / BioDepot-workflow-builder / orange3 / Orange / widgets / visualize / owvenndiagram.py View on Github external
else:
                    mask = [False] * len(input.table)

                def instance_key(inst):
                    return str(inst[attr])

                def instance_key_all(inst):
                    return str(inst[attr])

            else:
                mask = [
                    ComparableInstance(inst) in selected_items for inst in input.table
                ]
                _map = {item: str(i) for i, item in enumerate(selected_items)}
                _map_all = {
                    ComparableInstance(i): hash(ComparableInstance(i))
                    for i in input.table
                }

                def instance_key(inst):
                    return _map[ComparableInstance(inst)]

                def instance_key_all(inst):
                    return _map_all[ComparableInstance(inst)]

            mask = numpy.array(mask, dtype=bool)
            subset = input.table[mask]

            annotated_subset = input.table
            id_column = numpy.array(
                [[instance_key_all(inst)] for inst in annotated_subset]
            )
github BioDepot / BioDepot-workflow-builder / orange3 / Orange / widgets / visualize / owvenndiagram.py View on Github external
def __eq__(self, other):
        # XXX: comparing NaN with different payload
        return (
            isinstance(other, ComparableInstance)
            and domain_eq(self.domain, other.domain)
            and self.inst.x.data.tobytes() == other.inst.x.data.tobytes()
            and self.inst.y.data.tobytes() == other.inst.y.data.tobytes()
        )