MilesCranmer commited on
Commit
eb96ede
1 Parent(s): 16e5f3e

Tidy up error message

Browse files
Files changed (1) hide show
  1. pysr/sr.py +3 -3
pysr/sr.py CHANGED
@@ -129,12 +129,12 @@ def _handle_constraints(binary_operators, unary_operators, constraints):
129
  for op in binary_operators:
130
  if op not in constraints:
131
  constraints[op] = (-1, -1)
132
- if op in ["plus", "sub"]:
133
  if constraints[op][0] != constraints[op][1]:
134
  raise NotImplementedError(
135
- "You need equal constraints on both sides for - and *, due to simplification strategies."
136
  )
137
- elif op == "mult":
138
  # Make sure the complex expression is in the left side.
139
  if constraints[op][0] == -1:
140
  continue
 
129
  for op in binary_operators:
130
  if op not in constraints:
131
  constraints[op] = (-1, -1)
132
+ if op in ["plus", "sub", "+", "-"]:
133
  if constraints[op][0] != constraints[op][1]:
134
  raise NotImplementedError(
135
+ "You need equal constraints on both sides for - and +, due to simplification strategies."
136
  )
137
+ elif op in ["mult", "*"]:
138
  # Make sure the complex expression is in the left side.
139
  if constraints[op][0] == -1:
140
  continue