Skip to content
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

Implement magic commands #63

Closed
martinRenou opened this issue Dec 19, 2018 · 19 comments · Fixed by #400
Closed

Implement magic commands #63

martinRenou opened this issue Dec 19, 2018 · 19 comments · Fixed by #400
Labels
Enhancement New feature or request Feature Request

Comments

@martinRenou
Copy link
Member

martinRenou commented Dec 19, 2018

Line magics:

  • %alias
  • %alias_magic
  • %autoawait
  • %autocall
  • %automagic
  • %autosave
  • %bookmark
  • %cat
  • %cd
  • %clear
  • %colors
  • %config
  • %connect_info
  • %cp
  • %debug
  • %dhist
  • %dirs
  • %doctest_mode
  • %ed
  • %edit
  • %env
  • %gui
  • %hist
  • %history
  • %killbgscripts
  • %ldir
  • %less
  • %lf
  • %lk
  • %ll
  • %load
  • %load_ext
  • %loadpy
  • %logoff
  • %logon
  • %logstart
  • %logstate
  • %logstop
  • %ls
  • %lsmagic
  • %lx
  • %macro
  • %magic
  • %man
  • %matplotlib
  • %mkdir
  • %more
  • %mv
  • %notebook
  • %page
  • %pastebin
  • %pdb
  • %pdef
  • %pdoc
  • %pfile
  • %pinfo
  • %pinfo2
  • %popd
  • %pprint
  • %precision
  • %prun
  • %psearch
  • %psource
  • %pushd
  • %pwd
  • %pycat
  • %pylab
  • %qtconsole
  • %quickref
  • %recall
  • %rehashx
  • %reload_ext
  • %rep
  • %rerun
  • %reset
  • %reset_selective
  • %rm
  • %rmdir
  • %run
  • %save
  • %sc
  • %set_env
  • %store
  • %sx
  • %system
  • %tb
  • %time
  • %timeit
  • %unalias
  • %unload_ext
  • %who
  • %who_ls
  • %whos
  • %xdel
  • %xmode

Cell magics:

  • %%!
  • %%HTML
  • %%SVG
  • %%bash
  • %%debug
  • %%file
  • %%html
  • %%javascript
  • %%js
  • %%latex
  • %%capture
  • %%markdown
  • %%perl
  • %%prun
  • %%pypy
  • %%python
  • %%python2
  • %%python3
  • %%ruby
  • %%script
  • %%sh
  • %%svg
  • %%sx
  • %%system
  • %%time
  • %%timeit
  • %%writefile
@martinRenou martinRenou added the Enhancement New feature or request label Dec 19, 2018
@SylvainCorlay
Copy link
Member

Note for reference:

  • We discussed actually reusing the magics from IPython with the %% prefix when IPython is installed.
  • We should enable non-language-specific magics in xeus, where the magics prefix would be setable for each language. For example, a timeit implementation can make sense for any kernel.

@afshin
Copy link
Member

afshin commented Nov 29, 2019

Would it be insane to make ipykernel a dependency of xeus-python to use its magic logic until it is implemented natively?

@martinRenou
Copy link
Member Author

Maybe not make it a dependency but use it if it's available?

@SylvainCorlay
Copy link
Member

Note: we would probably only need IPython and not ipykernel.

@afshin
Copy link
Member

afshin commented Nov 29, 2019

If it's just ipython, that makes it even more compelling to have it be a dependency, because it won't even appear as a kernel in users' notebook/lab clients. And since it's a pure python package, it seems fairly uncontroversial.

@dbalabka
Copy link

dbalabka commented Mar 26, 2020

@SylvainCorlay currently, all magic commands rise parsing error. It would be great to just ignore these commands during runtime for now, otherwise, it is blocking the developer to use this kernel for debugging purposes.

@SylvainCorlay
Copy link
Member

@SylvainCorlay currently, all magic commands rise parsing error. It would be great to just ignore these commands during runtime for now, otherwise, it is blocking the developer to use this kernel for debugging purposes.

That is an excellent suggestion! I think we will start with that.

@peterquirk
Copy link

Don't forget the ! magic.

@AntoineToussaint
Copy link

Not sure about other people, but for me:

%load_ext autoreload
%autoreload

is the big one. But maybe there is a better way to reload a function that has been modified?

@jhettler
Copy link

Please, don't forget to implement sql magics https://github.com/catherinedevlin/ipython-sql. Thanks!

@pratikchhapolika
Copy link

magic command still not working?

@jtpio
Copy link
Member

jtpio commented Jul 13, 2020

@pratikchhapolika some are now implemented and can be tested on Binder:

https://mybinder.org/v2/gh/jupyter-xeus/xeus-python/stable?filepath=notebooks/xeus-magics.ipynb

@pratikchhapolika
Copy link

Version=0.8.0 ?

@jtpio
Copy link
Member

jtpio commented Jul 14, 2020

@pratikchhapolika You can use 0.8.2 (the latest at the moment)

@william-davies
Copy link

william-davies commented Nov 6, 2020

Not sure about other people, but for me:

%load_ext autoreload
%autoreload

is the big one. But maybe there is a better way to reload a function that has been modified?

Just wanted to follow up on this. %load_ext autoreload still doesn't work for me. Am I doing something wrong or is it just not supported at the moment? If the latter is the case, what's the timeline for supporting it?

In the meantime, is there a workaround for reloading modules?

Thank you very much!
Screenshot 2020-11-06 at 07 58 32

@mherkazandjian
Copy link

may you also consider adding support for matlplotlib widgets, i.e not just matplotlib inline magic.

%matplotlib widget

@Hoeze
Copy link

Hoeze commented Jan 31, 2021

Hi, is there any ongoing work on magic commands in xeus-python?
I.e. what's the state of this? Can we expect them anytime soon to work?

I'd really like to try out the jupyterlab debugger, but I cannot when the magics don't work then...

@SylvainCorlay
Copy link
Member

The magics extension system has been ported to xeus-python, and most custom magics willl work out of the box.

However, the matplotlib magics and other core magics of IPython have not been integrated as they rely a lot of specific ipython internals. There is ongoing work for matplotlib specifically.

@Hoeze
Copy link

Hoeze commented Jan 31, 2021

Thanks for the update @SylvainCorlay!

@martinRenou martinRenou mentioned this issue Feb 4, 2021
DerThorsten pushed a commit to DerThorsten/xeus-python that referenced this issue Nov 7, 2023
…2149511edb02423b7e41b5c4c

Automated Changelog Entry for 0.5.3 on main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Feature Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.