Skip to content

Commit

Permalink
remove unused attributes from analysis class
Browse files Browse the repository at this point in the history
  • Loading branch information
mogres committed May 28, 2024
1 parent c78627f commit 22d453f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
23 changes: 1 addition & 22 deletions cellpack/autopack/Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from mdutils.mdutils import MdUtils

import cellpack.autopack as autopack
from cellpack.autopack.GeometryTools import GeometryTools
from cellpack.autopack.ldSequence import halton
from cellpack.autopack.plotly_result import PlotlyAnalysis
from cellpack.autopack.utils import check_paired_key, get_paired_key, get_seed_list
Expand All @@ -29,29 +28,13 @@ class Analysis:
def __init__(
self,
env=None,
viewer=None,
result_file=None,
packing_results_path=None,
output_path=None,
):
self.env = None
self.smallest = 99999.0
self.largest = 0.0
if env:
self.env = env
self.smallest = env.smallestProteinSize
self.largest = env.largestProteinSize
self.afviewer = viewer
self.helper = None
if viewer:
self.helper = self.afviewer.vi
self.result_file = result_file
self.center = [0, 0, 0]
self.bbox = [[0, 0, 0], [1, 1, 1]]
self.g = GeometryTools()
self.g.Resolution = 1.0 # or grid step?
self.current_pos = None
self.current_distance = None
self.plotly = PlotlyAnalysis()

if packing_results_path is not None:
Expand Down Expand Up @@ -995,11 +978,7 @@ def pack_one_seed(
"""
seed = int(seed_list[seed_index])
seed_basename = self.env.add_seed_number_to_base_name(seed)
# Clear
if self.afviewer:
self.afviewer.clearFill("Test_Spheres2D")
else:
self.env.reset()
self.env.reset()
self.env.saveResult = True
numpy.random.seed(seed)
self.build_grid()
Expand Down
3 changes: 0 additions & 3 deletions cellpack/bin/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ def pack(recipe, config_path=None, analysis_config_path=None):
env = Environment(config=packing_config_data, recipe=recipe_data)
env.helper = helper

afviewer = None
if (
packing_config_data["save_analyze_result"]
or packing_config_data["number_of_packings"] > 1
):
analyze = Analysis(
env=env,
viewer=afviewer,
result_file=None,
)
log.info(f"saving to {env.out_folder}")

Expand Down

0 comments on commit 22d453f

Please sign in to comment.