-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ipython notebook page #32
base: master
Are you sure you want to change the base?
Ipython notebook page #32
Conversation
@@ -1 +1 @@ | |||
Subproject commit 565f71fefe9b29523f11699d6f73119c6b7a8eb8 | |||
Subproject commit 2c7dfd0f734435c057e4216dc910031bf79bdeab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? Accidental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When i updated my submodules after cloning the repo, docutils also got updated and it showed untracked contents. so i had to commit those changes into docutils and after that commit the modified docutils into my repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the untracked contents are due to .pyc files? In any case, it shows for me too but I don't think we need to commit these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I see that all the time. We should use some fork that has a .gitignore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, Docutils dont have .gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, just revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have rebased that commit.
Overall, this is a good start. The notebook JSON is being generated correctly (I think), but there are little issues preventing it from working. I've put up a demo but it raises an exception. |
Thank you David for pointing out these issues to me. I will be commiting these changes along with the ability to create a gist and create a complete JSON. |
Let's definitely not store things in the database. The database size is limited, and I really don't want to have to wipe everyone's notebooks when it fills up. |
ok! we will not use databases.. thats why we are trying to export them to GIST. |
Have not added the codes on which i am working ( exporting notebook to GIST and plotting)but have cleaned up the code a bit. |
@lidavidm Can we merge this now?...or if we want to test it first..can you please restart its build? |
@lidavidm Can we merge it? |
if card_cell_input != '\n' and card_cell_input != '</div>' and card_cell_input != '\\': | ||
|
||
card_json_output = card_json_output[0].split(card_cell_input) | ||
try: #removing <ul>'s, <li>'s and <div>'s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be better of with a regex or with an actual HTML parser. If the output ever changes, this would break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am already using an htmlparser (see top) and i think "replace" should do the trick, also I dont want to increase the complexity of the code. I know its silly to discuss these little points, but am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I'm trying to determine the intent of this section of code. It is trying to extract the input and output sections from a multiple-result card, correct? I think there are better ways to handle this. See https://gist.github.com/lidavidm/37a0a27582805872334d - it just uses the HTML parser and extracts both the input expression and output LaTeX.
@lidavidm @asmeurer @sahilshekhawat So, I was looking into this, trying to take this further, and add many more features to this. But, what I feel that, the Parser that has been used in But the thing is that, the card data, i.e, the output doesn't load instantaneously as soon as SymPy Gamma loads. If you notice, in the bottom of your browser you can notice that, additional requests (as well as LaTeX needs to format the output as well, which is also done after SymPy Gamma loads) are sent after SymPy Gamma loads, to display the output. Only the input, and headings of all the cards load instantaneously as SymPy Gamma loads. Now, the thing that is happening is, since only the input and headings of the cards load as, SymPy Gamma loads, then the Now, if we change this line - Line No 96 in
These lines show that, So, how do I tansform the Another thing, that I am currently running SymPy Gamma locally on my @lidavidm @asmeurer @sahilshekhawat @certik Could you help me out on this? |
Or how about this, We can scrape the contents of the This will also help us, since we won't be recomputing the output, so it'll efficient as well. And additionally, as @lidavidm suggested above, it won't break, even if the output changes a bit, since only the HTML Tag needs to change. So, how about if we do this? @lidavidm @certik @asmeurer @sahilshekhawat Your opinions on this one? Please help me out with this, as I'm not see the outputs of the cards in the iPython Notebook. 😄 |
I would not scrape the |
@lidavidm Yes, I agree with you. I tried scraping the files, and it was a lot cumbersome. But, as I told, if I edit, the |
I'm not sure I understand the issue here. Why must we use |
That is the problem happening. If we keep Yes, we can use HTML in an iPython Notebook - https://stackoverflow.com/questions/25698448/how-to-embed-html-into-ipython-output . Also, how would you format the code into LaTeX? Could you suggest any detailing on that? @lidavidm |
Is there a demo of this you can show me? It's been long enough that I don't recall how it works anymore. Also, if you're talking about MathJax rendering the equations - that is unavoidable. |
@lidavidm Actually, I am trying to deploy it on the appspot. I was using the instructions mentioned here - https://github.com/sympy/sympy_gamma . But then, how do I come to know about my App Engine Application version, listed about in the first step in the link above? If you can help me with deploying on the appspot, then I'll post the link with the live demo. |
You can use whatever version number you want, it's not important for a test. After you deploy go into the App Engine settings panel and set the default version number to the one you deployed. You don't need to tag. |
@lidavidm Ohh okay. Where is the App Engine Settings panel? Also, where is |
Those instructions are for the official application. They should probably be updated to be clearer. You need to change the application name to your own, since you don't have permissions to deploy on the official application. The dashboard is https://appengine.google.com/, that's the App Engine panel I'm talking about. Create a project there, and use that name in your own app.yaml. |
How do I handle this error? @lidavidm -:
|
Follow the instructions. Use |
I tried that earlier. That also gave this error-:
|
Again...follow the instructions. It's asking for the application version number, which you can fill in as you please, because it's just a test version. |
We should probably revisit the documentation, though. Glancing through App Engine they've changed things, and we should document how to set up your own test instance. |
Ohh yes, I'll issue a PR later for the same. Meanwhile, I uploaded my SymPy Gamma to the Appspot, but no results seem to get displayed. For instance here - https://sympy-gamma-testing.appspot.com/input/?i=tan%281%20%2B%20x%29 . Why is that so? |
You enabled HTTPS but the assets are loaded over HTTP, so most browsers will block them, and so the rest of the page won't run. |
Ohh now the iPython notebook seems to work fine. But, if you go here - http://sympy-gamma-testing.appspot.com/input/?i=integral%28x**2%29 , and then if you view the iPython notebook online, then it seems to appear fine. But if you download the file, and then try to view it locally on your system by That's the thing that was happening to me. Since I was on localhost, hence I couldn't view it online definitely. So, I was viewing the results by downloading the files, and every time I couldn't view the results. Hence I was in trouble starting to find ways to fix this. So, this is an issue in this right? |
@lidavidm But interestingly even if you download the iPython notebook file from here- http://nbviewer.jupyter.org/url/sympy-gamma-testing.appspot.com/export_notebook//%3Fi%3Dintegral%2528x%252A%252A2%2529 , then also the output won't be visible if you try to open on your local system. So, seems to be some problem with jupyter-notebook only, and not an issue in this right? @lidavidm |
@ashutoshsaboo All your demos are not working, what's the status of this? Specifically - the assets are still served via HTTP, so the site is broken when visiting with HTTPS, and Gamma seems to have an internal error when making the IPython Notebook. |
@lidavidm Ohh yes I see. But what's the problem happening? Should I re-push my SymPy Gamma directory to google app engine and try again? Or what should I do? But if you check this link without HTTPS - http://sympy-gamma-testing.appspot.com/input/?i=integral%28x**2%29 . Then it seems to work fine. Hence, definitely there's no issue with my SymPy Gamma. So what's the issue specifically? Is this some issue with the Google App Engine itself? Or what? Additionally, the iPython notebook feature (with links at the bottom of the page - url mentioned above) - doesn't seem to work now? Why is that happening suddenly when it was all fine some time ago, and also that I haven't pushed any new change to GAE since then? |
For testing, I think we should enable debug mode, so we can see what the exception is. I've explained the issue with HTTPS - the dependencies are not loaded with HTTPS, but the main page is, so your browser refuses to load the dependencies. We should just load all assets with HTTPS if we can, else we should use protocol-relative URLs. |
Firstly, this in no way is completed.This is just the basic structure on which we can inplement ipython notebook.I have actually the main thing to write. I have done several things because i felt them to be good so please help me out where you feel that something needs to be changed. Following are the points which i have applied or thought:
1)I have used 'r' variable from views.input and parsed it with notebook.py file which have all the formats predefined and i just childishly changed their values and appended.
2)That result variable is passed in the url. i know that there is a maximum length of url but i thought it will large enough to not exceed.
3)I didn't stored the result into the databases because it is not free and if i can use something else why should i use them.
4)Plotting and cards are to be implemented and after that this will be very cool because the possibilities are just endless
5)i have a view which renders the json and i have given the link to the nbviewer which renders out json.
Demo: http://sympygamma-pr-32.appspot.com