pren / poltype

POLTYPE: AMOEBA parametrization tool
https://pren.github.io/poltype
Other
4 stars 11 forks source link

Recent errors #15

Closed mquevill closed 4 years ago

mquevill commented 4 years ago

It appears that some recent changes may have introduced some errors in these scripts. I have been trying to run the Ammonia example in Examples/SymmetryAmmonia via

cd Examples/SymmetryAmmonia/
rm -r !(ammonia.sdf|poltype.ini) # remove everything except these files
python ../../PoltypeModules/poltype.py

With dontfrag=False, I get the following error:

Traceback (most recent call last):
  File "~/git/poltype/PoltypeModules/poltype.py", line 1078, in <module>
    params=poltype.main()
  File "~/git/poltype/PoltypeModules/poltype.py", line 846, in main
    params= self.GenerateParameters()
  File "~/git/poltype/PoltypeModules/poltype.py", line 1024, in GenerateParameters
    rotbndindextoparentindextofragindex,rotbndindextofragment,rotbndindextofragmentfilepath,equivalentfragmentsarray,equivalentrotbndindexarrays=frag.GenerateFragments(self,self.mol,torlist,WBOmatrix) # returns list of bond indexes that need parent molecule to do torsion scan for (fragment generated was same as the parent0
  File "~/git/poltype/PoltypeModules/fragmenter.py", line 794, in GenerateFragments
    equivalentrotbndindexes=GrabEquivalentRotBndIndexes(poltype,equivalentrotbndindexarrays,rotbndindex)
UnboundLocalError: local variable 'rotbndindex' referenced before assignment

With dontfrag=True, I get the following error:

Traceback (most recent call last):
  File "~/git/PoltypeModules/poltype.py", line 1078, in <module>
    params=poltype.main()
  File "~/git/PoltypeModules/poltype.py", line 846, in main
    params= self.GenerateParameters()
  File "~/git/PoltypeModules/poltype.py", line 1045, in GenerateParameters
    torfit.process_rot_bond_tors(self,optmol)
  File "~/git/poltype/PoltypeModules/torsionfit.py", line 1036, in process_rot_bond_tors
    mol,cls_mm_engy_dict,cls_qm_engy_dict,cls_angle_dict)
TypeError: cannot unpack non-iterable NoneType object

All cls_mm_engy_dict, cls_qm_engy_dict, and cls_angle_dict are {}.

Please let me know if there are additional files or information you might need.

misterbrandonwalker commented 4 years ago

Hey,

Please dont use the fragmenter right now, the bugs are still working out and I have not pushed latest versions nor tested on enough molecules. If you look at latest poltype on github default is dontfrag=True.

misterbrandonwalker commented 4 years ago

Okay something looks like is going wrong with torsion fitting. Can you please send me a onedrive link with all the files you used to run?

misterbrandonwalker commented 4 years ago

Oh you are using an example we already have, I will take a look

mquevill commented 4 years ago

Yeah, I just wanted to try both options, but it even breaks without using the fragmenter. I wanted a very simple test case, so I chose the included Ammonia example.

mquevill commented 4 years ago

There shouldn't be any torsions to calculate in NH3, though, right?

misterbrandonwalker commented 4 years ago

Okay the issue is more or less entering the torsionfitting function without torsions to fit. New version is fixed.

mquevill commented 4 years ago

It looks like an indentation issue that was introduced in eb0b94cface6d600d71d0a34c7abd111ead3055b. The return statement of fit_rot_bond_tors() was inside the for tor in poltype.torlist: loop. Unindenting it by one should allow for proper returning. (Oh the joys of whitespace-dependent languages!) https://github.com/pren/poltype/blob/1370038622322622fedd4b68f13e6e425c59f5e9/PoltypeModules/torsionfit.py#L805

misterbrandonwalker commented 4 years ago

oh geeze, thanks for catching that haha. I dont even remember touching that line. I must have yanked and also indented same time.

On Tue, May 12, 2020 at 3:49 PM Michael Quevillon notifications@github.com wrote:

It looks like an indentation issue that was introduced in eb0b94c https://github.com/pren/poltype/commit/eb0b94cface6d600d71d0a34c7abd111ead3055b. The return statement of fit_rot_bond_tors() was inside the for tor in poltype.torlist: loop. Unindenting it by one should allow for proper returning. (Oh the joys of whitespace-dependent languages!)

https://github.com/pren/poltype/blob/1370038622322622fedd4b68f13e6e425c59f5e9/PoltypeModules/torsionfit.py#L805

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/pren/poltype/issues/15#issuecomment-627585956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNB26LQ6JFUPDKFJFHXIIDRRGY5FANCNFSM4M7ED2NA .