From 7abe4ab30941d7392ce9967caaf6422a96584a48 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 24 Jul 2021 12:40:49 -0700 Subject: rename `checked_spec_clauses()` to `spec_clauses()` --- lib/spack/spack/solver/asp.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3-70-g09d2