Skip to content

Commit

Permalink
refactor: moved transition.py to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Oct 21, 2023
1 parent b611be7 commit 7cfe29c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from sbstudio.plugin.constants import Collections
from sbstudio.plugin.transition import get_id_for_formation_constraint
from sbstudio.plugin.utils import sort_collection
from sbstudio.plugin.utils.transition import get_id_for_formation_constraint

from .base import StoryboardOperator

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
)
from sbstudio.plugin.model.storyboard import Storyboard, StoryboardEntry
from sbstudio.plugin.tasks.safety_check import invalidate_caches
from sbstudio.plugin.transition import (
from sbstudio.plugin.utils import create_internal_id
from sbstudio.plugin.utils.evaluator import create_position_evaluator
from sbstudio.plugin.utils.transition import (
create_transition_constraint_between,
find_transition_constraint_between,
set_constraint_name_from_storyboard_entry,
)
from sbstudio.plugin.utils import create_internal_id
from sbstudio.plugin.utils.evaluator import create_position_evaluator
from sbstudio.utils import constant

from .base import StoryboardOperator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from sbstudio.plugin.constants import Collections
from sbstudio.plugin.model.storyboard import get_storyboard
from sbstudio.plugin.transition import find_transition_constraint_between
from sbstudio.plugin.utils.transition import find_transition_constraint_between

from .base import StoryboardOperator

Expand Down
2 changes: 1 addition & 1 deletion src/modules/sbstudio/plugin/operators/return_to_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _run(self, storyboard, *, context) -> bool:
min_distance = get_proximity_warning_threshold(context)
land_speed = min(self.velocity_z, 0.5)

# call api to create smart RTH plan
# call API to create smart RTH plan
plan = get_api().plan_smart_rth(
source,
target,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .utils.identifiers import create_internal_id, is_internal_id
from .identifiers import create_internal_id, is_internal_id

__all__ = (
"create_transition_constraint_between",
Expand All @@ -10,6 +10,7 @@


def get_id_for_formation_constraint(storyboard_entry):
"""Returns a unique identifier for the given storyboard entry."""
# Make sure to update is_transition_constraint() as well if you change the
# format of the ID
return create_internal_id(f"Entry {storyboard_entry.id}")
Expand Down

0 comments on commit 7cfe29c

Please sign in to comment.