Skip to content

Commit 94e04f7

Browse files
committed
rm SymbolicRegression from Project.toml
1 parent 07a6bfe commit 94e04f7

File tree

2 files changed

+39
-33
lines changed

2 files changed

+39
-33
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ SIRUS = "cdeec39e-fb35-4959-aadb-a1dd5dede958"
8888
SelfOrganizingMaps = "ba4b7379-301a-4be0-bee6-171e4e152787"
8989
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
9090
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
91-
SymbolicRegression = "8254be44-1295-4e6a-a16d-46603ac705cb"
9291
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
9392

9493
[targets]
@@ -125,7 +124,6 @@ test = [
125124
"PartitionedLS",
126125
"SelfOrganizingMaps",
127126
"SIRUS",
128-
"SymbolicRegression",
129127
"StableRNGs",
130128
"Suppressor",
131129
"Test",

test/integration.jl

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ const OTHER_TEST_LEVEL = 3
88

99
# # IMPORTANT
1010

11-
# There are two main ways to flag a problem model for integration test purposes.
11+
# There are three main ways to flag a problem model for integration test purposes.
1212

1313
# - Adding to `FILTER_GIVEN_ISSUE` means the model is allowed to fail silently, unless
1414
# tests pass, a fact that will be reported in the log.
1515

16-
# - Adding to `PATHOLOGIES` completely excludes the model from testing.
16+
# - Adding to `PATHOLOGIES` excludes the model from testing (although there will still be
17+
# an attempt to load the model type, unless the package providing it is excluded from
18+
# the MLJ/Project.toml)
19+
20+
# - Completetely exclude all models provided by a particular package from testing, by
21+
# excluding the package from the [extras] section of MLJ/Project.toml.
1722

1823
# Obviously the first method is strongly preferred.
1924

@@ -52,9 +57,34 @@ FILTER_GIVEN_ISSUE = Dict(
5257
)
5358

5459

60+
# # SEE IF PROJECT FILE INCLUDES ALL MODEL-PROVIDING PACKAGES
61+
62+
# helper; `project_lines` are lines from a Project.toml file:
63+
function pkgs(project_lines)
64+
project = TOML.parse(join(project_lines, "\n"))
65+
headings = Set(keys(project)) ["deps", "extras"]
66+
return vcat(collect.(keys.([project[h] for h in headings]))...)
67+
end
68+
69+
# identify missing pkgs:
70+
project_path = joinpath(@__DIR__, "..", "Project.toml")
71+
project_lines = open(project_path) do io
72+
readlines(io)
73+
end
74+
pkgs_in_project = pkgs(project_lines)
75+
registry_project_lines = MLJModels.Registry.registry_project()
76+
pkgs_in_registry = pkgs(registry_project_lines)
77+
missing_pkgs = setdiff(pkgs_in_registry, pkgs_in_project)
78+
# If there are missing packages a warning is issued at the end
79+
80+
5581
# # LOG OUTSTANDING ISSUES TO STDOUT
5682

57-
const MODELS = models();
83+
const MODELS = filter(models()) do m
84+
pkg = m.package_name
85+
api_pkg = split(m.load_path, '.') |> first
86+
api_pkg in pkgs_in_project
87+
end
5888
const JULIA_MODELS = filter(m->m.is_pure_julia, MODELS);
5989
const OTHER_MODELS = setdiff(MODELS, JULIA_MODELS);
6090

@@ -158,32 +188,6 @@ end
158188
WITHOUT_DATASETS = vcat(WITHOUT_DATASETS, PATHOLOGIES)
159189

160190

161-
# # CHECK PROJECT FILE INCLUDES ALL MODEL-PROVIDING PACKAGES
162-
163-
# helper; `project_lines` are lines from a Project.toml file:
164-
function pkgs(project_lines)
165-
project = TOML.parse(join(project_lines, "\n"))
166-
headings = Set(keys(project)) ["deps", "extras"]
167-
return vcat(collect.(keys.([project[h] for h in headings]))...)
168-
end
169-
170-
# identify missing pkgs:
171-
project_path = joinpath(@__DIR__, "..", "Project.toml")
172-
project_lines = open(project_path) do io
173-
readlines(io)
174-
end
175-
pkgs_in_project = pkgs(project_lines)
176-
registry_project_lines = MLJModels.Registry.registry_project()
177-
pkgs_in_registry = pkgs(registry_project_lines)
178-
missing_pkgs = setdiff(pkgs_in_registry, pkgs_in_project)
179-
180-
# throw error if there are any:
181-
isempty(missing_pkgs) || error(
182-
"Integration tests cannot proceed because the following packages are "*
183-
"missing from the [extras] section of the MLJ Project.toml file: "*
184-
join(missing_pkgs, ", ")
185-
)
186-
187191
# # LOAD ALL MODEL CODE
188192

189193
# Load all the model providing packages with a broad level=1 test:
@@ -236,10 +240,14 @@ for (model_set, level) in [
236240
end
237241
end
238242

243+
isempty(missing_pkgs) || @warn "Integration tests for the following packages in the "*
244+
"model registry were omitted, as they do not have an entry in the [extras] "*
245+
"section of the MLJ Project.toml file: "*join(missing_pkgs, ", ")
239246
okay = isempty(problems)
240-
okay || print("Integration tests failed for these models: \n $problems")
241-
println()
247+
okay || @error "Integration tests failed for these models: \n $problems"
242248

249+
println()
250+
# throw error if there are any issues:
243251
@test okay
244252

245253
true

0 commit comments

Comments
 (0)