From 5084d32f611e630a4a8f154bb2baa18bd51e5a2a Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 5 Sep 2025 09:38:15 +1000 Subject: [PATCH 1/3] add some code comments, tweak a docstring, to clarify fit_only! --- src/machines.jl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/machines.jl b/src/machines.jl index a7473642..0eaf2779 100644 --- a/src/machines.jl +++ b/src/machines.jl @@ -583,17 +583,17 @@ or none of the following apply: 4. The specified `rows` have changed since the last retraining and `mach.model` does not have `Static` type. -5. `mach.model` is a model and different from the last model used for training, but has - the same type. +5. `mach.model` is a `Model` (i.e, not a symbol) and is different from the last model used + for training (but has the same type). -6. `mach.model` is a model but has a type different from the last model used for +6. `mach.model` is a `Model` but has a type different from the last model used for training. -7. `mach.model` is a symbol and `(composite, mach.model)` is different from the last - model used for training, but has the same type. +7. `mach.model` is a symbol and `getproperty(composite, mach.model)` is different from the + last model used for training (but has the same type). -8. `mach.model` is a symbol and `(composite, mach.model)` has a different type from - the last model used for training. +8. `mach.model` is a symbol and `getproperty(composite, mach.model)` has a different type + from the last model used for training. In any of the cases (1) - (4), (6), or (8), `mach` is trained ab initio. If (5) or (7) is true, then a training update is applied. @@ -645,6 +645,7 @@ function fit_only!( mach.model end + # neither `old_model` nor `model` are symbols here: modeltype_changed = !isdefined(mach, :old_model) ? true : typeof(model) === typeof(mach.old_model) ? false : true From 3ec0d0d495dfcdd18a28eea5b453190310aa2d4e Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 26 Sep 2025 11:24:46 +1200 Subject: [PATCH 2/3] remove type piracy around show for NamedTuple --- src/show.jl | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/show.jl b/src/show.jl index 7a5d0310..8b9201e8 100644 --- a/src/show.jl +++ b/src/show.jl @@ -78,32 +78,6 @@ function handle(X) end -## SHOW METHOD FOR NAMED TUPLES - -# long version of showing a named tuple: -Base.show(stream::IO, ::MIME"text/plain", t::NamedTuple) = fancy_nt(stream, t) -fancy_nt(t) = fancy_nt(stdout, t) # is this used? -fancy_nt(stream, t::NamedTuple{(), Tuple{}}) = print(stream, "NamedTuple()") -fancy_nt(stream, t) = fancy_nt(stream, t, 0) -fancy_nt(stream, t, n) = show(stream, t) -function fancy_nt(stream, t::NamedTuple, n) - print(stream, "(") - first_item = true - for k in keys(t) - value = getproperty(t, k) - if !first_item - print(stream, crind(n + 1)) - else - first_item = false - end - print(stream, "$k = ") - fancy_nt(stream, value, n + length("$k = ") + 1) - print(stream, ",") - end - print(stream, ")") -end - - ## OTHER EXPOSED SHOW METHODS # string consisting of carriage return followed by indentation of length n: From e45da86de6a8e391bf6dedc4b3e2cfb16ed0f472 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 26 Sep 2025 11:25:32 +1200 Subject: [PATCH 3/3] bump 1.9.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index a68ab8aa..23912096 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJBase" uuid = "a7f614a8-145f-11e9-1d2a-a57a1082229d" authors = ["Anthony D. Blaom "] -version = "1.9.0" +version = "1.9.1" [deps] CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"