How to use the ops.Op function in ops

To help you get started, we’ve selected a few ops 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 daniel-molina / visualequation / ops.py View on Github external
('hbar', r'\hbar '),
    ('eth', r'\eth '),
    ('wp', r'\wp '),
]

MENUITEM_ACCENTS = Ops(
    ops_l=ACCENTS,
    clickable_size=(50, 50), dpi=300,
    menuitem=[r'\acute{{a}}\;\tilde{{B}}'])

INDICES = [
    ('super', (Op(2, r'{0}^{{{1}}}'), [r'\cdot^{{\square}}'])),
    ('sub', (Op(2, r'{0}_{{{1}}}'), [r'\cdot_{{\square}}'])),
    ('lsuper', (Op(2, r'{{}}^{{{1}}}{0}'), [r'{{}}^{{\square}}\cdot'])),
    ('lsub', (Op(2, r'{{}}_{{{1}}}{0}'), [r'{{}}_{{\square}}\cdot'])),
    ('supersub', (Op(3, r'{0}^{{{1}}}_{{{2}}}'),
                  [r'\cdot^{{\square}}_{{\square}}'])),
    ('lsuperlsub', (Op(3, r'{{}}^{{{2}}}_{{{1}}}{0}'),
                    [r'{{}}^{{\square}}_{{\square}}\cdot'])),
    ('superlsuper', (Op(3, r'{{}}^{{{1}}}{0}^{{{2}}}'),
                     [r'{{}}^{{\square}}\cdot^{{\square}}'])),
    ('sublsub', (Op(3, r'{{}}_{{{1}}}{0}_{{{2}}}'),
                     [r'{{}}_{{\square}}\cdot_{{\square}}'])),
    ('supersublsuper', (Op(4, r'{{}}^{{{1}}}{0}^{{{3}}}_{{{2}}}'),
                  [r'{{}}^{{\square}}\cdot^{{\square}}_{{\square}}'])),
    ('supersublsub', (Op(4, r'{{}}_{{{1}}}{0}^{{{3}}}_{{{2}}}'),
                  [r'{{}}_{{\square}}\cdot^{{\square}}_{{\square}}'])),
    ('sublsublsuper', (Op(4, r'{{}}_{{{1}}}^{{{2}}}{0}_{{{3}}}'),
                  [r'{{}}_{{\square}}^{{\square}}\cdot_{{\square}}'])),
    ('superlsuperlsub', (Op(4, r'{{}}^{{{1}}}_{{{2}}}{0}^{{{3}}}'),
                  [r'{{}}^{{\square}}_{{\square}}\cdot^{{\square}}'])),
    ('supersublsuperlsub',
github daniel-molina / visualequation / ops.py View on Github external
MENUITEM_ACCENTS = Ops(
    ops_l=ACCENTS,
    clickable_size=(50, 50), dpi=300,
    menuitem=[r'\acute{{a}}\;\tilde{{B}}'])

INDICES = [
    ('super', (Op(2, r'{0}^{{{1}}}'), [r'\cdot^{{\square}}'])),
    ('sub', (Op(2, r'{0}_{{{1}}}'), [r'\cdot_{{\square}}'])),
    ('lsuper', (Op(2, r'{{}}^{{{1}}}{0}'), [r'{{}}^{{\square}}\cdot'])),
    ('lsub', (Op(2, r'{{}}_{{{1}}}{0}'), [r'{{}}_{{\square}}\cdot'])),
    ('supersub', (Op(3, r'{0}^{{{1}}}_{{{2}}}'),
                  [r'\cdot^{{\square}}_{{\square}}'])),
    ('lsuperlsub', (Op(3, r'{{}}^{{{2}}}_{{{1}}}{0}'),
                    [r'{{}}^{{\square}}_{{\square}}\cdot'])),
    ('superlsuper', (Op(3, r'{{}}^{{{1}}}{0}^{{{2}}}'),
                     [r'{{}}^{{\square}}\cdot^{{\square}}'])),
    ('sublsub', (Op(3, r'{{}}_{{{1}}}{0}_{{{2}}}'),
                     [r'{{}}_{{\square}}\cdot_{{\square}}'])),
    ('supersublsuper', (Op(4, r'{{}}^{{{1}}}{0}^{{{3}}}_{{{2}}}'),
                  [r'{{}}^{{\square}}\cdot^{{\square}}_{{\square}}'])),
    ('supersublsub', (Op(4, r'{{}}_{{{1}}}{0}^{{{3}}}_{{{2}}}'),
                  [r'{{}}_{{\square}}\cdot^{{\square}}_{{\square}}'])),
    ('sublsublsuper', (Op(4, r'{{}}_{{{1}}}^{{{2}}}{0}_{{{3}}}'),
                  [r'{{}}_{{\square}}^{{\square}}\cdot_{{\square}}'])),
    ('superlsuperlsub', (Op(4, r'{{}}^{{{1}}}_{{{2}}}{0}^{{{3}}}'),
                  [r'{{}}^{{\square}}_{{\square}}\cdot^{{\square}}'])),
    ('supersublsuperlsub',
     (Op(5, r'{{}}^{{{2}}}_{{{1}}}{0}^{{{4}}}_{{{3}}}'),
      [r'{{}}^{{\square}}_{{\square}}\cdot^{{\square}}_{{\square}}'])),
]
github daniel-molina / visualequation / ops.py View on Github external
(Op(5, r'{{}}^{{{2}}}_{{{1}}}{0}^{{{4}}}_{{{3}}}'),
      [r'{{}}^{{\square}}_{{\square}}\cdot^{{\square}}_{{\square}}'])),
]

