• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Edinburgh-Genome-Foundry / DnaChisel / 14225235949

02 Apr 2025 04:56PM UTC coverage: 90.508% (+0.5%) from 90.054%
14225235949

push

github

veghp
Bump to v3.2.14

1 of 1 new or added line in 1 file covered. (100.0%)

101 existing lines in 35 files now uncovered.

2994 of 3308 relevant lines covered (90.51%)

0.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.44
/dnachisel/Specification/SpecEvaluation/ProblemConstraintsEvaluations.py
1
from .SpecEvaluation import SpecEvaluation
1✔
2
from .SpecEvaluations import SpecEvaluations
1✔
3

4

5
class ProblemConstraintsEvaluations(SpecEvaluations):
1✔
6
    """Special multi-evaluation class for all constraints of a same problem.
7

8
    See submethod ``.from_problem``
9

10
    """
11

12
    specifications_role = "constraint"
1✔
13

14
    @staticmethod
1✔
15
    def from_problem(problem, autopass_constraints=True):
1✔
16
        """Create an instance by evaluating all constraints in the problem.
17

18
        The ``problem`` is a DnaChisel DnaOptimizationProblem.
19

20
        """
21

22
        def evaluate(constraint):
1✔
23
            if autopass_constraints and constraint.enforced_by_nucleotide_restrictions:
1✔
24
                return SpecEvaluation(
1✔
25
                    constraint,
26
                    problem,
27
                    score=1,
28
                    locations=[],
29
                    message="Enforced by nucleotides restrictions",
30
                )
31
            else:
32
                return constraint.evaluate(problem)
1✔
33

34
        return ProblemConstraintsEvaluations(
1✔
35
            [evaluate(constraint) for constraint in problem.constraints],
36
            problem=problem,
37
        )
38

39
    def success_failure_color(self, evaluation):
1✔
40
        """Return color #60f979 if evaluation.passes else #f96c60."""
41
        return "#60f979" if evaluation.passes else "#f96c60"
1✔
42

43
    def text_summary_message(self):
1✔
44
        """Return a global SUCCESS or FAILURE message for all evaluations."""
45
        failed = [e for e in self.evaluations if not e.passes]
1✔
46
        if failed == []:
1✔
UNCOV
47
            return "SUCCESS - all constraints evaluations pass"
×
48
        else:
49
            return "FAILURE: %d constraints evaluations failed" % len(failed)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc