Skip to content

Commit

Permalink
test: check docstrings (#640)
Browse files Browse the repository at this point in the history
* test: check that all public names have docstrings

* Add FiniteDiff to test deps

* Remove doctests

* Revert project
  • Loading branch information
gdalle authored Nov 24, 2024
1 parent 5576221 commit cc8818a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
module DifferentiationInterfaceForwardDiffExt

using ADTypes: AbstractADType, AutoForwardDiff
using Base: Fix1, Fix2
using ADTypes: AutoForwardDiff
import DifferentiationInterface as DI
using DifferentiationInterface:
BatchSizeSettings,
Cache,
Constant,
PrepContext,
Context,
FixTail,
DerivativePrep,
DifferentiateWith,
GradientPrep,
HessianPrep,
HVPPrep,
JacobianPrep,
NoDerivativePrep,
NoSecondDerivativePrep,
PushforwardPrep,
Rewrap,
Expand All @@ -42,17 +39,14 @@ using ForwardDiff:
derivative,
derivative!,
extract_derivative,
extract_derivative!,
gradient,
gradient!,
hessian,
hessian!,
jacobian,
jacobian!,
npartials,
partials,
value
using LinearAlgebra: dot, mul!

DI.check_available(::AutoForwardDiff) = true

Expand Down
6 changes: 6 additions & 0 deletions DifferentiationInterface/test/Misc/Internals/_formalities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ end
@test JuliaFormatter.format(DifferentiationInterface; verbose=false, overwrite=false)
end

@testset "Documentation" begin
if VERSION >= v"1.11"
@test isempty(Docs.undocumented_names(DifferentiationInterface))
end
end

@testset "ExplicitImports" begin
@test check_no_implicit_imports(DifferentiationInterface) === nothing
@test check_no_stale_explicit_imports(DifferentiationInterface) === nothing
Expand Down
6 changes: 6 additions & 0 deletions DifferentiationInterfaceTest/test/formalities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ end
JET.test_package(DifferentiationInterfaceTest; target_defined_modules=true)
end

@testset "Documentation" begin
if VERSION >= v"1.11"
@test isempty(Docs.undocumented_names(DifferentiationInterfaceTest))
end
end

@testset "ExplicitImports" begin
@test_broken check_no_implicit_imports(DifferentiationInterfaceTest) === nothing
@test_broken check_no_stale_explicit_imports(DifferentiationInterfaceTest) === nothing
Expand Down

2 comments on commit cc8818a

@gdalle
Copy link
Member Author

@gdalle gdalle commented on cc8818a Nov 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir=DifferentiationInterfaceTest

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/120094

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a DifferentiationInterfaceTest-v0.9.0 -m "<description of version>" cc8818a2bb0fb3dab2abf29ba213f89213a8613a
git push origin DifferentiationInterfaceTest-v0.9.0

Please sign in to comment.