Skip to content

Commit 726c7dd

Browse files
authored
Merge pull request #57 from JuliaAI/dev
Re-instate docs for "Testing an Implementation"
2 parents d242c0e + 11c62d9 commit 726c7dd

File tree

6 files changed

+57
-44
lines changed

6 files changed

+57
-44
lines changed

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
44
LearnAPI = "92ad9a40-7767-427a-9ee6-6e577f1266cb"
5+
LearnTestAPI = "3111ed91-c4f2-40e7-bb19-7f6c618409b8"
56
MLCore = "c2834f40-e789-41da-a90e-33b280584a8c"
67
ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161"
78
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
using Documenter
22
using LearnAPI
3+
using LearnTestAPI
34
using ScientificTypesBase
45
using DocumenterInterLinks
56
# using LearnTestAPI
67

78
const REPO = Remotes.GitHub("JuliaAI", "LearnAPI.jl")
89

910
makedocs(
10-
modules=[LearnAPI, ], #LearnTestAPI],
11+
modules=[LearnAPI, LearnTestAPI],
1112
format=Documenter.HTML(
1213
prettyurls = true,#get(ENV, "CI", nothing) == "true",
1314
collapselevel = 1,

docs/src/anatomy_of_an_implementation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ refer to the [demonstration](@ref workflow) of the implementation given later.
4444
1. Implement `fit` (probably following an existing example). Read the [`fit`](@ref) document string to see what else may need to be implemented, paying particular attention to the "New implementations" section.
4545
3. Rinse and repeat with each new method implemented.
4646
4. Identify any additional [learner traits](@ref traits) that have appropriate overloadings; use the [`@trait`](@ref) macro to define these in one block.
47-
5. Ensure your implementation includes the compulsory method [`LearnAPI.learner`](@ref) and compulsory traits [`LearnAPI.constructor`](@ref) and [`LearnAPI.functions`](@ref). Read and apply "[Testing your implementation](@ref)".
47+
5. Ensure your implementation includes the compulsory method [`LearnAPI.learner`](@ref) and compulsory traits [`LearnAPI.constructor`](@ref) and [`LearnAPI.functions`](@ref). Read and apply "[Testing an Implementation](@ref)".
4848

4949
If you get stuck, refer back to this tutorial and the [Reference](@ref reference) sections.
5050

docs/src/common_implementation_patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ which introduces the main interface objects and terminology.
1111
Although an implementation is defined purely by the methods and traits it implements, many
1212
implementations fall into one (or more) of the informally understood patterns or tasks
1313
below. While some generally fall into one of the core `Descriminative`, `Generative` or
14-
`Static` patterns detailed [here](@id kinds_of_learner), there are exceptions (such as
14+
`Static` patterns detailed [here](@ref kinds_of_learner), there are exceptions (such as
1515
clustering, which has both `Descriminative` and `Static` variations).
1616

1717
- [Regression](@ref): Supervised learners for continuous targets

docs/src/testing_an_implementation.md

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,67 @@
22

33
Testing is provided by the LearnTestAPI.jl package.
44

5-
<!-- Testing is provided by the LearnTestAPI.jl package documented below. -->
5+
Testing is provided by the LearnTestAPI.jl package documented below.
66

7-
<!-- ## Quick start -->
7+
## Quick start
88

9-
<!-- ```@docs -->
10-
<!-- LearnTestAPI -->
11-
<!-- ``` -->
9+
```@docs
10+
LearnTestAPI
11+
```
1212

13-
<!-- !!! warning -->
13+
!!! warning
1414

15-
<!-- New releases of LearnTestAPI.jl may add tests to `@testapi`, and -->
16-
<!-- this may result in new failures in client package test suites, because -->
17-
<!-- of previously undetected broken contracts. Adding a test to `@testapi` -->
18-
<!-- is not considered a breaking change -->
19-
<!-- to LearnTestAPI, unless it supports a breaking change to LearnAPI.jl. -->
15+
New releases of LearnTestAPI.jl may add tests to `@testapi`, and
16+
this may result in new failures in client package test suites, because
17+
of previously undetected broken contracts. Adding a test to `@testapi`
18+
is not considered a breaking change
19+
to LearnTestAPI, unless it supports a breaking change to LearnAPI.jl.
2020

2121

22-
<!-- ## The @testapi macro -->
22+
## The @testapi macro
2323

24-
<!-- ```@docs -->
25-
<!-- LearnTestAPI.@testapi -->
26-
<!-- ``` -->
24+
```@docs
25+
LearnTestAPI.@testapi
26+
```
2727

28-
<!-- ## Learners for testing -->
28+
## Learners for testing
2929

30-
<!-- LearnTestAPI.jl provides some simple, tested, LearnAPI.jl implementations, which may be -->
31-
<!-- useful for testing learner wrappers and meta-algorithms. -->
30+
LearnTestAPI.jl provides some simple, tested, LearnAPI.jl implementations, which may be
31+
useful for testing learner wrappers and meta-algorithms.
3232

33-
<!-- ```@docs -->
34-
<!-- LearnTestAPI.Ridge -->
35-
<!-- LearnTestAPI.BabyRidge -->
36-
<!-- LearnTestAPI.ConstantClassifier -->
37-
<!-- LearnTestAPI.TruncatedSVD -->
38-
<!-- LearnTestAPI.Selector -->
39-
<!-- LearnTestAPI.FancySelector -->
40-
<!-- LearnTestAPI.NormalEstimator -->
41-
<!-- LearnTestAPI.Ensemble -->
42-
<!-- LearnTestAPI.StumpRegressor -->
43-
<!-- ``` -->
33+
- [`LearnTestAPI.Ridge`](@ref)
34+
- [`LearnTestAPI.BabyRidge`](@ref)
35+
- [`LearnTestAPI.ConstantClassifier`](@ref)
36+
- [`LearnTestAPI.TruncatedSVD`](@ref)
37+
- [`LearnTestAPI.Selector`](@ref)
38+
- [`LearnTestAPI.FancySelector`](@ref)
39+
- [`LearnTestAPI.NormalEstimator`](@ref)
40+
- [`LearnTestAPI.Ensemble`](@ref)
41+
- [`LearnTestAPI.StumpRegressor`](@ref)
4442

45-
<!-- ## Private methods -->
4643

47-
<!-- For LearnTestAPI.jl developers only, and subject to breaking changes at any time: -->
44+
```@docs
45+
LearnTestAPI.Ridge
46+
LearnTestAPI.BabyRidge
47+
LearnTestAPI.ConstantClassifier
48+
LearnTestAPI.TruncatedSVD
49+
LearnTestAPI.Selector
50+
LearnTestAPI.FancySelector
51+
LearnTestAPI.NormalEstimator
52+
LearnTestAPI.Ensemble
53+
LearnTestAPI.StumpRegressor
54+
```
4855

49-
<!-- ```@docs -->
50-
<!-- LearnTestAPI.@logged_testset -->
51-
<!-- LearnTestAPI.@nearly -->
52-
<!-- LearnTestAPI.isnear -->
53-
<!-- LearnTestAPI.learner_get -->
54-
<!-- LearnTestAPI.model_get -->
55-
<!-- LearnTestAPI.verb -->
56-
<!-- LearnTestAPI.filter_out_verbosity -->
57-
<!-- ``` -->
56+
## Private methods
57+
58+
For LearnTestAPI.jl developers only, and subject to breaking changes at any time:
59+
60+
```@docs
61+
LearnTestAPI.@logged_testset
62+
LearnTestAPI.@nearly
63+
LearnTestAPI.isnear
64+
LearnTestAPI.learner_get
65+
LearnTestAPI.model_get
66+
LearnTestAPI.verb
67+
LearnTestAPI.filter_out_verbosity
68+
```

src/types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ following must hold:
146146
- The ``j``th observation of `ŷ`, for any ``j``, depends only on the ``j``th
147147
observation of the provided `data` (no correlation between observations).
148148
149-
An exception holds in the case that [`LearnAPI.kind_of(learner)`](@ref)` ==
149+
An exception holds in the case that [`LearnAPI.kind_of(learner)`](@ref)` == `
150150
[`LearnAPI.Generative()`](@ref):
151151
152152
- `LearnAPI.predict(model, kind_of_proxy)` consists of a single observation (such as a

0 commit comments

Comments
 (0)