summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2021-07-24 12:40:49 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2021-11-05 00:15:47 -0700
commit7abe4ab30941d7392ce9967caaf6422a96584a48 (patch)
tree1c485d192dafe5b04092c9f7a74b3f37131357c0 /lib
parentad5d632eebce4d2af797746ba02357a45836b560 (diff)
downloadspack-7abe4ab30941d7392ce9967caaf6422a96584a48.tar.gz
spack-7abe4ab30941d7392ce9967caaf6422a96584a48.tar.bz2
spack-7abe4ab30941d7392ce9967caaf6422a96584a48.tar.xz
spack-7abe4ab30941d7392ce9967caaf6422a96584a48.zip
rename `checked_spec_clauses()` to `spec_clauses()`
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/solver/asp.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 09a03543f8..a6c375ab17 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -808,7 +808,7 @@ class SpackSolverSetup(object):
self.gen.fact(fn.condition(condition_id))
# requirements trigger the condition
- requirements = self.checked_spec_clauses(
+ requirements = self.spec_clauses(
named_cond, body=True, required_from=name)
for pred in requirements:
self.gen.fact(
@@ -816,7 +816,7 @@ class SpackSolverSetup(object):
)
if imposed_spec:
- imposed_constraints = self.checked_spec_clauses(
+ imposed_constraints = self.spec_clauses(
imposed_spec, body=False, required_from=name)
for pred in imposed_constraints:
# imposed "node"-like conditions are no-ops
@@ -1006,13 +1006,13 @@ class SpackSolverSetup(object):
self.gen.fact(fn.compiler_version_flag(
compiler.name, compiler.version, name, flag))
- def checked_spec_clauses(self, *args, **kwargs):
- """Wrap a call to spec clauses into a try/except block that raise
- a comprehensible error message in case of failure.
+ def spec_clauses(self, *args, **kwargs):
+ """Wrap a call to `_spec_clauses()` into a try/except block that
+ raises a comprehensible error message in case of failure.
"""
requestor = kwargs.pop('required_from', None)
try:
- clauses = self.spec_clauses(*args, **kwargs)
+ clauses = self._spec_clauses(*args, **kwargs)
except RuntimeError as exc:
msg = str(exc)
if requestor:
@@ -1020,7 +1020,7 @@ class SpackSolverSetup(object):
raise RuntimeError(msg)
return clauses
- def spec_clauses(self, spec, body=False, transitive=True):
+ def _spec_clauses(self, spec, body=False, transitive=True):
"""Return a list of clauses for a spec mandates are true.
Arguments:
@@ -1133,7 +1133,7 @@ class SpackSolverSetup(object):
# add all clauses from dependencies
if transitive:
for dep in spec.traverse(root=False):
- clauses.extend(self.spec_clauses(dep, body, transitive=False))
+ clauses.extend(self._spec_clauses(dep, body, transitive=False))
return clauses