Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cadbiom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIGNET Pierre
cadbiom
Commits
308cb6f6
Commit
308cb6f6
authored
5 years ago
by
VIGNET Pierre
Browse files
Options
Downloads
Patches
Plain Diff
[lib] DimacsFrontierSol: Fix security cast for hash() (the concerned attr has changed)
parent
d8697793
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py
+6
-4
6 additions, 4 deletions
...ary/cadbiom/models/clause_constraints/mcl/MCLSolutions.py
with
6 additions
and
4 deletions
library/cadbiom/models/clause_constraints/mcl/MCLSolutions.py
+
6
−
4
View file @
308cb6f6
...
...
@@ -670,9 +670,7 @@ class DimacsFrontierSol(object):
"""
# Frontier places
# /!\ Most of the time spent in the constructor is due to this line
# Already a frozenset but this attribute must be immutable for __hash__,
# cast is a security.
self
.
frontier_values
=
frozenset
(
raw_sol
.
frontier_pos_and_neg_values
)
self
.
frontier_values
=
raw_sol
.
frontier_pos_and_neg_values
# Activated input/events (clocks)
# Callable of raw_sol method (avoid to store raw_sol in this object)
...
...
@@ -687,7 +685,11 @@ class DimacsFrontierSol(object):
# - by FrontierSolution.from_dimacs_front_sol()
# - to accelerate the call of self.nb_activated_frontiers
# - as a criterion of uniqueness, to do set operations
self
.
activated_frontier_values
=
raw_sol
.
extract_activated_frontier_values
()
# Already a frozenset but this attribute must be immutable for __hash__,
# cast is a security.
self
.
activated_frontier_values
=
frozenset
(
raw_sol
.
extract_activated_frontier_values
()
)
# Pre-compute nb of activated frontiers in the current solution
# PS: use numpy to accelerate this ? The cast is costly...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment