|
| 1 | +""" |
| 2 | + MLJModelRegistry |
| 3 | +
|
| 4 | +Module providing methods for managing the MLJ Model Registry. To modify the registry: |
| 5 | +
|
| 6 | +- Create a local clone of the [MLJModelRegistry.jl |
| 7 | + repository](https://github.com/JuliaAI/MLJModelRegistry.jl) |
| 8 | +
|
| 9 | +- Use Julia's package manager to add or remove items from the list of registered packages |
| 10 | + in the environment "/registry/". If adding a new item, see the protocol below. |
| 11 | +
|
| 12 | +- In a fresh temporary environment, run `Pkg.develop("path_to_clone")` and `using |
| 13 | + MLJModelRegistry`. |
| 14 | +
|
| 15 | +- To add or update the metadata associated with a package (compulsory for new packages) |
| 16 | + run [`update(pkg)`](@ref) |
| 17 | +
|
| 18 | +- To update the metadata for *all* packages in the registry, run [`update()`](@ref). |
| 19 | +
|
| 20 | +- When satisfied, commit your changes to the clone and make a pull request to the master |
| 21 | + MLJModelRegistry.jl repository. |
| 22 | +
|
| 23 | +!!! important |
| 24 | +
|
| 25 | + Removing a package from the "/registry/" enviroment does not remove its metadata from |
| 26 | + the Model Registry (from "/registry/Metatdata.toml"). Unless you later call `update()` |
| 27 | + to update all package metadata (slow), you must call [`MLJModelRegistry.gc()`](@ref) to |
| 28 | + specifically remove metadata for all orphaned packages (fast). |
| 29 | +
|
| 30 | +# Protocol for adding new packages to the registry environment |
| 31 | +
|
| 32 | +!!! important |
| 33 | +
|
| 34 | + In any pull request to update the Model Registry you should note the final |
| 35 | + output of `Pkg.status(outdated=true)`. |
| 36 | +
|
| 37 | +1. In your local clone of MLJModelRegistry.jl, `activate` the environment at "/registry/". |
| 38 | +
|
| 39 | +2. `update` the environment |
| 40 | +
|
| 41 | +3. Note the output of `Pkg.status(outdated=true)` |
| 42 | +
|
| 43 | +3. `add` the new package |
| 44 | +
|
| 45 | +4. Repeat steps 2 and 3 above, and investigate any dependency downgrades for which your addition may be the cause. |
| 46 | +
|
| 47 | +If adding the new package results in downgrades to existing dependencies because your |
| 48 | +package is not up to date with it's compatibility bounds, then your pull request to |
| 49 | +register the new models may be rejected. |
| 50 | +
|
| 51 | +""" |
1 | 52 | module MLJModelRegistry
|
2 | 53 |
|
3 | 54 | import MLJModelInterface
|
4 | 55 | using OrderedCollections
|
5 | 56 | using InteractiveUtils
|
| 57 | +using Suppressor |
| 58 | +using Distributed |
6 | 59 |
|
7 | 60 | # Location of the MLJ model registry (a Julia pkg environment + metadata):
|
8 | 61 | const ROOT = joinpath(@__DIR__, "..")
|
9 | 62 | const REGISTRY = joinpath(ROOT, "registry")
|
10 | 63 |
|
| 64 | +# for controlling logging: |
| 65 | +struct Loud end |
| 66 | +struct Quiet end |
| 67 | + |
11 | 68 | # The MLJ Model Registry is a special case of a "generic model registry", as described in
|
12 | 69 | # this file, defining the `GenericRegistry` module (which has methods, no types):
|
13 | 70 | include("GenericRegistry.jl")
|
14 | 71 | include("check_traits.jl")
|
15 | 72 | include("remote_methods.jl")
|
16 | 73 | include("methods.jl")
|
17 | 74 |
|
| 75 | +export update |
| 76 | + |
18 | 77 | end # module
|
0 commit comments