From f75f1eeb921a2bd6725b97392a5aa586df0deb85 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Mon, 4 Nov 2024 14:36:27 -0500 Subject: [PATCH] refactor: remove some unused constants --- src/Core.jl | 3 +-- src/Dataset.jl | 6 +++--- src/ProgramConstants.jl | 3 --- src/SymbolicRegression.jl | 3 --- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Core.jl b/src/Core.jl index 994ab23f2..c442efc73 100644 --- a/src/Core.jl +++ b/src/Core.jl @@ -10,8 +10,7 @@ include("OptionsStruct.jl") include("Operators.jl") include("Options.jl") -using .ProgramConstantsModule: - MAX_DEGREE, BATCH_DIM, FEATURE_DIM, RecordType, DATA_TYPE, LOSS_TYPE +using .ProgramConstantsModule: RecordType, DATA_TYPE, LOSS_TYPE using .DatasetModule: Dataset, is_weighted, has_units, max_features using .MutationWeightsModule: AbstractMutationWeights, MutationWeights, sample_mutation using .OptionsStructModule: diff --git a/src/Dataset.jl b/src/Dataset.jl index 65cc909cb..2818fd1db 100644 --- a/src/Dataset.jl +++ b/src/Dataset.jl @@ -3,7 +3,7 @@ module DatasetModule using DynamicQuantities: Quantity using ..UtilsModule: subscriptify, get_base_type -using ..ProgramConstantsModule: BATCH_DIM, FEATURE_DIM, DATA_TYPE, LOSS_TYPE +using ..ProgramConstantsModule: DATA_TYPE, LOSS_TYPE using ...InterfaceDynamicQuantitiesModule: get_si_units, get_sym_units """ @@ -125,8 +125,8 @@ function Dataset( ) end - n = size(X, BATCH_DIM) - nfeatures = size(X, FEATURE_DIM) + n = size(X, 2) + nfeatures = size(X, 1) variable_names = @something(variable_names, ["x$(i)" for i in 1:nfeatures]) display_variable_names = @something( display_variable_names, ["x$(subscriptify(i))" for i in 1:nfeatures] diff --git a/src/ProgramConstants.jl b/src/ProgramConstants.jl index 607ce08b2..7ae2ccd7b 100644 --- a/src/ProgramConstants.jl +++ b/src/ProgramConstants.jl @@ -1,8 +1,5 @@ module ProgramConstantsModule -const MAX_DEGREE = 2 -const BATCH_DIM = 2 -const FEATURE_DIM = 1 const RecordType = Dict{String,Any} const DATA_TYPE = Number diff --git a/src/SymbolicRegression.jl b/src/SymbolicRegression.jl index bef4fcb98..62cf8626e 100644 --- a/src/SymbolicRegression.jl +++ b/src/SymbolicRegression.jl @@ -219,9 +219,6 @@ using DispatchDoctor: @stable end using .CoreModule: - MAX_DEGREE, - BATCH_DIM, - FEATURE_DIM, DATA_TYPE, LOSS_TYPE, RecordType,