SSTMap icon indicating copy to clipboard operation
SSTMap copied to clipboard

Default arg for frame number to be analysed is zero: "ZeroDivisionError: float division by zero"

Open Pippetta87 opened this issue 2 years ago • 0 comments

Hi, I get an error "ZeroDivisionError: float division by zero" when I run on python console:

>>>gist=sm.GridWaterAnalysis("npt_nojump_protmasshoh.gro","md_0_10_protmass_hoh_nojump.xtc",supporting_file="topol_protmasshoh.top",ligand_file="docking/curcumin_bondnorot_model1.pdb",grid_dimensions=[40, 40, 40],prefix="cur")
>>> gist.calculate_grid_quantities()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myuser/micromamba/envs/sstmap_py36/lib/python3.6/site-packages/sstmap/utils.py", line 50, in function_timer
    result = function(*args, **kwargs)
  File "/home/myuser/micromamba/envs/sstmap_py36/lib/python3.6/site-packages/sstmap/grid_water_analysis.py", line 435, in calculate_grid_quantities
    print_progress_bar(0, self.num_frames)
  File "/home/myuser/micromamba/envs/sstmap_py36/lib/python3.6/site-packages/sstmap/utils.py", line 74, in print_progress_bar
    filled_len = int(round(bar_len * count / float(total)))
ZeroDivisionError: float division by zero

The defaul number of frames to be analysed should be all the frames?

Pippetta87 avatar Dec 14 '23 19:12 Pippetta87