You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The script [executeQueryFunctions.sh](./scripts/executeQueryFunctions.sh) contains functions to simplify the
206
207
call of [executeQuery.sh](./scripts/executeQuery.sh) for different purposes. For example, `execute_cypher_summarized`
@@ -221,7 +222,35 @@ Use [stopNeo4j.sh](./scripts/stopNeo4j.sh) to stop the locally running Neo4j Gra
221
222
222
223
## Jupyter Notebook
223
224
224
-
### Commands
225
+
### Create a report simplified with [executeJupyterNotebookReport.sh](./scripts/executeJupyterNotebookReport.sh)
226
+
227
+
[executeJupyterNotebookReport.sh](./scripts/executeJupyterNotebookReport.sh) includes everything from creating a directory within the "reports" directory to data availability validation and executing and converting the given Notebook. This is the all in one script that is also used inside the pipeline. Under the hood it uses [executeJupyterNotebook.sh](#execute-a-notebook-simplified-with-executejupyternotebooksh) to execute the Notebook and [executeQueryFunctions.sh](#executequeryfunctionssh) to query the Database for data availability validation.
228
+
229
+
Here is an example on how to use [executeJupyterNotebookReport.sh](./scripts/executeJupyterNotebookReport.sh) to for example run the report [Wordcloud.ipynb](./jupyter/Wordcloud.ipynb):
Jupyter notebooks can have additional custom tags within their "metadata" section. Opening these files with a text editor unveils that typically at the end of the file. Some editors also support editing them directly. Here, the optional metadata property `code_graph_analysis_pipeline_data_validation` is used to specify which data validation query in the [cypher/Validation](./cypher/Validation/) directory should be used. Without this property, the data validation step is skipped. If a validation is specified, it will be executed before the Jupyter Notebook is executed. If the query has at least one result, the validation is seen as successful. Otherwise, the Jupyter Notebook will not be executed.
238
+
239
+
This is helpful for Juypter Notebook reports that are specific to a programming language or other specific data prerequisites. The Notebook will be skipped if there is no data available which would otherwise lead to confusing and distracting reports with empty tables and figures.
240
+
241
+
### Execute a Notebook simplified with [executeJupyterNotebook.sh](./scripts/executeJupyterNotebook.sh)
242
+
243
+
[executeJupyterNotebook.sh](./scripts/executeJupyterNotebook.sh) contains everything that is needed to execute a Jupyter Notebook in the command line and convert it to different formats like Markdown and PDF (optionally). It takes care of [setting up the environment](#manually-setup-the-environment-using-conda) and [uses nbconvert](#executing-jupyter-notebooks-with-nbconvert) to execute the notebook and convert it to other file formats under the hood.
244
+
245
+
Here is an example on how to use [executeJupyterNotebook.sh](./scripts/executeJupyterNotebook.sh) to for example run [Wordcloud.ipynb](./jupyter/Wordcloud.ipynb):
### Manually setup the environment using [Conda](https://conda.io)
252
+
253
+
[Conda](https://conda.io) provides package, dependency, and environment management for any language. Here, it is used to setup the environment for Juypter Notebooks.
225
254
226
255
- Setup environment
227
256
@@ -249,6 +278,10 @@ Use [stopNeo4j.sh](./scripts/stopNeo4j.sh) to stop the locally running Neo4j Gra
### Executing Jupyter Notebooks with [nbconvert](https://nbconvert.readthedocs.io)
282
+
283
+
[nbconvert](https://nbconvert.readthedocs.io) converts Jupyter Notebooks to other static formats including HTML, LaTeX, PDF, Markdown, reStructuredText, and more.
284
+
252
285
- Install pandoc used by nbconvert for LaTeX support (Mac)
253
286
254
287
```shell
@@ -273,14 +306,6 @@ Use [stopNeo4j.sh](./scripts/stopNeo4j.sh) to stop the locally running Neo4j Gra
273
306
jupyter nbconvert --to pdf ./jupyter/first-neo4j-tryout.nbconvert.ipynb
274
307
```
275
308
276
-
- Shell script to execute and convert a Jupyter notebook file
277
-
278
-
Use [executeJupyterNotebook.sh](./scripts/executeJupyterNotebook.sh) like this:
0 commit comments