Skip to content

Commit

Permalink
refactor: standardize constant
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed May 5, 2024
1 parent 7021459 commit db5f4d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pysr/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
_subscriptify,
)

already_ran = False
ALREADY_RAN = False


def _process_constraints(binary_operators, unary_operators, constraints):
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -1854,7 +1854,7 @@ def _run(
if self.delete_tempfiles:
shutil.rmtree(self.tempdir_)

already_ran = True
ALREADY_RAN = True

return self

Expand Down

0 comments on commit db5f4d5

Please sign in to comment.