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
Copy file name to clipboardExpand all lines: docs/computations/julia.qmd
+142Lines changed: 142 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -318,6 +318,148 @@ The currently available options are:
318
318
- `exeflags`: An array of strings which are appended to the `julia` command that starts the worker process. For example, a notebook is run with `--project=@.` by default (the environment in the directory where the notebook is stored) but this could be overridden by setting `exeflags: ["--project=/some/directory/"]`.
319
319
- `env`: An array of strings where each string specifies one environment variable that is passed to the worker process. For example, `env: ["SOMEVAR=SOMEVALUE"]`.
320
320
321
+
### `juliaup` integration
322
+
323
+
[`juliaup`](https://github.com/JuliaLang/juliaup) is the recommended way to
324
+
install and manage Julia versions. The `julia` engine supports using
325
+
`juliaup`'s `+` channel specifier to select the Julia version that a notebook
326
+
uses. This allow users to run several notebooks concurrently with different
327
+
Julia versions on the same machine without the need for customizing their
328
+
`PATH` in any way.
329
+
330
+
To use this feature, ensure that you have used `juliaup` to install the channels
331
+
that you wish to use in your notebooks. Then add the channel specifier to the notebook
332
+
frontmatter in the `julia.exeflags` option:
333
+
334
+
````markdown
335
+
---
336
+
title: "A Julia 1.11 notebook"
337
+
engine: julia
338
+
julia:
339
+
exeflags: ["+1.11"]
340
+
---
341
+
342
+
```{{julia}}
343
+
VERSION
344
+
```
345
+
````
346
+
347
+
`QuartoNotebookRunner` currently supports running Julia versions from 1.6
348
+
onwards. Support for earlier versions is not planned.
349
+
350
+
### Revise.jl integration
351
+
352
+
[Revise](https://github.com/timholy/Revise.jl) allows for automatically
353
+
updating function definitions in Julia sessions. It is an essential tool in the
354
+
Julia ecosystem for any user that wishes to develop their own packages or large
355
+
projects. The `julia` engine supports using `Revise` within notebook processes
356
+
by simply importing the package into a cell at the start of a notebook. Once
357
+
imported `Revise` will automatically update functions imported from locally
358
+
developed packages in the same way as it behaves in a Julia REPL.
359
+
360
+
Ensure that `Revise` is installed in the project environment that the notebook
361
+
is using, since the global environment is not included in the load path
362
+
provided to Julia, unlike the behaviour of a Julia REPL session.
363
+
364
+
### Caching
365
+
366
+
The engine has built-in support for caching notebook results. This feature is disabled by
367
+
default but can be enabled by setting `execute.cache` option to `true` in a notebook's
368
+
frontmatter:
369
+
370
+
````markdown
371
+
---
372
+
title: "A caching example"
373
+
engine: julia
374
+
execute:
375
+
cache: true
376
+
---
377
+
378
+
```{{julia}}
379
+
rand()
380
+
```
381
+
````
382
+
383
+
Notebook caches are invalidated based on the following criteria:
384
+
385
+
- Using a different Julia version to run the notebook.
386
+
- The `Manifest.toml` of the environment the notebook is run in. Adding, removing, or changing package versions will invalidate the cache.
387
+
- Changing any contents in the notebook's frontmatter.
388
+
- Changing any contents of any executable Julia cells, including cell options.
389
+
390
+
Changes that do not invalidate a cache:
391
+
392
+
- Editing markdown content outside of executable Julia cells.
393
+
394
+
Caches are saved to file in a `.cache` directory alongside the notebook file.
395
+
This directory is safe to remove if you want to invalidate all caches. The
396
+
contents of the individual cache files is an internal implementation detail and
397
+
should not be relied upon.
398
+
399
+
These caches are safe to save in CI via such tools as GitHub Actions
400
+
`action/cache`to help improve the render time of long-running notebooks that
401
+
do not often change.
402
+
403
+
### R and Python support
404
+
405
+
`{{r}}`and `{{python}}` executable code blocks are supported in the `julia`
406
+
engine via integrations with the
407
+
[RCall](https://github.com/JuliaInterop/RCall.jl) and
Currently, the `engine: julia` option must be specified in each `.qmd` file. Setting the engine project-wide via `_quarto.yml` [is not yet supported](https://github.com/quarto-dev/quarto-cli/issues/3157).
0 commit comments