#    ('binomial', (Op(2, r'\binom{{{0}}}{{{1}}}'),
#     [r'\binom{{\cdot}}{{\square}}'])),

MENUITEM_INDICES = Ops(
    ops_l=INDICES,
    clickable_size=(60, 70), dpi=200,
    menuitem=[r'a^b'])

MATHCONSTRUCTS = [
    ('frac', Op(2, r'\frac{{{0}}}{{{1}}}')),
    ('sqrt', Op(1, r'\sqrt{{{0}}}')),
    ('nsqrt', Op(2, r'\sqrt[{1}]{{{0}}}')),
    ('overline', Op(1, r'\overline{{{0}}}')),
    ('underline', Op(1, r'\underline{{{0}}}')),
    ('widehat', Op(1, r'\widehat{{{0}}}')),
    ('widetilde', Op(1, r'\widetilde{{{0}}}')),
    ('overrightarrow', Op(1, r'\overrightarrow{{{0}}}')),
    ('overleftarrow', Op(1, r'\overleftarrow{{{0}}}')),
    ('overbrace1', Op(1, r'\overbrace{{{0}}}')),
    ('underbrace1', Op(1, r'\underbrace{{{0}}}')),
    ('overbrace2', Op(2, r'\overbrace{{{0}}}^{{{1}}}')),
    ('underbrace2', Op(2, r'\underbrace{{{0}}}_{{{1}}}')),
]

MENUITEM_MATHCONSTRUCTS = Ops(
    ops_l=MATHCONSTRUCTS,
    clickable_size=(55, 70), dpi=200,
    menuitem=[r'\underbrace{{abc}}'])
github daniel-molina / visualequation / ops.py View on Github external
MENUITEM_MATHCONSTRUCTS = Ops(
    ops_l=MATHCONSTRUCTS,
    clickable_size=(55, 70), dpi=200,
    menuitem=[r'\underbrace{{abc}}'])    

DELIMITERS = [
    ('parenthesisb', Op(1, r'\left({0}\right)')),
    ('vertb', Op(1, r'\left|{0}\right|')),
    ('uppervertb', Op(1, r'\left\|{0}\right\|')),
    ('bracketsb', Op(1, r'\left\{{{0}\right\}}')),
    ('angleb', Op(1, r'\left\langle{0}\right\rangle')),
    ('floorb', Op(1, r'\left\lfloor{0}\right\rfloor')),
    ('ceilb', Op(1, r'\left\lceil{0}\right\rceil')),
    ('slashb', Op(1, r'\left/{0}\right\backslash')),
    ('sqbracketsb', Op(1, r'\left[{0}\right]')),
    ('lcornerb', Op(1, r'\left\llcorner{0}\right\lrcorner')),
    ('ucornerb', Op(1, r'\left\ulcorner{0}\right\urcorner')),
]

