Skip to content

Conversation

@mmatera
Copy link
Contributor

@mmatera mmatera commented Feb 21, 2021

This PR adds pymathics.asy module as a dependency and loads it when mathicserver is started. This solves the issue with labels and text inside graphics.

@mmatera mmatera changed the title setting using asymptote for graphics by defailt setting using asymptote for graphics by default Feb 21, 2021

INSTALL_REQUIRES = []
DEPENDENCY_LINKS = []
DEPENDENCY_LINKS = ["http://github.com/Mathics3/pymathics-asy#egg=pymathics-asy"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't do this. We want to reduce complexity and the number of dependencies and this just adds this back in.

The front ends should allow for reading profiles and customization.

And the mathics-ominbus project was created to pull in all of the different pieces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, then I would discard this PR. However, I think this would be a suitable (temporary) patch to fix the issue with graphics, this is why I put it here.
The other way to solve the graphics issue would be to update and debug all the javascript machinery.

Copy link
Member

@rocky rocky Mar 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably think about and discuss a strategy, short-term and long term.

I confess that in a way I did I think the same kind of thing with pymathics-graphics that you are doing here. So I understand and am sympathetic to short-term workarounds.

Personally, I am happier with short-term workarounds only after we have a clear idea of what the longer-term strategy is.

A long while ago, it was my impression that we were going to eventually ditch Django and go with some sort of Jupyter-based solution. At least in my mind, that hasn't been feasible yet because the foundations of the Mathics core and how it interacts with "front-ends" just doesn't feel fully worked out, although we are in my opinion making good progresss toward that end,.

Copy link
Contributor Author

@mmatera mmatera Mar 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I agree with that, and I thought that the strategy was more or less this one:

  • Fix graphics in Django with a plugin (pymathics-matplotlib or this one) that works in a very short term, in order to have a functional candidate for release soon. I would also prefer to use Matplotlib instead Asymptote for rendering graphics, but it happens that the development of the asy interface is much more advanced than the mpl one. This is why I have used it in this PR.

  • Use this to improve the way in which graphics packages are loaded and works. Regarding this, working on pymathics-asy I think I have discovered the root of the problem with graphics: it is rooted in the javascript/MathJax postprocessing. To really fix it we should look at the javascript routines that perform the XHTML replaces (mathics.js). We will need to do that if we want to have svg graphics. By now, I solve this by sending png graphics.

  • In the long term, to use what we learned working on that plugin to improve the jupyter's interface, which in the long term replace Django frontend as the main frontend of the project. Yesterday I have been doing some progress in that direction. I am updating this binder: https://mybinder.org/v2/gh/mmatera/nbcoursebase/master with the improvements to make online checks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Thanks for the information and plan!

Let me think about abount this, look at the code, try things, and try to understand the what's been done and the existing code.

@mmatera
Copy link
Contributor Author

mmatera commented Mar 6, 2021

@rocky , If you can, I would appreciate some help in setting the dependency for the module in setup.py

@rocky
Copy link
Member

rocky commented Mar 6, 2021

@rocky , If you can, I would appreciate some help in setting the dependency for the module in setup.py

Ok I will look at over the weekend.

@rocky rocky force-pushed the master branch 5 times, most recently from f5e0f88 to 96572aa Compare June 26, 2021 19:52
@rocky rocky force-pushed the master branch 4 times, most recently from 0963d16 to 400465e Compare August 1, 2021 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants