Skip to content

Commit f45e2ed

Browse files
committed
_loop_check
1 parent 0843fd7 commit f45e2ed

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/diffpy/srfit/equation/literals/operators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def addLiteral(self, literal):
113113
Raises ValueError if the literal causes a self-reference.
114114
"""
115115
# Make sure we don't have self-reference
116-
self._loopCheck(literal)
116+
self._loop_check(literal)
117117
self.args.append(literal)
118118
literal.addObserver(self._flush)
119119
self._flush(other=(self,))
@@ -128,15 +128,15 @@ def getValue(self):
128128

129129
value = property(lambda self: self.getValue())
130130

131-
def _loopCheck(self, literal):
131+
def _loop_check(self, literal):
132132
"""Check if a literal causes self-reference."""
133133
if literal is self:
134134
raise ValueError("'%s' causes self-reference" % literal)
135135

136136
# Check to see if I am a dependency of the literal.
137137
if hasattr(literal, "args"):
138138
for lit_arg in literal.args:
139-
self._loopCheck(lit_arg)
139+
self._loop_check(lit_arg)
140140
return
141141

142142

src/diffpy/srfit/equation/visitors/swapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def onOperator(self, op):
105105
# Validate the new literal. If it fails, we need to restore the
106106
# old one
107107
try:
108-
op._loopCheck(newlit)
108+
op._loop_check(newlit)
109109
except ValueError:
110110
# Restore the old literal
111111
op.args.insert(idx, oldlit)
@@ -135,9 +135,9 @@ def onEquation(self, eq):
135135
eq.setRoot(self.newlit)
136136
return
137137

138-
# Now move into the equation. We have to do a _loopCheck to make sure
138+
# Now move into the equation. We have to do a _loop_check to make sure
139139
# that we won't have any loops in the equation.
140-
eq._loopCheck(self.newlit)
140+
eq._loop_check(self.newlit)
141141
eq.root.identify(self)
142142

143143
# Reset the root in case anything changed underneath.

0 commit comments

Comments
 (0)