Skip to content

Commit

Permalink
fix outdated test fixture f
Browse files Browse the repository at this point in the history
  • Loading branch information
juliagsy committed Jul 26, 2023
1 parent c3e3dd7 commit 76b9e2f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
6 changes: 2 additions & 4 deletions ivy_robot_demos/interactive/drone_spline_planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,11 @@ def compute_cost_and_sdfs(
return total_cost, poses, body_positions, ivy.reshape(sdf_vals, (-1, 100, 1))


def main(interactive=True, try_use_sim=True, f=None, fw=None):
def main(interactive=True, try_use_sim=True, fw=None):
# config
this_dir = os.path.dirname(os.path.realpath(__file__))
fw = ivy.choose_random_backend(excluded=["numpy"]) if fw is None else fw
ivy.set_backend(fw)
f = ivy.with_backend(backend=fw) if f is None else f
sim = Simulator(interactive, try_use_sim)
lr = 0.05
num_anchors = 3
Expand Down Expand Up @@ -302,5 +301,4 @@ def main(interactive=True, try_use_sim=True, f=None, fw=None):
)
parsed_args = parser.parse_args()
fw = parsed_args.backend
f = None if fw is None else ivy.with_backend(backend=fw)
main(not parsed_args.non_interactive, not parsed_args.no_sim, f, fw)
main(not parsed_args.non_interactive, not parsed_args.no_sim, fw)
2 changes: 1 addition & 1 deletion ivy_robot_demos/interactive/manipulator_spline_planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@ def main(interactive=True, try_use_sim=True, f=None, fw=None):
parsed_args = parser.parse_args()
fw = parsed_args.backend
f = None if fw is None else ivy.with_backend(backend=fw)
main(not parsed_args.non_interactive, not parsed_args.no_sim, f, fw)
main(not parsed_args.non_interactive, not parsed_args.no_sim, fw)
2 changes: 1 addition & 1 deletion ivy_robot_demos/run_through.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,4 @@ def __init__(self, base_inv_ext_mat=None):
parsed_args = parser.parse_args()
fw = parsed_args.backend
f = None if fw is None else ivy.with_backend(backend=fw)
main(not parsed_args.non_interactive, f, fw)
main(not parsed_args.non_interactive, fw)
12 changes: 6 additions & 6 deletions ivy_robot_tests/test_ivy_robot_demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@
import pytest


def test_demo_run_through(dev_str, f, fw):
def test_demo_run_through(dev_str, fw):
from ivy_robot_demos.run_through import main

if fw in ["numpy", "tensorflow_graph"]:
# numpy does not support gradients,
# and the demo currently only supports eager mode
pytest.skip()
main(False, f, fw)
main(False, fw)


@pytest.mark.parametrize("with_sim", [False])
def test_demo_drone_spline_planning(with_sim, dev_str, f, fw):
def test_demo_drone_spline_planning(with_sim, dev_str, fw):
from ivy_robot_demos.interactive.drone_spline_planning import main

if fw in ["numpy", "tensorflow_graph"]:
# numpy does not support gradients,
# and the demo currently only supports eager mode
pytest.skip()
main(False, with_sim, f, fw)
main(False, with_sim, fw)


@pytest.mark.parametrize("with_sim", [False])
def test_demo_manipulator_spline_planning(with_sim, dev_str, f, fw):
def test_demo_manipulator_spline_planning(with_sim, dev_str, fw):
from ivy_robot_demos.interactive.manipulator_spline_planning import main

if fw in ["numpy", "tensorflow_graph"]:
# numpy does not support gradients,
# and the demo currently only supports eager mode
pytest.skip()
main(False, with_sim, f, fw)
main(False, with_sim, fw)

0 comments on commit 76b9e2f

Please sign in to comment.