diff --git a/cellpack/autopack/Analysis.py b/cellpack/autopack/Analysis.py index 00b72e39..5b88b335 100644 --- a/cellpack/autopack/Analysis.py +++ b/cellpack/autopack/Analysis.py @@ -755,10 +755,7 @@ def add_ingredient_positions_to_plot( ) # plot the sphere if ingr.use_rbsphere: - ( - ext_recipe, - pts, - ) = ingr.getInterpolatedSphere( + (ext_recipe, pts,) = ingr.getInterpolatedSphere( seed_ingredient_positions[-i - 1], seed_ingredient_positions[-i], ) @@ -860,9 +857,9 @@ def update_pairwise_distances( ingr.name, ingr2.name, ): - pairwise_distance_dict[seed_index][f"{ingr.name}_{ingr2.name}"] = ( - self.env.calc_pairwise_distances(ingr.name, ingr2.name).tolist() - ) + pairwise_distance_dict[seed_index][ + f"{ingr.name}_{ingr2.name}" + ] = self.env.calc_pairwise_distances(ingr.name, ingr2.name).tolist() return pairwise_distance_dict diff --git a/cellpack/autopack/DBRecipeHandler.py b/cellpack/autopack/DBRecipeHandler.py index 6f4df5a8..61c86745 100644 --- a/cellpack/autopack/DBRecipeHandler.py +++ b/cellpack/autopack/DBRecipeHandler.py @@ -201,13 +201,13 @@ def resolve_local_regions(self, local_data, recipe_data, db): if not DataDoc.is_key(key_or_dict): obj_item = local_data["regions"][region_name][index]["object"] if DataDoc.is_key(obj_item): - local_data["regions"][region_name][index]["object"] = ( - prep_recipe_data["objects"][obj_item] - ) + local_data["regions"][region_name][index][ + "object" + ] = prep_recipe_data["objects"][obj_item] else: - local_data["regions"][region_name][index]["object"] = ( - prep_recipe_data["objects"][obj_item["name"]] - ) + local_data["regions"][region_name][index][ + "object" + ] = prep_recipe_data["objects"][obj_item["name"]] # replace reference in obj with actual data obj_data = local_data["regions"][region_name][index]["object"] self.resolve_object_data(obj_data, prep_recipe_data) @@ -362,9 +362,9 @@ def convert_representation(doc, db): and doc_value["packing"] is not None ): position_value = doc_value["packing"]["positions"] - convert_doc["representations"]["packing"]["positions"] = ( - ObjectDoc.convert_positions_in_representation(position_value) - ) + convert_doc["representations"]["packing"][ + "positions" + ] = ObjectDoc.convert_positions_in_representation(position_value) return convert_doc @staticmethod diff --git a/cellpack/autopack/Environment.py b/cellpack/autopack/Environment.py index e6f4550e..76ce3492 100644 --- a/cellpack/autopack/Environment.py +++ b/cellpack/autopack/Environment.py @@ -628,10 +628,10 @@ def resolve_gradient_data_objects(self, gradient_data): """ # TODO: check if other modes need to be resolved if gradient_data["mode"] == "surface": - gradient_data["mode_settings"]["object"] = ( - self.get_compartment_object_by_name( - gradient_data["mode_settings"]["object"] - ) + gradient_data["mode_settings"][ + "object" + ] = self.get_compartment_object_by_name( + gradient_data["mode_settings"]["object"] ) return gradient_data @@ -2567,9 +2567,9 @@ def store_asJson(self, resultfilename=None, indent=True): if r: self.result_json["exteriorRecipe"] = OrderedDict() for ingr in r.ingredients: - self.result_json["exteriorRecipe"][ingr.composition_name] = ( - self.dropOneIngrJson(ingr, self.result_json["exteriorRecipe"]) - ) + self.result_json["exteriorRecipe"][ + ingr.composition_name + ] = self.dropOneIngrJson(ingr, self.result_json["exteriorRecipe"]) # compartment ingr for orga in self.compartments: diff --git a/cellpack/autopack/GeometryTools.py b/cellpack/autopack/GeometryTools.py index 08275b99..4817e20f 100644 --- a/cellpack/autopack/GeometryTools.py +++ b/cellpack/autopack/GeometryTools.py @@ -165,7 +165,12 @@ def region_2_integrand(self, theta, rho, d): def region_2(self, rho, d): # require scipy - i4 = d**3 / 6.0 * (rho**2 / d**2 - 1) * (pi / 4 - self.region_1_2_theta(rho, d)) + i4 = ( + d**3 + / 6.0 + * (rho**2 / d**2 - 1) + * (pi / 4 - self.region_1_2_theta(rho, d)) + ) i3 = ( d**2 * rho diff --git a/cellpack/autopack/Graphics.py b/cellpack/autopack/Graphics.py index 6e0dbba6..abec1318 100644 --- a/cellpack/autopack/Graphics.py +++ b/cellpack/autopack/Graphics.py @@ -1523,9 +1523,9 @@ def displayCompartmentsIngredients(self): elif self.vi.host == "dejavu": self.orgaToMasterGeom[ingr] = ingr.mesh elif self.vi.host == "softimage": - self.orgaToMasterGeom[ingr] = ( - ingr.mesh - ) # self.getMasterInstance(polygon) + self.orgaToMasterGeom[ + ingr + ] = ingr.mesh # self.getMasterInstance(polygon) # polygon already an instance from a different object\ j += 1 diff --git a/cellpack/autopack/ingredient/single_cube.py b/cellpack/autopack/ingredient/single_cube.py index 4b5c643c..c8612fd6 100644 --- a/cellpack/autopack/ingredient/single_cube.py +++ b/cellpack/autopack/ingredient/single_cube.py @@ -366,7 +366,9 @@ def cube_surface_distance( current_distance = numpy.sqrt(dist_x**2 + dist_y**2) else: # vertex is the closest - current_distance = numpy.sqrt(dist_x**2 + dist_y**2 + dist_z**2) + current_distance = numpy.sqrt( + dist_x**2 + dist_y**2 + dist_z**2 + ) return current_distance def get_signed_distance( diff --git a/cellpack/autopack/ingredient/single_sphere.py b/cellpack/autopack/ingredient/single_sphere.py index 5d13e956..d0e2b356 100644 --- a/cellpack/autopack/ingredient/single_sphere.py +++ b/cellpack/autopack/ingredient/single_sphere.py @@ -188,10 +188,7 @@ def collision_jitter( distance_to_packing_location - radius_of_ing_being_packed ) - ( - insidePoints, - newDistPoints, - ) = self.get_new_distances_and_inside_points( + (insidePoints, newDistPoints,) = self.get_new_distances_and_inside_points( env, jtrans, rotMat, diff --git a/cellpack/autopack/loaders/recipe_loader.py b/cellpack/autopack/loaders/recipe_loader.py index 6c2563a5..a9e32c0a 100644 --- a/cellpack/autopack/loaders/recipe_loader.py +++ b/cellpack/autopack/loaders/recipe_loader.py @@ -254,9 +254,9 @@ def _load_json(self): ): node = {"include": compartment["from"]} sub_recipe = self._request_sub_recipe(inode=node) - recipe_data["compartments"][compartment["from"]] = ( - sub_recipe["compartments"] - ) + recipe_data["compartments"][ + compartment["from"] + ] = sub_recipe["compartments"] continue compartment_dict = recipe_data["compartments"][cname] rep = None diff --git a/cellpack/autopack/writers/__init__.py b/cellpack/autopack/writers/__init__.py index f98a5c59..5b439ecb 100644 --- a/cellpack/autopack/writers/__init__.py +++ b/cellpack/autopack/writers/__init__.py @@ -292,10 +292,10 @@ def save_Mixed_asJson( "include": ing_filename, } else: - env.jsondic["cytoplasme"]["ingredients"][ingr.composition_name] = ( - io_ingr.ingrJsonNode( - ingr, result=result, kwds=kwds, transpose=transpose - ) + env.jsondic["cytoplasme"]["ingredients"][ + ingr.composition_name + ] = io_ingr.ingrJsonNode( + ingr, result=result, kwds=kwds, transpose=transpose ) # {"name":ingr.composition_name} env.jsondic["cytoplasme"]["ingredients"][ingr.composition_name][ "name"