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
[Jupyter Notebooks](https://jupyter.org) can have additional custom tags within their [metadata section](https://ipython.readthedocs.io/en/3.x/notebook/nbformat.html#metadata). 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.
242
+
243
+
This is helpful for Jupyter 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.
244
+
245
+
You can search the messages `Validation succeeded` or `Validation failed` inside the log to get detailed information which Notebook had been skipped for which reason.
246
+
247
+
### Execute a Notebook simplified with [executeJupyterNotebook.sh](./scripts/executeJupyterNotebook.sh)
248
+
249
+
[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.
250
+
251
+
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)
258
+
259
+
[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
260
226
261
- Setup environment
227
262
@@ -249,6 +284,10 @@ Use [stopNeo4j.sh](./scripts/stopNeo4j.sh) to stop the locally running Neo4j Gra
### Executing Jupyter Notebooks with [nbconvert](https://nbconvert.readthedocs.io)
288
+
289
+
[nbconvert](https://nbconvert.readthedocs.io) converts Jupyter Notebooks to other static formats including HTML, LaTeX, PDF, Markdown, reStructuredText, and more.
290
+
252
291
- Install pandoc used by nbconvert for LaTeX support (Mac)
253
292
254
293
```shell
@@ -273,23 +312,21 @@ Use [stopNeo4j.sh](./scripts/stopNeo4j.sh) to stop the locally running Neo4j Gra
273
312
jupyter nbconvert --to pdf ./jupyter/first-neo4j-tryout.nbconvert.ipynb
274
313
```
275
314
276
-
- Shell script to execute and convert a Jupyter notebook file
277
-
278
-
Use [executeJupyterNotebook.sh](./scripts/executeJupyterNotebook.sh) like this:
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,10 +179,10 @@ The [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.ym
179
179
👉 Create a new artifacts download script in the [scripts/downloader](./scripts/downloader/) directory. Take for example [downloadAxonFramework.sh](./scripts/downloader/downloadAxonFramework.sh) as a reference.
180
180
👉 Run the script separately before executing [analyze.sh](./scripts/analysis/analyze.sh) also in the [pipeline](./.github/workflows/java-code-analysis.yml).
181
181
182
-
- How can i trigger a full rescan of all artifacts?
182
+
- How can i trigger a full re-scan of all artifacts?
183
183
👉 Delete the file `artifactsChangeDetectionHash.txt` in the `artifacts` directory.
184
184
185
-
- How can PDF generation for Jupyter Notebooks be enabled (depends on chromium, takes more time)?
185
+
- How can i enable PDF generation for Jupyter Notebooks (depends on chromium, takes more time)?
186
186
👉 Set environment variable `ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION` to anything except an empty string. Example:
187
187
188
188
```shell
@@ -195,6 +195,10 @@ The [Code Structure Analysis Pipeline](./.github/workflows/java-code-analysis.ym
👉 The custom Jupyter Notebook metadata property `code_graph_analysis_pipeline_data_validation` can be set to choose a query from [cypher/Validation](./cypher/Validation) that will be executed preliminary to the notebook. If the query leads to at least one result, the validation succeeds and the notebook will be run. If the query leads to no result, the notebook will be skipped.
200
+
For more details see [Data Availability Validation](./COMMANDS.md#data-availability-validation).
201
+
198
202
## 🕸 Web References
199
203
200
204
-[Graph Data Science 101: Understanding Graphs and Graph Data Science](https://techfirst.medium.com/graph-data-science-101-understanding-graphs-and-graph-data-science-c25055a9db01)
0 commit comments