From 2ebc6eded3bfe05fd58914a8d4d5407fdb1d41d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:16:43 -0700 Subject: [PATCH] Update black requirement from <=23.0,>=19.10b0 to >=19.10b0,<=24.8.0 in the pip group across 1 directory (#291) * Update black requirement in the pip group across 1 directory Updates the requirements on [black](https://github.com/psf/black) to permit the latest version. Updates `black` to 24.8.0 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/19.10b0...24.8.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development dependency-group: pip ... Signed-off-by: dependabot[bot] * fix lint error --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ruge Li --- cellpack/autopack/Analysis.py | 11 +++++++---- cellpack/autopack/DBRecipeHandler.py | 18 +++++++++--------- cellpack/autopack/Environment.py | 14 +++++++------- cellpack/autopack/GeometryTools.py | 7 +------ cellpack/autopack/Graphics.py | 6 +++--- cellpack/autopack/ingredient/single_cube.py | 4 +--- cellpack/autopack/ingredient/single_sphere.py | 5 ++++- .../autopack/interface_objects/partners.py | 8 +++++--- cellpack/autopack/loaders/recipe_loader.py | 6 +++--- cellpack/autopack/upy/colors.py | 1 + cellpack/autopack/upy/simularium/__init__.py | 1 + cellpack/autopack/writers/__init__.py | 8 ++++---- setup.py | 2 +- 13 files changed, 47 insertions(+), 44 deletions(-) diff --git a/cellpack/autopack/Analysis.py b/cellpack/autopack/Analysis.py index 5b88b335a..00b72e39c 100644 --- a/cellpack/autopack/Analysis.py +++ b/cellpack/autopack/Analysis.py @@ -755,7 +755,10 @@ 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], ) @@ -857,9 +860,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 08c12cc36..0f62e5d45 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 76ce34924..e6f4550ea 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 4817e20f5..08275b99c 100644 --- a/cellpack/autopack/GeometryTools.py +++ b/cellpack/autopack/GeometryTools.py @@ -165,12 +165,7 @@ 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 abec13189..6e0dbba65 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 c8612fd60..4b5c643c1 100644 --- a/cellpack/autopack/ingredient/single_cube.py +++ b/cellpack/autopack/ingredient/single_cube.py @@ -366,9 +366,7 @@ 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 d0e2b356c..5d13e956f 100644 --- a/cellpack/autopack/ingredient/single_sphere.py +++ b/cellpack/autopack/ingredient/single_sphere.py @@ -188,7 +188,10 @@ 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/interface_objects/partners.py b/cellpack/autopack/interface_objects/partners.py index 72cac5acf..514b82e11 100644 --- a/cellpack/autopack/interface_objects/partners.py +++ b/cellpack/autopack/interface_objects/partners.py @@ -60,9 +60,11 @@ def __init__(self, partners): partner["name"], partner["position"] if "position" in partner else [0, 0, 0], partner["weight"] if "weight" in partner else weight, - partner["binding_probability"] - if "binding_probability" in partner - else 1.0, + ( + partner["binding_probability"] + if "binding_probability" in partner + else 1.0 + ), ) self.all_partners.append(partner) diff --git a/cellpack/autopack/loaders/recipe_loader.py b/cellpack/autopack/loaders/recipe_loader.py index cf0be99b8..38efd9bc1 100644 --- a/cellpack/autopack/loaders/recipe_loader.py +++ b/cellpack/autopack/loaders/recipe_loader.py @@ -252,9 +252,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/upy/colors.py b/cellpack/autopack/upy/colors.py index 69d60b144..3fc2c5b31 100644 --- a/cellpack/autopack/upy/colors.py +++ b/cellpack/autopack/upy/colors.py @@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License along with upy. If not, see . """ + import numpy from math import floor diff --git a/cellpack/autopack/upy/simularium/__init__.py b/cellpack/autopack/upy/simularium/__init__.py index acafa855e..46a2d6008 100644 --- a/cellpack/autopack/upy/simularium/__init__.py +++ b/cellpack/autopack/upy/simularium/__init__.py @@ -16,5 +16,6 @@ You should have received a copy of the GNU General Public License along with upy. If not, see . """ + # CRITICAL_DEPENDENCIES = ['blender','c4d'] __revision__ = "01" diff --git a/cellpack/autopack/writers/__init__.py b/cellpack/autopack/writers/__init__.py index 5b439ecb7..f98a5c590 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" diff --git a/setup.py b/setup.py index 6e558fd18..885b41172 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ ] test_requirements = [ - "black>=19.10b0, <=23.0", + "black>=19.10b0, <=24.8.0", "flake8>=3.8.3, <=6.0.0", "flake8-debugger>=3.2.1", "pytest>=5.4.3",