On Sunday, 20 February 2022 at 21:12:09 UTC-8 hohoa...@gmail.com wrote:

>
> Please help me to understand the function of '%auto' (is there a reference 
> for sage 'magics' ?). Is '%auto' a line magic or cell magic or something 
> else?
>
> The very same documentation that contains the example you reference also 
has an explanation right below it:

"""
A very sharp-eyed reader will also have noticed that the previous cell had 
%auto at the very top, and that it was not necessary to evaluate the cell 
to use it.

   - 
   
   The command %auto allows us to have a cell, especially an interactive 
   one, all loaded up as soon as we start - particularly convenient for a 
   classroom situation.
   - 
   
   Such instructions are called *percent directives* . Most are documented 
   in the notebook help one can access at the top of any worksheet
   
"""
Unfortunately, as you can see from the `lsmagics`, this "percent directive" 
does not exist any more. I suspect it was part of the *old* sage notebook 
and was not ported to the new jupyter notebooks that sagemath uses now. The 
fact that it's referred to as a "percent directive" instead of a cell magic 
(as you can see from the description, it should be a cell magic and hence 
be spelled with "%%" if it were something for a jupyter notebook) is also 
an indication. It should probably be removed from the documentation

As to why it wasn't ported: it may not fit easily in the architecture of 
jupyter notebooks and/or there may be notebook extensions that can already 
do this through some other mechanism. If it were provided, it should be 
done on the level of the python3 Ipython kernel, of which the sagemath 
kernel is a derivative.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/06751199-e292-4fc5-93f5-1f6566e8926dn%40googlegroups.com.

Reply via email to