Repository: JuliaAI/MLJBase.jl
Pull request #588 (2021-06-28 05:55:34)

Address ScientificTypes name change


Patch:
diff --git a/Project.toml b/Project.toml
index b2d5ec3a..98cde088 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
 name = "MLJBase"
 uuid = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
 authors = ["Anthony D. Blaom <anthony.blaom@gmail.com>"]
-version = "0.18.11"
+version = "0.18.12"
 
 [deps]
 CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
@@ -15,13 +15,13 @@ InvertedIndices = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
 LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
 LossFunctions = "30fc2ffe-d236-52d8-8643-a9d8f7c094a7"
 MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
-MLJScientificTypes = "2e2323e0-db8b-457b-ae0d-bdfb3bc63afd"
 Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
 OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
 Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
 PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
 ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
 Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
+ScientificTypes = "321657f4-b219-11e9-178b-2701a2544e81"
 StatisticalTraits = "64bff920-2084-43da-a3e6-9bb72801c0c9"
 Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
 StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
@@ -33,14 +33,14 @@ ComputationalResources = "0.3"
 Distributions = "0.22, 0.23, 0.24, 0.25"
 InvertedIndices = "1"
 LossFunctions = "0.5, 0.6, 0.7"
-MLJModelInterface = "0.4.1, 1.1"
-MLJScientificTypes = "0.4.1"
+MLJModelInterface = "0.4.1, 1"
 Missings = "0.4, 1"
 OrderedCollections = "1.1"
 Parameters = "0.12"
 PrettyTables = "1"
 ProgressMeter = "1.7.1"
-StatisticalTraits = "1.1"
+ScientificTypes = "2"
+StatisticalTraits = "2"
 StatsBase = "0.32, 0.33"
 Tables = "0.2, 1.0"
 julia = "1"
diff --git a/src/MLJBase.jl b/src/MLJBase.jl
index 6d2bfab1..1310a972 100644
--- a/src/MLJBase.jl
+++ b/src/MLJBase.jl
@@ -7,8 +7,8 @@ import Base: ==, precision, getindex, setindex!
 import Base.+, Base.*
 
 # Scitype
-import MLJScientificTypes.ScientificTypes: TRAIT_FUNCTION_GIVEN_NAME
-using MLJScientificTypes
+import ScientificTypes.ScientificTypesBase: TRAIT_FUNCTION_GIVEN_NAME
+using ScientificTypes
 
 # Traits for models and measures (which are being overloaded):
 using StatisticalTraits
@@ -64,7 +64,7 @@ using Statistics, LinearAlgebra, Random, InteractiveUtils
 ## EXPORTS
 
 # -------------------------------------------------------------------
-# re-exports from MLJModelInterface, MLJScientificTypes
+# re-exports from MLJModelInterface, ScientificTypes
 # NOTE: MLJBase does **not** re-export UnivariateFinite to avoid
 # ambiguities between the raw constructor (MLJBase.UnivariateFinite)
 # and the general method (MLJModelInterface.UnivariateFinite)
@@ -103,7 +103,7 @@ export fit, update, update_data, transform, inverse_transform,
 export matrix, int, classes, decoder, table,
     nrows, selectrows, selectcols, select
 
-# re-exports from MLJScientificTypes
+# re-exports from ScientificTypes
 export Unknown, Known, Finite, Infinite,
     OrderedFactor, Multiclass, Count, Continuous, Textual,
     Binary, ColorImage, GrayImage, Image, Table
diff --git a/src/composition/learning_networks/nodes.jl b/src/composition/learning_networks/nodes.jl
index 248d277b..7f56bbbc 100644
--- a/src/composition/learning_networks/nodes.jl
+++ b/src/composition/learning_networks/nodes.jl
@@ -133,8 +133,8 @@ function _apply(y_plus, input...; kwargs...)
     end
 end
 
