@@ -26,7 +26,7 @@ using RuntimeGeneratedFunctions
2626RuntimeGeneratedFunctions. init (@__MODULE__ )
2727
2828function no_worldage ()
29- ex = :(function f (_du,_u,_p,_t)
29+ ex = :(function f (_du, _u, _p, _t)
3030 @inbounds _du[1 ] = _u[1 ]
3131 @inbounds _du[2 ] = _u[2 ]
3232 nothing
@@ -36,24 +36,24 @@ function no_worldage()
3636 u = rand (2 )
3737 p = nothing
3838 t = nothing
39- f1 (du,u,p, t)
39+ f1 (du, u, p, t)
4040end
4141no_worldage ()
4242```
4343
4444## Changing how global symbols are looked up
4545
4646If you want to use helper functions or global variables from a different
47- module within your function expression you'll need to pass a ` context_module `
47+ module within your function expression, you'll need to pass a ` context_module `
4848to the ` @RuntimeGeneratedFunction ` constructor. For example
4949
5050``` julia
5151RuntimeGeneratedFunctions. init (@__MODULE__ )
5252
5353module A
54- using RuntimeGeneratedFunctions
55- RuntimeGeneratedFunctions. init (A)
56- helper_function (x) = x + 1
54+ using RuntimeGeneratedFunctions
55+ RuntimeGeneratedFunctions. init (A)
56+ helper_function (x) = x + 1
5757end
5858
5959function g ()
6666
6767## Precompilation and setting the function expression cache
6868
69- For technical reasons RuntimeGeneratedFunctions needs to cache the function
69+ For technical reasons, RuntimeGeneratedFunctions needs to cache the function
7070expression in a global variable within some module. This is normally
7171transparent to the user, but if the ` RuntimeGeneratedFunction ` is evaluated
7272during module precompilation, the cache module must be explicitly set to the
7373module currently being precompiled. This is relevant for helper functions in
74- some module which construct a RuntimeGeneratedFunction on behalf of the user.
74+ some module, which construct a RuntimeGeneratedFunction on behalf of the user.
7575For example, in the following code, any third party user of
7676` HelperModule.construct_rgf() ` user needs to pass their own module as the
7777` cache_module ` if they want the returned function to work after precompilation:
@@ -82,13 +82,13 @@ RuntimeGeneratedFunctions.init(@__MODULE__)
8282# Imagine HelperModule is in a separate package and will be precompiled
8383# separately.
8484module HelperModule
85- using RuntimeGeneratedFunctions
86- RuntimeGeneratedFunctions. init (HelperModule)
85+ using RuntimeGeneratedFunctions
86+ RuntimeGeneratedFunctions. init (HelperModule)
8787
88- function construct_rgf (cache_module, context_module, ex)
89- ex = :((x)-> $ ex^ 2 + x)
90- RuntimeGeneratedFunction (cache_module, context_module, ex)
91- end
88+ function construct_rgf (cache_module, context_module, ex)
89+ ex = :((x) -> $ ex^ 2 + x)
90+ RuntimeGeneratedFunction (cache_module, context_module, ex)
91+ end
9292end
9393
9494function g ()
@@ -103,56 +103,72 @@ f = g()
103103```
104104
105105## Reproducibility
106+
106107``` @raw html
107108<details><summary>The documentation of this SciML package was built using these direct dependencies,</summary>
108109```
110+
109111``` @example
110112using Pkg # hide
111113Pkg.status() # hide
112114```
115+
113116``` @raw html
114117</details>
115118```
119+
116120``` @raw html
117121<details><summary>and using this machine and Julia version.</summary>
118122```
123+
119124``` @example
120125using InteractiveUtils # hide
121126versioninfo() # hide
122127```
128+
123129``` @raw html
124130</details>
125131```
132+
126133``` @raw html
127134<details><summary>A more complete overview of all dependencies and their versions is also provided.</summary>
128135```
136+
129137``` @example
130138using Pkg # hide
131- Pkg.status(;mode = PKGMODE_MANIFEST) # hide
139+ Pkg.status(; mode = PKGMODE_MANIFEST) # hide
132140```
141+
133142``` @raw html
134143</details>
135144```
145+
136146``` @raw html
137147You can also download the
138148<a href="
139149```
150+
140151``` @eval
141152using TOML
142- version = TOML.parse(read("../../Project.toml",String))["version"]
143- name = TOML.parse(read("../../Project.toml",String))["name"]
144- link = "https://github.com/SciML/"*name*".jl/tree/gh-pages/v"*version*"/assets/Manifest.toml"
153+ version = TOML.parse(read("../../Project.toml", String))["version"]
154+ name = TOML.parse(read("../../Project.toml", String))["name"]
155+ link = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version *
156+ "/assets/Manifest.toml"
145157```
158+
146159``` @raw html
147160">manifest</a> file and the
148161<a href="
149162```
163+
150164``` @eval
151165using TOML
152- version = TOML.parse(read("../../Project.toml",String))["version"]
153- name = TOML.parse(read("../../Project.toml",String))["name"]
154- link = "https://github.com/SciML/"*name*".jl/tree/gh-pages/v"*version*"/assets/Project.toml"
166+ version = TOML.parse(read("../../Project.toml", String))["version"]
167+ name = TOML.parse(read("../../Project.toml", String))["name"]
168+ link = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version *
169+ "/assets/Project.toml"
155170```
171+
156172``` @raw html
157173">project</a> file.
158- ```
174+ ```
0 commit comments