Skip to content

Commit 7ce792f

Browse files
authored
Merge branch 'master' into s/0-arg
2 parents dc2c9e7 + 4168d9d commit 7ce792f

21 files changed

+698
-117
lines changed

.JuliaFormatter.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
style = "sciml"
2+
format_markdown = true

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,26 @@ on:
88
- master
99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
11+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
version:
16+
- '1'
17+
- '1.6'
18+
- 'nightly'
19+
os:
20+
- ubuntu-latest
21+
arch:
22+
- x64
23+
fail-fast: false
1224
steps:
13-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
1426
- uses: julia-actions/setup-julia@v1
1527
with:
16-
version: 1
17-
- uses: actions/cache@v1
28+
version: ${{ matrix.version }}
29+
arch: ${{ matrix.arch }}
30+
- uses: actions/cache@v3
1831
env:
1932
cache-name: cache-artifacts
2033
with:
@@ -27,6 +40,6 @@ jobs:
2740
- uses: julia-actions/julia-buildpkg@v1
2841
- uses: julia-actions/julia-runtest@v1
2942
- uses: julia-actions/julia-processcoverage@v1
30-
- uses: codecov/codecov-action@v1
43+
- uses: codecov/codecov-action@v3
3144
with:
3245
file: lcov.info

.github/workflows/CompatHelper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
16-
run: julia -e 'using CompatHelper; CompatHelper.main()'
16+
run: julia -e 'using CompatHelper; CompatHelper.main(;subdirs=["", "docs"])'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'release-'
8+
tags: '*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: julia-actions/setup-julia@latest
17+
with:
18+
version: '1'
19+
- name: Install dependencies
20+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
21+
- name: Build and deploy
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
24+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
25+
run: julia --project=docs/ --code-coverage=user docs/make.jl
26+
- uses: julia-actions/julia-processcoverage@v1
27+
- uses: codecov/codecov-action@v3
28+
with:
29+
file: lcov.info

.github/workflows/FormatCheck.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: format-check
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'release-'
8+
tags: '*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
julia-version: [1]
17+
julia-arch: [x86]
18+
os: [ubuntu-latest]
19+
steps:
20+
- uses: julia-actions/setup-julia@latest
21+
with:
22+
version: ${{ matrix.julia-version }}
23+
24+
- uses: actions/checkout@v3
25+
- name: Install JuliaFormatter and format
26+
# This will use the latest version by default but you can set the version like so:
27+
#
28+
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
29+
run: |
30+
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
31+
julia -e 'using JuliaFormatter; format(".", verbose=true)'
32+
- name: Format check
33+
run: |
34+
julia -e '
35+
out = Cmd(`git diff --name-only`) |> read |> String
36+
if out == ""
37+
exit(0)
38+
else
39+
@error "Some files have not been formatted !!!"
40+
write(stdout, out)
41+
exit(1)
42+
end'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Invalidations
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
# Skip intermediate builds: always.
8+
# Cancel intermediate builds: always.
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
evaluate:
14+
# Only run on PRs to the default branch.
15+
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
16+
if: github.base_ref == github.event.repository.default_branch
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: julia-actions/setup-julia@v1
20+
with:
21+
version: '1'
22+
- uses: actions/checkout@v3
23+
- uses: julia-actions/julia-buildpkg@v1
24+
- uses: julia-actions/julia-invalidations@v1
25+
id: invs_pr
26+
27+
- uses: actions/checkout@v3
28+
with:
29+
ref: ${{ github.event.repository.default_branch }}
30+
- uses: julia-actions/julia-buildpkg@v1
31+
- uses: julia-actions/julia-invalidations@v1
32+
id: invs_default
33+
34+
- name: Report invalidation counts
35+
run: |
36+
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
37+
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
38+
- name: Check if the PR does increase number of invalidations
39+
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
40+
run: exit 1

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/Manifest.toml
1+
Manifest.toml
2+
docs/build

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RuntimeGeneratedFunctions"
22
uuid = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
33
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com> and contributors"]
4-
version = "0.5.1"
4+
version = "0.5.11"
55

