Skip to content

Fix iPython magic#82

Merged
astralcai merged 4 commits intomasterfrom
ipython
Oct 3, 2025
Merged

Fix iPython magic#82
astralcai merged 4 commits intomasterfrom
ipython

Conversation

@astralcai
Copy link
Copy Markdown
Contributor

Fixes #81

Copy link
Copy Markdown
Collaborator

@ryanmartinneutrino ryanmartinneutrino left a comment

Choose a reason for hiding this comment

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

See error pointed out in comment and corresponding fix.


if "ipykernel" in sys.modules: # pragma: no cover
IPython.get_ipython().magic("matplotlib inline")
IPython.get_ipython().run_line_magic("matplotlib", "inline")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
IPython.get_ipython().run_line_magic("matplotlib", "inline")
get_ipython().run_line_magic("matplotlib", "inline")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yup, I had tried that as a fix and it worked.

Should we then require a minimum version of IPython during the pip install process, to make sure that run_line_magic() is defined?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably not necessary, according to this https://stackoverflow.com/questions/32681203/ipython-set-up-magic-commands-in-configuration-file?utm_source=chatgpt.com, the run_line_magic has been the standard since 10 years ago.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also I don't think ipython should be a dependency of qexpy, since none of the qexpy features actually requires ipython to run.

Copy link
Copy Markdown
Collaborator

@ryanmartinneutrino ryanmartinneutrino left a comment

Choose a reason for hiding this comment

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

All good!

@astralcai astralcai merged commit b78a321 into master Oct 3, 2025
12 checks passed
@astralcai astralcai deleted the ipython branch October 3, 2025 22:45
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.

Issues with jupyter notebooks

2 participants