From 6a2489a111aaf7991d0114c8535763fc23eb9546 Mon Sep 17 00:00:00 2001 From: VIGNET Pierre <pierre.vignet@irisa.fr> Date: Thu, 12 Dec 2019 19:13:43 +0100 Subject: [PATCH] [cmd][lib] switch get_shift_step to a proper property --- library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py | 3 ++- library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py | 2 +- .../cadbiom/models/clause_constraints/mcl/TestCLUnfolder.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py b/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py index 990c42b..cd28e41 100644 --- a/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py +++ b/library/cadbiom/models/clause_constraints/mcl/CLUnfolder.py @@ -582,7 +582,8 @@ class CLUnfolder(object): """ return self.__shift_direction - def get_shift_step(self): + @property + def shift_step(self): """ @return: the shift step ss (if n is X_0 code, n+ss is X_1 code) """ diff --git a/library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py b/library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py index 4516e12..2d79218 100644 --- a/library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py +++ b/library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py @@ -133,7 +133,7 @@ class RawSolution(object): """ self.solution = solution self.unfolder = unfolder - self.shift_step = unfolder.get_shift_step() + self.shift_step = unfolder.shift_step self.current_step = unfolder.current_step self.shift_direction = unfolder.get_shift_direction() diff --git a/library/cadbiom/models/clause_constraints/mcl/TestCLUnfolder.py b/library/cadbiom/models/clause_constraints/mcl/TestCLUnfolder.py index 38655e7..dfea5cf 100644 --- a/library/cadbiom/models/clause_constraints/mcl/TestCLUnfolder.py +++ b/library/cadbiom/models/clause_constraints/mcl/TestCLUnfolder.py @@ -666,7 +666,7 @@ def init_forward_unfolding_solution_2(mcla): # Shift of the system clauses (and syst aux clauses) # The maximum value is now 48 since there is 47 literals assert unfolder.get_var_number() == 46 - assert unfolder.get_shift_step() == 47 + assert unfolder.shift_step == 47 expected = [ [[-24, 16], [-24, 4], [-16, -4, 24], [-15, 42], [-12, 42], [15, 12, -42], [-42, 41], [-11, 41], [42, 11, -41], [2, -40], [41, -40], [-2, -41, 40], -- GitLab