Comments (14)
By the way, I'd appreciate it if the current sending of the output of the execution to the terminal could be made optional. This is currently this line: https://github.com/CINPLA/doconce/blob/cse/lib/doconce/execution.py#L78
from doconce.
See also https://github.com/CINPLA/doconce/blob/cse/test/execute.do.txt
EDIT: the correct command to convert that doconce file is
doconce format ipynb execute.do.txt --execute
from doconce.
A demo can be found by installing doconce as per https://github.com/CINPLA/cse_book#readme
The link is broken, could you fix it?
I am asking because I am not able to compile execute.do.txt
from CINPLA/doconce - cse branch or text1.do.txt
from doconce_demo. Having the in installation instructions would help me troubleshooting. The installation for doconce on CINPLA seems old and fails.
The error I get is the following:
doconce format ipynb text1.do.txt
File "/home/amarin/doconce/lib/doconce/ipynb.py", line 615, in ipynb_code
cells.append(new_markdown_cell(source=block))
File "/home/amarin/doconce/venv/lib/python3.6/site-packages/nbformat/v4/nbbase.py", line 132, in new_markdown_cell
id=random_cell_id(),
File "/home/amarin/doconce/venv/lib/python3.6/site-packages/nbformat/corpus/words.py", line 20, in generate_corpus_id
return '-'.join((random.sample(acceptable_adjectives(), 1)[0], random.sample(acceptable_nouns(), 1)[0]))
File "/home/amarin/doconce/venv/lib/python3.6/site-packages/nbformat/corpus/words.py", line 15, in acceptable_adjectives
with open(os.path.join(os.path.dirname(__file__), 'adjectives.txt'), 'r') as adjectives_file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/amarin/doconce/venv/lib/python3.6/site-packages/nbformat/corpus/adjectives.txt'
Possibly related to this error, is this comment that was present in the installation instructions for DocOnce:
# If problems with IPython.nbformat.v4: clone ipython and run setup.py
# to get the latest version
from doconce.
Sorry, I forgot that the repo is private, and I do not have enough permission to add you. Here is the relevant section:
Installation:
Install Anaconda.
Run the following commands in a terminal:
conda create --name doconce python=3
source activate doconce
conda install future notebook preprocess publish scipy ffmpeg -c defaults -c conda-forge
pip install mako pygments
git clone [email protected]:CINPLA/doconce # or git clone https://github.com/CINPLA/doconce
cd doconce
git checkout cse
python setup.py develop
from doconce.
You'll may not be able to clone https://github.com/CINPLA/doconce. Let me know, and I'll ask for you to be added to that organisation and repo.
from doconce.
Hello @lexnederbragt , could you do some tests on this commit?
from doconce.
Sure. I did a fresh install like this:
git clone https://github.com/doconce/doconce.git doconce_doconce
conda create -n doconce_doconce_54ef5e4 doconce notebook matplotlib pandas
conda activate doconce_doconce_54ef5e4
cd /Users/alexajo/github/doconce_doconce/
python setup.py install
Then, doconce --version
gave:
DocOnce version 1.5.3 (from /anaconda3/envs/doconce_doconce_54ef5e4/lib/python3.9/site-packages/DocOnce-1.5.3-py3.9.egg/doconce)
Then
cd /path/to/doconce_demo/text1
doconce format ipynb text1.do.txt --execute
This gave
<snip...>
File "/anaconda3/envs/doconce_doconce_54ef5e4/lib/python3.9/site-packages/DocOnce-1.5.3-py3.9.egg/doconce/ipynb.py", line 254, in ipynb_code
from . import jupyter_execution
ImportError: cannot import name 'jupyter_execution' from 'doconce' (/anaconda3/envs/doconce_doconce_54ef5e4/lib/python3.9/site-packages/DocOnce-1.5.3-py3.9.egg/doconce/__init__.py)
from doconce.
Sorry, I accidentally omitted that file because I usually do a git clean -fd
after running the tests
from doconce.
That problem is now gone. I can start testing now, thanks!
from doconce.
It seems to be working for notebooks, and not break other things.
Looks like I now can compile all my course documents
using this version of doconce. Exciting! Thanks!
A few things, though:
--execute
withdoconce format pdflatex
for me fails on
latex.py
.
Example: in doconce_demo repo, exercises.pdf
and others,
(please do a new git pull
if you want to use this repo)
doconce format pdflatex exercise1.do.txt --latex_code_style=vrb --execute
fails ends with:
File "/path/to/doconce/latex.py", line 1177, in latex_code
filename_stem = "{}/{}".format(cache_folder, str(uuid.uuid4()))
NameError: name 'uuid' is not defined
(no error without --execute
)
-
I get a bunch of
Not our reply
,Wrong message id
andNot output from our execution
.
But I don't know whether that is a problem... -
One small difference I saw was this:
(in doconce_demo, e.g.exercises.ipynb
and others)
when the DocOnce file had:
See figure ref{PythonDict} for an illustration that explains the python dictionary concept.
FIGURE: [../img/PythonDict, width=400 frac=0.8] Data structure concept of a dictionary in python. label{PythonDict}
With the CINPLA doconce version, in ipynb output, this becomes:
"See [figure 1](#PythonDict) for an illustration that explains the python dictionary concept.\n",
With doconce/doconce it becomes
"See [figure](#PythonDict) for an illustration that explains the python dictionary concept.\n",
Finally, please note, when you update the documentation,
that the PR also introduces two other new options,
--ipynb_non_editable_text
and --ipynb_non_editable_code
from doconce.
- Fixed
- I am not sure about these messages. I do not see them when I execute doconce.
Not our reply
andWrong message id
are from CINPLA's code injupyter_executiion.py
, which they mark asAdapted from nbconvert.ExecutePreprocessor
by IPython.Not output from our execution
should only happens when using--verbose-execute
and it looks like a warning. - That happens when formatting to ipynb, right? If so it should be ok now.
- If you are referring to the manual, a new compilation of that should fix it. I tried to do it and got some latex issues, which I should look into
from doconce.
Thanks! My problem was also caused by using Python 3.7. Doing a fresh install (conda) with Python 3.6 and the latest doconce gives no problems on the doconce_demo repo that I can find. I'll look into 2) a bit more later.
from doconce.
By the way, could you add https://github.com/CINPLA/doconce/blob/dev/test/execute.do.txt to the test folder and test it? It works for me, but it may be good to have it in the test suite?
from doconce.
I'm OK with closing this issue. If any further problems show up, I'll submit new issues for them. Thanks, Alessandro!
from doconce.
Related Issues (20)
- Speaker notes in deck slides HOT 2
- TITLE/AUTHOR/DATE cause empty markdown cell at top of ipynb output HOT 1
- `print(type(x))` gives no output in html HOT 1
- New feature: abort on error with --execute HOT 7
- Create an answer book in ipynb HOT 5
- New feature: enable execution in a different folder HOT 7
- Figures with caption inside admonitions do not work HOT 1
- Empty markdown cells in ipynb
- Remove `Figure 1` label in html slides when no caption given HOT 4
- Github Actions on the doconce repo time out
- Create notebook cell id based on cell content
- Python 1 HOT 1
- TOC title in html and ipynb have different margins HOT 2
- Miras
- code execution for html should be skipped when py-out present
- Formatting of py-out block in html HOT 1
- Localization of doconce HOT 2
- DocOnce and Beamer document with animation HOT 1
- Compatiliblity with regex 2022.10.31 HOT 1
- Pointing to solutions for installation problems HOT 1
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 doconce.