66
[deps]
77
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
@@ -10,7 +10,7 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1010

1111
[compat]
1212
ExprTools = "0.1"
13-
julia = "1"
13+
julia = "1.6"
1414

1515
[extras]
1616
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"

README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# RuntimeGeneratedFunctions.jl
22

3+
[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged)
4+
[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/RuntimeGeneratedFunctions/stable/)
5+
6+
[![codecov](https://codecov.io/gh/SciML/RuntimeGeneratedFunctions.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/RuntimeGeneratedFunctions.jl)
37
[![Build Status](https://github.com/SciML/RuntimeGeneratedFunctions.jl/workflows/CI/badge.svg)](https://github.com/SciML/RuntimeGeneratedFunctions.jl/actions?query=workflow%3ACI)
48

9+
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
10+
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)
11+
512
`RuntimeGeneratedFunctions` are functions generated at runtime without world-age
613
issues and with the full performance of a standard Julia anonymous function. This
714
builds functions in a way that avoids `eval`.
@@ -11,6 +18,13 @@ Note that `RuntimeGeneratedFunction` does not handle closures. Please use the
1118
package for more fixable staged programming. While `GeneralizedGenerated.jl` is
1219
more powerful, `RuntimeGeneratedFunctions.jl` handles large expressions better.
1320

21+
## Tutorials and Documentation
22+
23+
For information on using the package,
24+
[see the stable documentation](https://docs.sciml.ai/RuntimeGeneratedFunctions/stable/). Use the
25+
[in-development documentation](https://docs.sciml.ai/RuntimeGeneratedFunctions/dev/) for the version of
26+
the documentation, which contains the unreleased features.
27+
1428
## Simple Example
1529

1630
Here's an example showing how to construct and immediately call a runtime
@@ -21,7 +35,7 @@ using RuntimeGeneratedFunctions
2135
RuntimeGeneratedFunctions.init(@__MODULE__)
2236

2337
function no_worldage()
24-
ex = :(function f(_du,_u,_p,_t)
38+
ex = :(function f(_du, _u, _p, _t)
2539
@inbounds _du[1] = _u[1]
2640
@inbounds _du[2] = _u[2]
2741
nothing
@@ -31,7 +45,7 @@ function no_worldage()
3145
u = rand(2)
3246
p = nothing
3347
t = nothing
34-
f1(du,u,p,t)
48+
f1(du, u, p, t)
3549
end
3650
no_worldage()
3751
```
@@ -46,9 +60,9 @@ to the `@RuntimeGeneratedFunction` constructor. For example
4660
RuntimeGeneratedFunctions.init(@__MODULE__)
4761

4862
module A
49-
using RuntimeGeneratedFunctions
50-
RuntimeGeneratedFunctions.init(A)
51-
helper_function(x) = x + 1
63+
using RuntimeGeneratedFunctions
64+
RuntimeGeneratedFunctions.init(A)
65+
helper_function(x) = x + 1
5266
end
5367

5468
function g()
@@ -77,13 +91,13 @@ RuntimeGeneratedFunctions.init(@__MODULE__)
7791
# Imagine HelperModule is in a separate package and will be precompiled
7892
# separately.
7993
module HelperModule
80-
using RuntimeGeneratedFunctions
81-
RuntimeGeneratedFunctions.init(HelperModule)
94+
using RuntimeGeneratedFunctions
95+
RuntimeGeneratedFunctions.init(HelperModule)
8296

83-
function construct_rgf(cache_module, context_module, ex)
84-
ex = :((x)->$ex^2 + x)
85-
RuntimeGeneratedFunction(cache_module, context_module, ex)
86-
end
97+
function construct_rgf(cache_module, context_module, ex)
98+
ex = :((x) -> $ex^2 + x)
99+
RuntimeGeneratedFunction(cache_module, context_module, ex)
100+
end
87101
end
88102

89103
function g()
@@ -96,4 +110,3 @@ end
96110
f = g()
97111
@show f(1)
98112
```
99-

0 commit comments

Comments
 (0)