Comments (13)
However you can just use
python nbstripout.py
... if you want to test the version from your Git checkout.
Right, but in this case the bug only affected the nbstripout
script.
Thanks for the fix, by the way. Pleasure working with you.
from nbstripout.
I can't reproduce this. Have tried with both my system Python 3 and Anaconda Python 3. Could it be an issue with your terminal? Which platform are you on and which terminal are you using?
from nbstripout.
Interesting. I'm using NixOS so that definitely can be a source of issues, though I don't know what it could be in this case. I'm using Bash on Konsole. I'd expect it is related to something that is done differently on Python 2 than on Python 3. Any ideas are welcome.
from nbstripout.
And even more weird, this works on Python 3:
cat test_metadata.ipynb | python -m nbstripout
So it's just when it's used as a standalone executable in Python 3 that it doesn't handle piping properly. This is probably related to how NixOS wraps executables.
from nbstripout.
OK, good to know. Report back if you find out anything more.
from nbstripout.
I can reproduce this on my Mac:
$ nbstripout < test_metadata.ipynb | wc
0 0 0
$ python -m nbstripout < test_metadata.ipynb | wc
88 167 1556
The problem appears to be buffering related. On one of my own notebooks, it appears that the output is empty unless it exceeds roughly 8192 bytes.
Adding output_stream.flush()
after line 279 fixes the problem for me.
Version 0.3.0. Installed using conda
.
from nbstripout.
@reidpr Thanks! I've pushed that fix. Can you try with master? I want to tag a new release.
from nbstripout.
Happy to. Can you give me a brief recipe to get the executable nbstripout
in a Git working directory? python setup.py build
doesn't seem to make it, and python setup.py test
complains pkg_resources.DistributionNotFound: The 'pytest' distribution was not found and is required by the application
.
from nbstripout.
The 2 simplest options are:
pip install git+https://github.com/kynan/nbstripout
from anywherepython setup.py develop
from a clone of this repo
from nbstripout.
@reidpr your fix will be released in 0.3.1
from nbstripout.
@jluttine @reidpr can you please test 0.3.1 and report if this is now fixed?
from nbstripout.
This seems to work in 0.3.1.
Sorry I didn't test it earlier. It seemed like the test instructions required installing the version under test, so I kept putting it off. It would be great if everything could be tested from a Git checkout, without installing it.
from nbstripout.
The nbstripout
script is just a setuptools entrypoint. To use that you do indeed need to install it. I recommend a python setup.py develop
/ pip install -e .
. I'll add that to the README.
However you can just use python nbstripout.py ...
if you want to test the version from your Git checkout.
from nbstripout.
Related Issues (20)
- Should be agnosting on trailing blank lines HOT 9
- [Feature Request] Process Folders (Batch / Bulk) HOT 1
- Doesn't strip out pycharm metadata HOT 9
- New release HOT 2
- Replace cram with prysk HOT 2
- Read config from `setup.cfg` HOT 1
- Option to error on cell outputs exceeding `--max-size` HOT 4
- It is recommended to remove pytest-runnner from setup_requires in setup.py HOT 4
- Strip output_type=stderr only, with keep_output? HOT 4
- Possible nbstripout-fast integration HOT 6
- Prevent committing notebooks with errors in cell outputs HOT 6
- Specifying Python executable path in `nbstripout --install`
- 'nbstripout' is not recognized as an internal or external command, operable program or batch file. HOT 2
- Not compatible with `pre-commit-hooks/pretty-format-json` hook HOT 4
- `git config filter.nbstripout.extrakeys ` support for `attachments`? HOT 4
- Support setting defaults for command line arguments via git config
- No valid notebook detected HOT 4
- required = true by default or make doc more explicit about it HOT 5
- Support git-filter-repo HOT 2
- Any examples for --keep-id option? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbstripout.