Thanks, Andrey, that works also in my linked cells. When I use load() instead of urllib it works also in a single cell and I can use Q(x,u) from physics.py in that cell and in linked cells, e.g. x=Q(1,'m') x^2r but x= 1 m gives a syntax error (also in linked cells). Now I have made up a unit transformer <https://dahn-research.eu/MathTrek/Release/Units.html>, which satisfies my current needs. I'll be back should I run into troubles which I cannot circumvent. I'd prefer to stay with a SageMath kernel since I appreciate the SageMath features. Thanks again Ingo
Am So., 20. Dez. 2020 um 18:49 Uhr schrieb Andrey Novoseltsev < [email protected]>: > Hi Ingo, > > Here is what works for me: > 1) go to https://sagecell.sagemath.org/static/test/linked.html > > 2) put into the first cell > import urllib.request > urllib.request.urlretrieve(' > https://raw.githubusercontent.com/birkenfeld/ipython-physics/master/physics.py', > 'physics.py') > %load_ext physics > > 3) execute and put into the second cell > x = 1 m > x > > 4) execute and get "1 m" as output, so it seems to work. > > Regarding preparser issues - your life may be easier if you use "Python" > as the mode for cells instead of the default "Sage". > > Best, > Andrey > > On Wednesday, 16 December 2020 at 06:24:38 UTC-7 [email protected] wrote: > >> Hi, Andrej, >> With your example I get the same error in another cell and when I do >> load(../physics.py) and in another linked cell import physics I get the old >> physics not found error. >> Can you point me to a page with linked cells where it works? >> [email protected] schrieb am Sonntag, 13. Dezember 2020 um 19:20:49 >> UTC+1: >> >>> IPython extension are supposed to be pip-installable, which physics >>> module is not and I would prefer not to custom patch into some place. >>> >>> Getting it just for a single cell and loading works: >>> https://sagecell.sagemath.org/?q=iuhqxt >>> >>> but I am unable to use it afterwards. What does work, however, is >>> downloading and loading this module in one cell, then using in another >>> linked cell. If this is a suitable option for you - great! If not - I can't >>> say that I am excited about digging deeper into why it does not work ;-) >>> >> -- > You received this message because you are subscribed to a topic in the > Google Groups "sage-cell" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sage-cell/yCbU9fnkLM8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-cell/5e1b2716-2759-4bd7-b03f-c518d1eedd47n%40googlegroups.com > <https://groups.google.com/d/msgid/sage-cell/5e1b2716-2759-4bd7-b03f-c518d1eedd47n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "sage-cell" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/CAK-88tDMLXL2iWmz_P_6iKUiQHHyFM%2BJ91KqeCY_M8GNYZ59-w%40mail.gmail.com.
