@@ -26,8 +26,9 @@ def __init__(
2626 self ,
2727 graph ,
2828 allow_nonleaf_targets = False ,
29- filter_transitive_proposals = False ,
3029 max_attempts = 2 ,
30+ max_proposals_per_leaf = 3 ,
31+ min_size_with_proposals = 0 ,
3132 search_scaling_factor = 1.5
3233 ):
3334 """
@@ -40,24 +41,24 @@ def __init__(
4041 allow_nonleaf_targets : bool, optional
4142 Indication of whether to generate proposals between leaf and nodes
4243 with degree 2. Default is False.
43- filter_transitive_proposals : bool, optional
44- Indication of whether to filter proposals between fragments with a
45- connection via other proposals and fragments. Default is False.
4644 max_attempts : int, optional
4745 Number of attempts made to generate proposals from a node with
4846 increasing search radii. Default is 2.
47+ max_proposals_per_leaf : bool, optional
48+ Maximum number of proposals generated at each leaf. Default is 3.
49+ min_size_with_proposals : float, optional
50+ Minimum fragment path length required for proposals. Default is 0.
4951 search_scaling_factor : 1.5, optional
5052 Scaling actor used to enlarge search radius for each search.
5153 Default is 2.
5254 """
5355 # Instance attributes
5456 self .allow_nonleaf_targets = allow_nonleaf_targets
55- self .filter_transitive_proposals = filter_transitive_proposals
5657 self .graph = graph
5758 self .kdtree = None
5859 self .max_attempts = max_attempts
59- self .max_proposals_per_leaf = graph . max_proposals_per_leaf
60- self .min_size_with_proposals = graph . min_size_with_proposals
60+ self .max_proposals_per_leaf = max_proposals_per_leaf
61+ self .min_size_with_proposals = min_size_with_proposals
6162 self .n_proposals_blocked = 0
6263 self .search_scaling_factor = search_scaling_factor
6364
@@ -115,10 +116,6 @@ def __call__(self, initial_radius):
115116 # Add proposal
116117 proposals .add (pair_id )
117118 connections [pair_component_id ] = pair_id
118-
119- # Filter proposals (if applicable)
120- if self .filter_transitive_proposals :
121- proposals = self ._filter_transitive_proposals (proposals )
122119 return proposals
123120
124121 def find_node_candidates (self , leaf , radius ):
@@ -165,30 +162,6 @@ def get_nearby_points(self, leaf, radius):
165162 pts_dict = self .select_closest_components (pts_dict )
166163 return [val ["xyz" ] for val in pts_dict .values ()]
167164
168- def _filter_transitive_proposals (self , proposals ):
169- """
170- Removes proposals that directly connect fragments a and c when an
171- indirect path exists via a → b → c.
172-
173- Parameters
174- ----------
175- proposals : List[Frozenset[int]]
176- Proposals to be filtered.
177- """
178- # Initializations
179- graph = deepcopy (self .graph )
180- proposals = get_sorted_proposals (graph , proposals )
181-
182- # Main
183- filtered_proposals = list ()
184- for proposal in proposals :
185- if not graph .is_transitive_connection (proposal ):
186- i , j = proposal
187- graph .add_edge (i , j )
188- graph .add_proposal (i , j )
189- filtered_proposals .append (proposal )
190- return filtered_proposals
191-
192165 # --- Helpers ---
193166 def get_closer_endpoint (self , edge , xyz ):
194167 """
0 commit comments