Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rugeli committed Oct 25, 2024
1 parent 685d4ca commit 19d556c
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 39 deletions.
11 changes: 4 additions & 7 deletions cellpack/autopack/Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
)
Expand Down Expand Up @@ -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

Expand Down
18 changes: 9 additions & 9 deletions cellpack/autopack/DBRecipeHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions cellpack/autopack/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion cellpack/autopack/GeometryTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cellpack/autopack/Graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion cellpack/autopack/ingredient/single_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 1 addition & 4 deletions cellpack/autopack/ingredient/single_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions cellpack/autopack/loaders/recipe_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions cellpack/autopack/writers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 19d556c

Please sign in to comment.