MENUITEM_DELIMITERS = Ops(
    ops_l=DELIMITERS,
    clickable_size=(70, 50), dpi=200,
    menuitem=[r'\left(ab\right)'])

FUNCTIONS = [
    ('arccos', r'\arccos '),
    ('arcsin', r'\arcsin '),
    ('arctan', r'\arctan '),
    ('arg', r'\arg '),
    ('cos', r'\cos '),
    ('cosh', r'\cosh '),
    ('coth', r'\coth '),
github daniel-molina / visualequation / ops.py View on Github external
[r'{{}}^{{\square}}_{{\square}}\cdot^{{\square}}'])),
    ('supersublsuperlsub',
     (Op(5, r'{{}}^{{{2}}}_{{{1}}}{0}^{{{4}}}_{{{3}}}'),
      [r'{{}}^{{\square}}_{{\square}}\cdot^{{\square}}_{{\square}}'])),
]

#    ('binomial', (Op(2, r'\binom{{{0}}}{{{1}}}'),
#     [r'\binom{{\cdot}}{{\square}}'])),

MENUITEM_INDICES = Ops(
    ops_l=INDICES,
    clickable_size=(60, 70), dpi=200,
    menuitem=[r'a^b'])

MATHCONSTRUCTS = [
    ('frac', Op(2, r'\frac{{{0}}}{{{1}}}')),
    ('sqrt', Op(1, r'\sqrt{{{0}}}')),
    ('nsqrt', Op(2, r'\sqrt[{1}]{{{0}}}')),
    ('overline', Op(1, r'\overline{{{0}}}')),
    ('underline', Op(1, r'\underline{{{0}}}')),
    ('widehat', Op(1, r'\widehat{{{0}}}')),
    ('widetilde', Op(1, r'\widetilde{{{0}}}')),
    ('overrightarrow', Op(1, r'\overrightarrow{{{0}}}')),
    ('overleftarrow', Op(1, r'\overleftarrow{{{0}}}')),
    ('overbrace1', Op(1, r'\overbrace{{{0}}}')),
    ('underbrace1', Op(1, r'\underbrace{{{0}}}')),
    ('overbrace2', Op(2, r'\overbrace{{{0}}}^{{{1}}}')),
    ('underbrace2', Op(2, r'\underbrace{{{0}}}_{{{1}}}')),
]