-MLJScientificTypes.elscitype(N::Node) = Unknown
-function MLJScientificTypes.elscitype(
+ScientificTypes.elscitype(N::Node) = Unknown
+function ScientificTypes.elscitype(
     N::Node{<:Machine{<:Union{Deterministic,Unsupervised}}})
     if N.operation == MLJBase.predict
         return target_scitype(N.machine.model)
@@ -147,10 +147,10 @@ function MLJScientificTypes.elscitype(
 end
 
 # TODO after
-# https://github.com/alan-turing-institute/ScientificTypes.jl/issues/102 :
+# https://github.com/alan-turing-institute/ScientificTypesBase.jl/issues/102 :
 # Add Probabilistic case to above
 
-MLJScientificTypes.scitype(N::Node) = CallableReturning{elscitype(N)}
+ScientificTypes.scitype(N::Node) = CallableReturning{elscitype(N)}
 
 
 ## FITTING A NODE
diff --git a/src/measures/measures.jl b/src/measures/measures.jl
index 6224e554..6d0c68f0 100644
--- a/src/measures/measures.jl
+++ b/src/measures/measures.jl
@@ -51,11 +51,11 @@ end
 show_as_constructed(::Type{<:Measure}) = true
 
 # info (see also src/init.jl):
-function MLJScientificTypes.info(M, ::Val{:measure_type})
+function ScientificTypes.info(M, ::Val{:measure_type})
     values = Tuple(@eval($trait($M)) for trait in MEASURE_TRAITS)
     return NamedTuple{Tuple(MEASURE_TRAITS)}(values)
 end
-MLJScientificTypes.info(m, ::Val{:measure}) = info(typeof(m))
+ScientificTypes.info(m, ::Val{:measure}) = info(typeof(m))
 
 
 ## AGGREGATION
diff --git a/src/sources.jl b/src/sources.jl
index b91f7e18..6edebf73 100644
--- a/src/sources.jl
+++ b/src/sources.jl
@@ -45,8 +45,8 @@ source() = source(nothing)
 
 source(Xs::Source; args...) = Xs
 
-MLJScientificTypes.scitype(X::Source) = CallableReturning{X.scitype}
-MLJScientificTypes.elscitype(X::Source) = X.scitype
+ScientificTypes.scitype(X::Source) = CallableReturning{X.scitype}
+ScientificTypes.elscitype(X::Source) = X.scitype
 nodes(X::Source) = [X, ]
 Base.isempty(X::Source) = X.data === nothing
 nrows_at_source(X::Source) = nrows(X.data)


Test patch:
diff --git a/test/_models/DecisionTree.jl b/test/_models/DecisionTree.jl
index e8ebe83e..4ccc9bc4 100755
--- a/test/_models/DecisionTree.jl
+++ b/test/_models/DecisionTree.jl
@@ -3,7 +3,7 @@ export DecisionTreeClassifier, DecisionTreeRegressor
 import MLJBase
 import MLJBase: @mlj_model, metadata_pkg, metadata_model
 
-using MLJScientificTypes
+using ScientificTypes
 
 using CategoricalArrays
 
diff --git a/test/_models/MultivariateStats.jl b/test/_models/MultivariateStats.jl
index aafc7559..10f70f4d 100644
--- a/test/_models/MultivariateStats.jl
+++ b/test/_models/MultivariateStats.jl
@@ -5,7 +5,7 @@ import MLJBase: @mlj_model, metadata_model, metadata_pkg
 # using Distances
 using LinearAlgebra
 using Tables
-using MLJScientificTypes
+using ScientificTypes
 
 import MultivariateStats
 
diff --git a/test/_models/foobarmodel.jl b/test/_models/foobarmodel.jl
index 4aa6c23a..732a3273 100644
--- a/test/_models/foobarmodel.jl
+++ b/test/_models/foobarmodel.jl
@@ -4,7 +4,7 @@ export FooBarRegressor
 
 import MLJBase
 using LinearAlgebra
-using MLJScientificTypes
+using ScientificTypes
 
 mutable struct FooBarRegressor <: MLJBase.Deterministic
     lambda::Float64
diff --git a/test/composition/models/pipelines.jl b/test/composition/models/pipelines.jl
index 2726e0c9..2ff02d9c 100644
--- a/test/composition/models/pipelines.jl
+++ b/test/composition/models/pipelines.jl
@@ -4,7 +4,7 @@ using MLJBase
 using ..Models
 using Test
 using Statistics
-using MLJScientificTypes
+using ScientificTypes
 using StableRNGs
 
 rng = StableRNG(698790187)
diff --git a/test/data/data.jl b/test/data/data.jl
index 2da8b690..230a2edb 100644
--- a/test/data/data.jl
+++ b/test/data/data.jl
@@ -5,7 +5,7 @@ using Test
 import TypedTables
 using CategoricalArrays
 import Tables
-using MLJScientificTypes
+using ScientificTypes
 
 using Random
 using StableRNGs