Cadabra
Computer algebra system for field theory problems
|
Classes | |
class | PackageCompiler |
class | Server |
Object to handle advanced display in a UI-independent way. More... | |
class | Console |
Functions | |
def | save_history (history_path) |
def | display (obj, cell_id=0, delay_send=False) |
Generic display function which handles local as well as remote clients. More... | |
def | _displayhook (arg) |
def | post_process (__cdbkernel__, ex) |
Variables | |
__cdbkernel__ = cadabra2.__cdbkernel__ | |
completer | |
int | PY3 = 3 |
unicode = str | |
string | discr = "\\discretionary{}{}{} " |
string | mopen = "\\begin{dmath*}{}"; |
string | mclose = "\\end{dmath*}"; |
server | |
bool | have_matplotlib = True |
bool | have_plotly = True |
console = Console() | |
callback | |
remember_display_hook = sys.displayhook | |
displayhook | |
|
private |
def cadabra2_defaults.display | ( | obj, | |
cell_id = 0 , |
|||
delay_send = False |
|||
) |
Generic display function which handles local as well as remote clients.
The 'display' function is a replacement for 'str', in the sense that it will generate human-readable output. However, in contrast to 'str', it knows about what the front-end ('server') can display, and will adapt the output to that. For instance, if server.handles('latex_view') is true, it will generate LaTeX output, while it will generate just plain text otherwise.
Once it has figured out which display is accepted by 'server', it will call server.send() with data depending on the object type it is being fed. Data types the server object can support are:
Generalised 'print' function which knows how to display objects in the best possible way on the used interface, be it a console or graphical notebook. In particular, it knows how to display Cadabra expressions in typeset form whenever LaTeX functionality is available. Can also be used to display matplotlib plots. When using a Cadabra front-end (command line or notebook), an expression with a trailing semi-colon ';' will automatically be wrapped in a 'display' function call so that the expression is displayed immediately.
def cadabra2_defaults.post_process | ( | __cdbkernel__, | |
ex | |||
) |
def cadabra2_defaults.save_history | ( | history_path | ) |
|
private |
cadabra2_defaults.callback |
cadabra2_defaults.completer |
cadabra2_defaults.console = Console() |
string cadabra2_defaults.discr = "\\discretionary{}{}{} " |
cadabra2_defaults.displayhook |
bool cadabra2_defaults.have_matplotlib = True |
bool cadabra2_defaults.have_plotly = True |
string cadabra2_defaults.mclose = "\\end{dmath*}"; |
string cadabra2_defaults.mopen = "\\begin{dmath*}{}"; |
int cadabra2_defaults.PY3 = 3 |
cadabra2_defaults.remember_display_hook = sys.displayhook |
cadabra2_defaults.server |
cadabra2_defaults.unicode = str |