From db5f4d53d85c946a3c333ab2e105ea784093c4eb Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Sun, 5 May 2024 14:22:30 +0100 Subject: [PATCH] refactor: standardize constant --- pysr/sr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pysr/sr.py b/pysr/sr.py index 547674834..f63425310 100644 --- a/pysr/sr.py +++ b/pysr/sr.py @@ -57,7 +57,7 @@ _subscriptify, ) -already_ran = False +ALREADY_RAN = False def _process_constraints(binary_operators, unary_operators, constraints): @@ -1602,7 +1602,7 @@ def _run( """ # Need to be global as we don't want to recreate/reinstate julia for # every new instance of PySRRegressor - global already_ran + global ALREADY_RAN # These are the parameters which may be modified from the ones # specified in init, so we define them here locally: @@ -1621,7 +1621,7 @@ def _run( cluster_manager = self.cluster_manager # Start julia backend processes - if not already_ran and update_verbosity != 0: + if not ALREADY_RAN and update_verbosity != 0: print("Compiling Julia backend...") if cluster_manager is not None: @@ -1854,7 +1854,7 @@ def _run( if self.delete_tempfiles: shutil.rmtree(self.tempdir_) - already_ran = True + ALREADY_RAN = True return self