Skip to content

Commit

Permalink
rename functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rugeli committed Sep 6, 2023
1 parent f4c78ae commit 1908692
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cellpack/autopack/DBRecipeHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ def _get_grad_and_obj(obj_data, obj_dict, grad_dict):
return obj_dict, grad_dict

@staticmethod
def _collect_and_sort_data(comp_data):
def collect_and_sort_data(comp_data):
"""
Collect all object and gradient info from the downloaded composition data
Return autopack object data dict and gradient data dict with name as key
Expand Down Expand Up @@ -658,7 +658,7 @@ def _collect_and_sort_data(comp_data):
return objects, gradients, composition

@staticmethod
def _compile_db_recipe_data(db_recipe_data, obj_dict, grad_dict, comp_dict):
def compile_db_recipe_data(db_recipe_data, obj_dict, grad_dict, comp_dict):
"""
Compile recipe data from db recipe data into a ready-to-pack structure
"""
Expand Down
4 changes: 2 additions & 2 deletions cellpack/autopack/loaders/recipe_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ def _migrate_version(self, old_recipe):
def _read(self):
new_values, database_name = autopack.load_file(self.file_path, cache="recipes")
if database_name == "firebase":
objects, gradients, composition = DBRecipeLoader._collect_and_sort_data(
objects, gradients, composition = DBRecipeLoader.collect_and_sort_data(
new_values["composition"]
)
new_values = DBRecipeLoader._compile_db_recipe_data(
new_values = DBRecipeLoader.compile_db_recipe_data(
new_values, objects, gradients, composition
)
recipe_data = RecipeLoader.default_values.copy()
Expand Down
4 changes: 2 additions & 2 deletions cellpack/tests/test_db_recipe_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_get_grad_and_obj():

@pytest.fixture
def sort_data_from_composition():
return DBRecipeLoader._collect_and_sort_data(
return DBRecipeLoader.collect_and_sort_data(
downloaded_data_from_firebase["composition"]
)

Expand All @@ -186,7 +186,7 @@ def test_collect_and_sort_data(sort_data_from_composition):

def test_compile_db_recipe_data(sort_data_from_composition):
objects, gradients, composition = sort_data_from_composition
compiled_recipe = DBRecipeLoader._compile_db_recipe_data(
compiled_recipe = DBRecipeLoader.compile_db_recipe_data(
downloaded_data_from_firebase, objects, gradients, composition
)
assert compiled_recipe == compiled_firebase_recipe_example

0 comments on commit 1908692

Please sign in to comment.