MENUITEM_MATHCONSTRUCTS = Ops(
    ops_l=MATHCONSTRUCTS,
github daniel-molina / visualequation / ops.py View on Github external
MENUITEM_GREEK_HEBREW_SYMBOLS1 = Ops(
    ops_l=LOWER_GREEK + UPPER_GREEK + VAR_GREEK + HEBREW + SYMBOLS1,
    clickable_size=(30, 30), dpi=200,
    menuitem=[r'\alpha\, \infty'])

ACCENTS = [
    ('acute', (Op(1, r'\acute{{{0}}}'), [r'\acute{{{\cdot}}}'])),
    ('breve', (Op(1, r'\breve{{{0}}}'), [r'\breve{{{\cdot}}}'])),
    ('ddot', (Op(1, r'\ddot{{{0}}}'), [r'\ddot{{{\cdot}}}'])),
    ('grave', (Op(1, r'\grave{{{0}}}'), [r'\grave{{{\cdot}}}'])),
    ('tilde', (Op(1, r'\tilde{{{0}}}'), [r'\tilde{{{\cdot}}}'])),
    ('bar', (Op(1, r'\bar{{{0}}}'), [r'\bar{{{\cdot}}}'])),
    ('check', (Op(1, r'\check{{{0}}}'), [r'\check{{{\cdot}}}'])),
    ('dot', (Op(1, r'\dot{{{0}}}'), [r'\dot{{{\cdot}}}'])),
    ('hat', (Op(1, r'\hat{{{0}}}'), [r'\hat{{{\cdot}}}'])),
    ('vec', (Op(1, r'\vec{{{0}}}'), [r'\vec{{{\cdot}}}'])),
    ('imath', r'\imath '),
    ('jmath', r'\jmath '),
    ('ell', r'\ell '),
    ('hbar', r'\hbar '),
    ('eth', r'\eth '),
    ('wp', r'\wp '),
]

MENUITEM_ACCENTS = Ops(
    ops_l=ACCENTS,
    clickable_size=(50, 50), dpi=300,
    menuitem=[r'\acute{{a}}\;\tilde{{B}}'])

INDICES = [
    ('super', (Op(2, r'{0}^{{{1}}}'), [r'\cdot^{{\square}}'])),
    ('sub', (Op(2, r'{0}_{{{1}}}'), [r'\cdot_{{\square}}'])),
github daniel-molina / visualequation / ops.py View on Github external
MENUITEM_MATHCONSTRUCTS = Ops(
    ops_l=MATHCONSTRUCTS,
    clickable_size=(55, 70), dpi=200,
    menuitem=[r'\underbrace{{abc}}'])    

DELIMITERS = [
    ('parenthesisb', Op(1, r'\left({0}\right)')),
    ('vertb', Op(1, r'\left|{0}\right|')),
    ('uppervertb', Op(1, r'\left\|{0}\right\|')),
    ('bracketsb', Op(1, r'\left\{{{0}\right\}}')),
    ('angleb', Op(1, r'\left\langle{0}\right\rangle')),
    ('floorb', Op(1, r'\left\lfloor{0}\right\rfloor')),
    ('ceilb', Op(1, r'\left\lceil{0}\right\rceil')),
    ('slashb', Op(1, r'\left/{0}\right\backslash')),
    ('sqbracketsb', Op(1, r'\left[{0}\right]')),
    ('lcornerb', Op(1, r'\left\llcorner{0}\right\lrcorner')),
    ('ucornerb', Op(1, r'\left\ulcorner{0}\right\urcorner')),
]

MENUITEM_DELIMITERS = Ops(
    ops_l=DELIMITERS,
    clickable_size=(70, 50), dpi=200,
    menuitem=[r'\left(ab\right)'])

FUNCTIONS = [
    ('arccos', r'\arccos '),
    ('arcsin', r'\arcsin '),
    ('arctan', r'\arctan '),
    ('arg', r'\arg '),
    ('cos', r'\cos '),
    ('cosh', r'\cosh '),
github daniel-molina / visualequation / ops.py View on Github external
('infty', r'\infty '),
    ('nabla', r'\nabla '),
    ('partial', r'\partial '),
    ('times', r'\times '),
    ('cdot', r'\cdot '),
    ('div', r'\div '),
]

MENUITEM_GREEK_HEBREW_SYMBOLS1 = Ops(
    ops_l=LOWER_GREEK + UPPER_GREEK + VAR_GREEK + HEBREW + SYMBOLS1,
    clickable_size=(30, 30), dpi=200,
    menuitem=[r'\alpha\, \infty'])

ACCENTS = [
    ('acute', (Op(1, r'\acute{{{0}}}'), [r'\acute{{{\cdot}}}'])),
    ('breve', (Op(1, r'\breve{{{0}}}'), [r'\breve{{{\cdot}}}'])),
    ('ddot', (Op(1, r'\ddot{{{0}}}'), [r'\ddot{{{\cdot}}}'])),
    ('grave', (Op(1, r'\grave{{{0}}}'), [r'\grave{{{\cdot}}}'])),
    ('tilde', (Op(1, r'\tilde{{{0}}}'), [r'\tilde{{{\cdot}}}'])),
    ('bar', (Op(1, r'\bar{{{0}}}'), [r'\bar{{{\cdot}}}'])),
    ('check', (Op(1, r'\check{{{0}}}'), [r'\check{{{\cdot}}}'])),
    ('dot', (Op(1, r'\dot{{{0}}}'), [r'\dot{{{\cdot}}}'])),
    ('hat', (Op(1, r'\hat{{{0}}}'), [r'\hat{{{\cdot}}}'])),
    ('vec', (Op(1, r'\vec{{{0}}}'), [r'\vec{{{\cdot}}}'])),
    ('imath', r'\imath '),
    ('jmath', r'\jmath '),
    ('ell', r'\ell '),
    ('hbar', r'\hbar '),
    ('eth', r'\eth '),
    ('wp', r'\wp '),
]
github daniel-molina / visualequation / ops.py View on Github external
('nabla', r'\nabla '),
    ('partial', r'\partial '),
    ('times', r'\times '),
    ('cdot', r'\cdot '),
    ('div', r'\div '),
]

MENUITEM_GREEK_HEBREW_SYMBOLS1 = Ops(
    ops_l=LOWER_GREEK + UPPER_GREEK + VAR_GREEK + HEBREW + SYMBOLS1,
    clickable_size=(30, 30), dpi=200,
    menuitem=[r'\alpha\, \infty'])

ACCENTS = [
    ('acute', (Op(1, r'\acute{{{0}}}'), [r'\acute{{{\cdot}}}'])),
    ('breve', (Op(1, r'\breve{{{0}}}'), [r'\breve{{{\cdot}}}'])),
    ('ddot', (Op(1, r'\ddot{{{0}}}'), [r'\ddot{{{\cdot}}}'])),
    ('grave', (Op(1, r'\grave{{{0}}}'), [r'\grave{{{\cdot}}}'])),
    ('tilde', (Op(1, r'\tilde{{{0}}}'), [r'\tilde{{{\cdot}}}'])),
    ('bar', (Op(1, r'\bar{{{0}}}'), [r'\bar{{{\cdot}}}'])),
    ('check', (Op(1, r'\check{{{0}}}'), [r'\check{{{\cdot}}}'])),
    ('dot', (Op(1, r'\dot{{{0}}}'), [r'\dot{{{\cdot}}}'])),
    ('hat', (Op(1, r'\hat{{{0}}}'), [r'\hat{{{\cdot}}}'])),
    ('vec', (Op(1, r'\vec{{{0}}}'), [r'\vec{{{\cdot}}}'])),
    ('imath', r'\imath '),
    ('jmath', r'\jmath '),
    ('ell', r'\ell '),
    ('hbar', r'\hbar '),
    ('eth', r'\eth '),
    ('wp', r'\wp '),
]

MENUITEM_ACCENTS = Ops(
github daniel-molina / visualequation / ops.py View on Github external
('ell', r'\ell '),
    ('hbar', r'\hbar '),
    ('eth', r'\eth '),
    ('wp', r'\wp '),
]

MENUITEM_ACCENTS = Ops(
    ops_l=ACCENTS,
    clickable_size=(50, 50), dpi=300,
    menuitem=[r'\acute{{a}}\;\tilde{{B}}'])

INDICES = [
    ('super', (Op(2, r'{0}^{{{1}}}'), [r'\cdot^{{\square}}'])),
    ('sub', (Op(2, r'{0}_{{{1}}}'), [r'\cdot_{{\square}}'])),
    ('lsuper', (Op(2, r'{{}}^{{{1}}}{0}'), [r'{{}}^{{\square}}\cdot'])),
    ('lsub', (Op(2, r'{{}}_{{{1}}}{0}'), [r'{{}}_{{\square}}\cdot'])),
    ('supersub', (Op(3, r'{0}^{{{1}}}_{{{2}}}'),
                  [r'\cdot^{{\square}}_{{\square}}'])),
    ('lsuperlsub', (Op(3, r'{{}}^{{{2}}}_{{{1}}}{0}'),
                    [r'{{}}^{{\square}}_{{\square}}\cdot'])),
    ('superlsuper', (Op(3, r'{{}}^{{{1}}}{0}^{{{2}}}'),
                     [r'{{}}^{{\square}}\cdot^{{\square}}'])),
    ('sublsub', (Op(3, r'{{}}_{{{1}}}{0}_{{{2}}}'),
                     [r'{{}}_{{\square}}\cdot_{{\square}}'])),
    ('supersublsuper', (Op(4, r'{{}}^{{{1}}}{0}^{{{3}}}_{{{2}}}'),
                  [r'{{}}^{{\square}}\cdot^{{\square}}_{{\square}}'])),
    ('supersublsub', (Op(4, r'{{}}_{{{1}}}{0}^{{{3}}}_{{{2}}}'),
                  [r'{{}}_{{\square}}\cdot^{{\square}}_{{\square}}'])),
    ('sublsublsuper', (Op(4, r'{{}}_{{{1}}}^{{{2}}}{0}_{{{3}}}'),
                  [r'{{}}_{{\square}}^{{\square}}\cdot_{{\square}}'])),
    ('superlsuperlsub', (Op(4, r'{{}}^{{{1}}}_{{{2}}}{0}^{{{3}}}'),
                  [r'{{}}^{{\square}}_{{\square}}\cdot^{{\square}}'])),