Skip to content

Commit b7c0624

Browse files
authored
Merge pull request #5 from JuliaAI/dev
For a 0.1.1 release
2 parents e137308 + a6bddef commit b7c0624

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJModelRegistryTools"
22
uuid = "0a96183e-380b-4aa6-be10-c555140810f2"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"

src/methods.jl

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ err_invalid_packages(skip, env) = ArgumentError(
1111
"\"$env\". "
1212
)
1313

14-
const INFO_BE_PATIENT1 = "Be patient. This could take a minute or so... "
15-
const INFO_BE_PATIENT10 = "Be patient. This could take ten minutes or so..."
14+
const INFO_BE_PATIENT1 = "Be patient. This could take a minute or so ... "
15+
const INFO_BE_PATIENT10 = "Be patient. This could take ten minutes or so ..."
1616

1717

1818
# # HELPERS
@@ -28,9 +28,8 @@ end
2828
# develop MLJModelRegistryTools into the specifified `registry` project:
2929
function setup(registry)
3030
ex = quote
31-
# TODO: replace Line 1 with Line 2 after MLJModelRegistry is registered at General:
32-
Pkg.develop(path=$ROOT) # Line 1
33-
# Pkg.add(MLJModelRegistryTools) # Line 2
31+
# Pkg.develop(path=$ROOT)
32+
Pkg.add("MLJModelRegistryTools")
3433
end
3534
future = GenericRegistry.run([], ex; environment=registry)
3635
fetch(future)
@@ -66,9 +65,8 @@ function metadata(pkg; registry="", check_traits=true)
6665
setup=()
6766
else
6867
setup = quote
69-
# REMOVE THIS NEXT LINE AFTER TAGGING NEW MLJMODELINTERFACE
70-
Pkg.develop(path="/Users/anthony/MLJ/MLJModelInterface/")
71-
Pkg.develop(path=$ROOT) # MLJModelRegistryTools
68+
# Pkg.develop(path=$ROOT)
69+
Pkg.add("MLJModelRegistryTools")
7270
end
7371
end
7472
program = quote
@@ -194,18 +192,23 @@ function update(
194192
issubset(skip, allpkgs) || throw(err_invalid_packages(skip, registry))
195193
@suppress setup(registry)
196194
end
197-
pkgs = setdiff(allpkgs, skip)
198-
N = length(pkgs)
199-
pos = 1
195+
pkgs = setdiff(allpkgs, skip) |> sort
196+
pkg_set = OrderedSet(pkgs)
197+
200198
@info "Processing up to $nworkers packages at a time. "
201199
@info INFO_BE_PATIENT10
202-
while N 1
203-
print("\rPackages remaining: $N ")
204-
n = min(nworkers, N)
205-
batch = pkgs[pos:pos + n - 1]
200+
while !isempty(pkg_set)
201+
print("\rPackages remaining: $(length(pkgs)) ")
202+
n = min(nworkers, length(pkg_set))
203+
batch = [pop!(pkg_set) for _ in 1:n]
206204
@suppress begin
207-
futures =
208-
[MLJModelRegistryTools.metadata(pkg; registry, check_traits) for pkg in batch]
205+
futures = [
206+
MLJModelRegistryTools.metadata(
207+
pkg;
208+
registry,
209+
check_traits,
210+
) for pkg in batch
211+
]
209212
try
210213
for (i, f) in enumerate(futures)
211214
GenericRegistry.put(batch[i], fetch(f), registry_path())
@@ -217,7 +220,6 @@ function update(
217220
end
218221
debug || GenericRegistry.close.(futures)
219222
end
220-
N -= n
221223
end
222224
isempty(registry) || @suppress cleanup(registry)
223225
gc()

src/remote_methods.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ for converting leaves are:
5151
5252
2. If it's an `AbstractString`, apply `string` function (e.g, to remove `SubString`s).
5353
54-
3. In all other cases, except `AbstractArray`s, wrap in single quotes, as in sum -> "`sum`".
54+
3. In all other cases, except `AbstractArray`s, first wrap in single quotes, as in sum -> "\`sum\`".
55+
5556
4. Replace any `#` character in the application of Rule 3 with `_` (to handle `gensym` names)
5657
5758
5. For an `AbstractVector`, broadcast the preceding Rules over its elements.

src/setpath.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const ERR_REGISTRY_PATH = ErrorException(
44
"No path to the registry has been set. Run "*
55
"`setpath(path)`, where `path` is the path to the registry in your local "*
66
"MLJModels.jl clone. That is, do something like "*
7-
"`setpath(\"~/MyPkgs/MLJModels/registry\")`. "
7+
"`setpath(\"~/MyPkgs/MLJModels/src/registry\")`. "
88
)
99

1010
# for accessing or changing the location of the registry (initially empty):

0 commit comments

Comments
 (0)