Skip to content

Add IPython completion hook in julia.magic - #193

Closed
tkf wants to merge 1 commit into
JuliaPy:masterfrom
tkf:ipy_completion
Closed

tkf wants to merge 1 commit into
JuliaPy:masterfrom
tkf:ipy_completion

Conversation

@tkf

@tkf tkf commented Aug 24, 2018

Copy link
Copy Markdown
Member

(To be rebased after #190)

image

@tkf tkf changed the title Add IPython completion hook in julia.magic WIP: Add IPython completion hook in julia.magic Aug 25, 2018
@tkf

tkf commented Aug 25, 2018

Copy link
Copy Markdown
Member Author

Adding completion to the cell magic would require ipython/ipython#10722

@tkf

tkf commented Aug 27, 2018

Copy link
Copy Markdown
Member Author

Comment thread julia/magic.py Outdated
"""Load the extension in IPython."""
ip.register_magics(JuliaMagics)
ip.set_hook("complete_command", julia_completer,
re_key="%?%julia")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As it does not work with cell magic, just use str_key="%julia".

Comment thread julia/magic.py Outdated
return String[]
end
end
""")(julia_code, julia_pos)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we eval this function once and cache it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes. I use cached_property in my ipyjulia_hacks. Something like this can be done here. https://github.com/tkf/ipyjulia_hacks/blob/679f6bbd3ed202cde6ec6ebb4b1b537566531cdf/src/ipyjulia_hacks/completers.py#L19

But could you review #190 first? I think that's more fundamental and important. But that PR, in turn, depends on #188.

@coveralls

coveralls commented Sep 5, 2018 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 476

  • 23 of 27 (85.19%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.7%) to 79.159%

Changes Missing Coverage Covered Lines Changed/Added Lines %
julia/magic.py 23 27 85.19%
Files with Coverage Reduction New Missed Lines %
julia/core.py 1 84.87%
julia/find_libpython.py 2 78.15%
Totals Coverage Status
Change from base Build 469: 0.7%
Covered Lines: 414
Relevant Lines: 523

💛 - Coveralls

@tkf tkf changed the title WIP: Add IPython completion hook in julia.magic Add IPython completion hook in julia.magic Sep 6, 2018
@tkf tkf mentioned this pull request Sep 6, 2018
@stevengj

Copy link
Copy Markdown
Member

@Carreau, do you have a sense of what the best approach here is for cell magic?

@Carreau

Carreau commented Sep 10, 2018

Copy link
Copy Markdown
Contributor

Well, tab completion and monkey patching seem like a good approach for now. refactoring, improving and getting for improving completion is in my goals.

I don't have anything short term solution though.

@tkf

tkf commented Sep 10, 2018 •

Copy link
Copy Markdown
Member Author

@tkf tkf closed this in #252 Mar 25, 2019
@tkf
tkf deleted the ipy_completion branch March 30, 2019 17:58
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.

4 participants