Skip to content

Commit

Permalink
Feat: Add cut_major_lenght
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Aug 31, 2023
1 parent b894850 commit 6e98892
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions neurots/generate/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,21 @@ def next_point(self):
for section_grower in ordered_sections:
# the current section_grower is generated
# In here the stop criterion can be modified accordingly

if "cut_major_length" in self.params:
# this makes an early termination of major branch
# it needs to revert the value after getting the state to preserve
# the original topology
if section_grower.process == "major":
_term = section_grower.stop_criteria["TMD"].term
section_grower.stop_criteria["TMD"].term = self.params["cut_major_length"]

Check warning on line 258 in neurots/generate/tree.py

View check run for this annotation

Codecov / codecov/patch

neurots/generate/tree.py#L257-L258

Added lines #L257 - L258 were not covered by tests

state = self.growth_algo.extend(section_grower)

if "cut_major_length" in self.params:
if section_grower.process == "major":
section_grower.stop_criteria["TMD"].term = _term

Check warning on line 264 in neurots/generate/tree.py

View check run for this annotation

Codecov / codecov/patch

neurots/generate/tree.py#L264

Added line #L264 was not covered by tests

if state != "continue":
section = self.append_section(section_grower)

Expand Down

0 comments on commit 6e98892

Please sign in to comment.