Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions cellpack/autopack/Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
class Analysis:
def __init__(
self,
env: Environment,
env: Optional[Environment] = None,
packing_results_path: Optional[Union[Path, str]] = None,
output_path: Optional[Union[Path, str]] = None,
) -> None:
Expand All @@ -52,9 +52,7 @@ def __init__(
output_path
Path to the output folder for analysis results. If None, uses env.out_folder.
"""
self.env = None
if env:
self.env = env
self.env = env
self.center = [0, 0, 0]
self.plotly = PlotlyAnalysis()

Expand Down
12 changes: 6 additions & 6 deletions cellpack/autopack/DBRecipeHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ def replace_region_references(uploader, composition_data):
continue
for index, item in enumerate(composition_data["regions"][region_name]):
if isinstance(item, str):
composition_data["regions"][region_name][index] = (
uploader.comp_to_path_map.get(item)
)
composition_data["regions"][region_name][
index
] = uploader.comp_to_path_map.get(item)
elif isinstance(item, dict):
# process nested regions recursively
CompositionDoc.replace_region_references(uploader, item)
Expand Down Expand Up @@ -299,9 +299,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
12 changes: 7 additions & 5 deletions cellpack/autopack/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,7 @@ def getPointToDrop(
nbFreePoints: int,
distance: List[float],
spacing: float,
compId: int,
comp_ids: np.ndarray[int],
vRangeStart: float,
vThreshStart: float,
) -> Tuple[bool, Union[int, float]]:
Expand All @@ -2022,8 +2022,8 @@ def getPointToDrop(
Distance array
spacing
Grid spacing
compId
Compartment ID
comp_ids
Compartment IDs
vRangeStart
Range start value
vThreshStart
Expand All @@ -2039,7 +2039,7 @@ def getPointToDrop(
free_points,
nbFreePoints,
spacing,
compId,
comp_ids,
self.freePtsUpdateThreshold,
)

Expand Down Expand Up @@ -3530,7 +3530,9 @@ def getRotTransRB(self, node: Any) -> None:
"""
return None

def runBullet(self, ingr: Ingredient, simulationTimes: int, runTimeDisplay: bool) -> None:
def runBullet(
self, ingr: Ingredient, simulationTimes: int, runTimeDisplay: bool
) -> None:
"""
Run bullet physics simulation for an ingredient.

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
Loading
Loading