Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = ["SciML"]
ComponentArrays = "0.15"
Random = "1.10"
SafeTestsets = "0.1"
SciMLTesting = "2.1"
SciMLTesting = "2.4"
Test = "1.10"
julia = "1.10"

Expand Down
8 changes: 1 addition & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ makedocs(
sitename = "FunctionProperties.jl",
authors = "Chris Rackauckas",
modules = [FunctionProperties],
clean = true, doctest = false, linkcheck = true,
warnonly = [
:doctest,
:linkcheck,
:parse_error,
:example_block, # Other available options are # :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block, :footnote, :meta_block, :missing_docs, :setup_block
],
clean = true, doctest = true, linkcheck = true,
format = Documenter.HTML(
analytics = "UA-90474609-3",
assets = ["assets/favicon.ico"],
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resolve at compile time, opt it out with [`is_leaf`](@ref).
## Contributing

- Please refer to the
[SciML ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://github.com/SciML/ColPrac/blob/master/README.md)
[SciML ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://sciml.github.io/ColPrac/)
for guidance on PRs, issues, and other matters relating to contributing to SciML.

- See the [SciML Style Guide](https://github.com/SciML/SciMLStyle) for common coding practices and other style decisions.
Expand Down
18 changes: 18 additions & 0 deletions src/effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ effects analysis must establish both consistency (equal inputs give equal output
dependence on or mutation of external state) and effect freeness (no observable side effects).
`false` means *not proven*. The underlying effect queries are compiler internals, so they are
verified functionally at first use; where they are unavailable the answer is always `false`.

## Example

```jldoctest
julia> using FunctionProperties

julia> ispure(x -> x^2 + 1, 2.0)
true
```
"""
function ispure(f, x...)
_effects_capable() || return false
Expand All @@ -53,6 +62,15 @@ end
Check whether the return type of `f` for arguments of the given types is inferred as a single
concrete type. `false` means inference produced an abstract or `Union` result -- or that the
call could not be analyzed at all.

## Example

```jldoctest
julia> using FunctionProperties

julia> isinferable(x -> x + 1, 2.0)
true
```
"""
function isinferable(f, x...)
sig = Tuple{Core.Typeof(f), Core.Typeof.(x)...}
Expand Down
9 changes: 9 additions & 0 deletions src/randomness.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ call is reachable through statically resolvable calls.

This matters wherever a trace of `f` is replayed, e.g. compiled ReverseDiff tapes freeze the
random draws of the recording pass, silently changing the semantics of a stochastic `f`.

## Example

```jldoctest
julia> using FunctionProperties

julia> hasrandomness(x -> x + 1, 2.0)
false
```
"""
function hasrandomness(f, x...)
sig = Tuple{Core.Typeof(f), Core.Typeof.(x)...}
Expand Down
12 changes: 12 additions & 0 deletions src/writeprobe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ The certificate covers writes through the selected argument reference and reject
recorded write. Aliases of the selected array reachable through the *other* arguments are
detected one structural level deep (arguments themselves and elements of tuples or arrays of
arrays); deeper aliasing is outside the certificate.

## Example

```jldoctest
julia> using FunctionProperties

julia> hasmutation(x -> sum(abs2, x), [1.0, 2.0])
false

julia> hasmutation(x -> (x[1] = 0; x), [1.0, 2.0])
true
```
"""
function hasmutation(f, x...; arg = (:))
idx = _wrt_indices(arg, length(x))
Expand Down
5 changes: 1 addition & 4 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
FunctionProperties = {path = "../.."}

[compat]
Aqua = "0.8"
JET = "0.9,0.10,0.11"
SafeTestsets = "0.0.1, 0.1"
SciMLTesting = "2.1"
SciMLTesting = "2.4"
Test = "1"
julia = "1.10"
1 change: 0 additions & 1 deletion test/qa/qa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ using SciMLTesting, FunctionProperties, JET, Test
# ignored in the public-API checks.
run_qa(
FunctionProperties;
explicit_imports = true,
ei_kwargs = (;
all_explicit_imports_are_public = (; ignore = (:GotoIfNot,)),
all_qualified_accesses_are_public = (;
Expand Down
Loading