From 4c3288c6614d2f45c8077ca918f5da2cadb9b1a1 Mon Sep 17 00:00:00 2001 From: mmatera Date: Sun, 21 Feb 2021 20:32:47 -0300 Subject: [PATCH 1/2] setting using asymptote for graphics by defailt --- mathics_django/web/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mathics_django/web/models.py b/mathics_django/web/models.py index d169b0d83..d26413c43 100644 --- a/mathics_django/web/models.py +++ b/mathics_django/web/models.py @@ -9,6 +9,7 @@ from mathics.core.definitions import Definitions from mathics.core.evaluation import Evaluation, Output +from mathics.core.expression import(Expression, Symbol, SymbolTrue) from mathics_django.web.format import format_output @@ -28,6 +29,8 @@ def get_session_evaluation(session): # Previously, one specific format, like "xml" had to fit all. evaluation = Evaluation( definitions, format='unformatted', output=WebOutput()) + Expression("Set", Symbol("Settings`UseAsyForGraphics2D"), + SymbolTrue).evaluate(evaluation) _evaluations[session.session_key] = evaluation evaluation.format_output = lambda expr, format: format_output(evaluation, expr, format) return evaluation From 9751d3081155a4b578ec928a67d6dac8faa2bbc9 Mon Sep 17 00:00:00 2001 From: mmatera Date: Sat, 6 Mar 2021 00:06:39 -0300 Subject: [PATCH 2/2] adding dependency to pymathics.asy --- mathics_django/web/models.py | 5 ++--- setup.py | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mathics_django/web/models.py b/mathics_django/web/models.py index d26413c43..c9f81cb55 100644 --- a/mathics_django/web/models.py +++ b/mathics_django/web/models.py @@ -9,7 +9,7 @@ from mathics.core.definitions import Definitions from mathics.core.evaluation import Evaluation, Output -from mathics.core.expression import(Expression, Symbol, SymbolTrue) +from mathics.core.expression import(Expression, Symbol, SymbolTrue, String) from mathics_django.web.format import format_output @@ -29,10 +29,9 @@ def get_session_evaluation(session): # Previously, one specific format, like "xml" had to fit all. evaluation = Evaluation( definitions, format='unformatted', output=WebOutput()) - Expression("Set", Symbol("Settings`UseAsyForGraphics2D"), - SymbolTrue).evaluate(evaluation) _evaluations[session.session_key] = evaluation evaluation.format_output = lambda expr, format: format_output(evaluation, expr, format) + Expression('LoadModule', String("pymathics.asy")).evaluate(evaluation) return evaluation diff --git a/setup.py b/setup.py index 96eecf1f2..db3f3da4b 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ def read(*rnames): is_PyPy = platform.python_implementation() == "PyPy" INSTALL_REQUIRES = [] -DEPENDENCY_LINKS = [] +DEPENDENCY_LINKS = ["http://github.com/Mathics3/pymathics-asy#egg=pymathics-asy"] if sys.platform == "darwin": INSTALL_REQUIRES += ["scikit-image"] @@ -61,6 +61,7 @@ def read(*rnames): "django >= 3.0, < 3.2", "networkx", "requests", + "pymathics-asy", ]