Skip to content

Commit

Permalink
Merge branch 'develop_v0.3.x' into solver_issue114_in_memory_represen…
Browse files Browse the repository at this point in the history
…tations

Add fix from #232, adds more assert statements for function argument types.

# Conflicts:
#	python/mmSolver/_api/solverstandard.py
  • Loading branch information
david-cattermole committed Jan 3, 2022
2 parents a2615da + 5a39fa0 commit af9d3b9
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion python/mmSolver/_api/solverstandard.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ def _compile_multi_root_frames(col,
solving, second Action is to validate the inputs given.
:rtype: (Action, Action or None)
"""
assert isinstance(root_iter_num, int)
assert isinstance(remove_unused_objects, bool)
assert isinstance(scene_graph_mode, int)
assert isinstance(withtest, bool)
assert isinstance(verbose, bool)

# Solve root frames.
for frm_list in batch_frame_list:
# Get root markers
Expand Down Expand Up @@ -297,6 +303,9 @@ def _compile_remove_inbetween_frames(attr_list,
Yields an Action and None, at each iteration.
:rtype: (Action, None)
"""
assert isinstance(withtest, bool)
assert isinstance(verbose, bool)

# Solve in-between frames
attr_names = [x.get_name() for x in attr_list]

Expand Down Expand Up @@ -390,6 +399,15 @@ def _compile_multi_inbetween_frames(col,
the second Action is for validation of inputs.
:rtype: (Action, Action)
"""
assert isinstance(global_solve, bool)
assert isinstance(eval_complex_graphs, bool)
assert isinstance(anim_iter_num, int)
assert isinstance(remove_unused_objects, bool)
assert isinstance(scene_graph_mode, int)
assert isinstance(precomputed_data, dict)
assert isinstance(withtest, bool)
assert isinstance(verbose, bool)

if global_solve is True:
# Do Global Solve with all frames.
sol = solverstep.SolverStep()
Expand Down Expand Up @@ -542,7 +560,7 @@ def _compile_multi_frame(col,
:param root_frame_strategy:
The strategy ordering of root frames and how to solve them.
Value must be one in ROOT_FRAME_STRATEGY_VALUE_LIST.
:type root_frame_strategy:
:type root_frame_strategy: ROOT_FRAME_STRATEGY_*
:param triangulate_bundles:
If True, unlocked bundles will be triangulated before being
Expand Down Expand Up @@ -577,6 +595,21 @@ def _compile_multi_frame(col,
the second Action is for validation of inputs.
:rtype: (Action, Action)
"""
assert isinstance(auto_attr_blocks, bool)
assert isinstance(block_iter_num, int)
assert isinstance(only_root_frames, bool)
assert isinstance(root_iter_num, int)
assert isinstance(anim_iter_num, int)
assert isinstance(global_solve, bool)
assert root_frame_strategy in const.ROOT_FRAME_STRATEGY_VALUE_LIST
assert isinstance(triangulate_bundles, bool)
assert isinstance(use_euler_filter, bool)
assert isinstance(remove_unused_objects, bool)
assert isinstance(scene_graph_mode, int)
assert isinstance(precomputed_data, dict)
assert isinstance(withtest, bool)
assert isinstance(verbose, bool)

# Get Frame numbers.
root_frame_list_num = [x.get_number() for x in root_frame_list]
frame_list_num = [x.get_number() for x in frame_list]
Expand Down Expand Up @@ -835,6 +868,15 @@ def _compile_single_frame(col,
the second Action is for validation of inputs.
:rtype: (Action, Action)
"""
assert isinstance(auto_attr_blocks, bool)
assert isinstance(block_iter_num, int)
assert isinstance(lineup_iter_num, int)
assert isinstance(remove_unused_objects, bool)
assert isinstance(scene_graph_mode, int)
assert isinstance(precomputed_data, dict)
assert isinstance(withtest, bool)
assert isinstance(verbose, bool)

if auto_attr_blocks is True:
meta_mkr_list, meta_attr_list = _split_mkr_attr_into_categories(
mkr_list,
Expand Down

0 comments on commit af9d3b9

Please sign in to comment.