Ejemplo n.º 1
0
from algebraixlib.mathobjects import Atom, Couplet, Set, Multiset
from algebraixlib.algebras.relations import diag as _diag
from algebraixlib.util.test import create_test_object as _create_test_object

_print_examples = False


def _print_object_collection(name):
    if _print_examples:
        print('{name}:'.format(name=name))
        for key, val in sorted(globals()[name].items()):
            print('  "{key}": {val}'.format(key=key, val=val))


#: Basic Atom instances.
basic_atoms = {key: _create_test_object(Atom(val), key, val) for key, val in {
    'False': False,
    'True': True,
    '0': 0,
    '1': 1,
    '2': 2,
    '2.0': 2.0,
    "'2'": '2',
    '5': 5,
    "'6'": '6',
    'atom': Atom(33),
    'atom of atom': Atom(Atom(34)),
}.items()}
_print_object_collection('basic_atoms')

#: Basic Couplet instances.
Ejemplo n.º 2
0
from algebraixlib.mathobjects import Atom, Couplet, Set, Multiset
from algebraixlib.algebras.relations import diag as _diag
from algebraixlib.util.test import create_test_object as _create_test_object

_print_examples = False


def _print_object_collection(name):
    if _print_examples:
        print('{name}:'.format(name=name))
        for key, val in sorted(globals()[name].items()):
            print('  "{key}": {val}'.format(key=key, val=val))


#: Basic Atom instances.
basic_atoms = {key: _create_test_object(Atom(val), key, val) for key, val in {
    '2': 2,
    '2.0': 2.0,
    "'2'": '2',
    '5': 5,
    "'6'": '6',
    'atom': Atom(33),
    'atom of atom': Atom(Atom(34)),
}.items()}
_print_object_collection('basic_atoms')

#: Basic Couplet instances.
basic_couplets = {key: _create_test_object(Couplet(**val), key, val) for key, val in {
    '3x2': {'left': 2, 'right': 3},
    "'5'x'4'": {'left': '4', 'right': '5'},
    "'7'x6": {'left': Atom(6), 'right': Atom('7')},
Ejemplo n.º 3
0
from algebraixlib.algebras.relations import diag as _diag
from algebraixlib.util.test import create_test_object as _create_test_object

_print_examples = False


def _print_object_collection(name):
    if _print_examples:
        print('{name}:'.format(name=name))
        for key, val in sorted(globals()[name].items()):
            print('  "{key}": {val}'.format(key=key, val=val))


#: Basic Atom instances.
basic_atoms = {
    key: _create_test_object(Atom(val), key, val)
    for key, val in {
        '2': 2,
        '2.0': 2.0,
        "'2'": '2',
        '5': 5,
        "'6'": '6',
        'atom': Atom(33),
        'atom of atom': Atom(Atom(34)),
    }.items()
}
_print_object_collection('basic_atoms')

#: Basic Couplet instances.
basic_couplets = {
    key: _create_test_object(Couplet(**val), key, val)