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

Added regex to exclude magic commands from ipynbs #102

Closed
wants to merge 1 commit into from

Conversation

mdmmn378
Copy link
Contributor

@mdmmn378 mdmmn378 commented Dec 4, 2021

No description provided.

Signed-off-by: Mamun <mdmmn378@gmail.com>
Copy link
Owner

@damnever damnever left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Can you add a few test cases?

Filter out cells with magics and shell commands
e.g %matplotlib inline or !pip install pigar
"""
return re.sub(r"^((\s)*(!|%).*$)|(\n\s*%.*)", "", cell_lines)
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe we should handle var = !command as well.

@damnever
Copy link
Owner

damnever commented Nov 7, 2022

I have done some work based on this commit, thanks for your contribution!

#117

@damnever damnever closed this Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants