GrossfieldLab / loos

LOOS: a lightweight object-oriented structure analysis library
http://grossfieldlab.github.io/loos/
GNU General Public License v3.0
121 stars 26 forks source link

issues with cylindrical-density #20

Closed VBurns closed 4 years ago

VBurns commented 4 years ago

I've been trying to use cylindrical-density.py and i keep getting with error:

cylindrical-density.py foo.prmtop foo-centered.mdcrd 'name == "CA"' 'resname == "PC" || resname == "PA" || resname == "OL"' -25 25 50 10 30 20

/usr/local/bin/cylindrical-density.py foo.prmtop foo-centered.mdcrd name == "CA" resname == "PC" || resname == "PA" || resname == "OL" -25 25 50 10 30 20

Traceback (most recent call last): File "/usr/local/bin/cylindrical-density.py", line 106, in hist[rbin, zbin] += 1.0 IndexError: index 50 is out of bounds for axis 1 with size 50

LOOS has been set up with python3, so i know it's not the python version. I don't know where the problem is.

agrossfield commented 4 years ago

That certainly looks like a bug, and not in any way your fault. I'll take a look at it today

agrossfield commented 4 years ago

I think I fixed it -- unlucky roundoff. Can you check out the fix-cyl-density branch and see if it fixes it for you?

If you don't want to do that, you can edit cylindrical-density.py (or copy it and edit the new version), so that the offending line (line 106) is replaced by this:

if (0 <= rbin < rnum_bins) and (0 <= zbin < znum_bins): hist[rbin, zbin] += 1.0

Let me know, so I can merge and close the issue if this is it (or delve deeper if it isn't).

Alan

VBurns commented 4 years ago

It's works. Thank you so much Alan!

agrossfield commented 4 years ago

Awesome. I’ll merge it tonight.

Alan


Dr. Alan Grossfield Associate Professor Department of Biochemistry and Biophysics University of Rochester Medical Center 610 Elmwood Ave, Box 712 Rochester, NY 14642 Phone: 585 276 4193 http://membrane.urmc.rochester.edu https://orcid.org/0000-0002-5877-2789

On Oct 24, 2019, at 4:41 PM, VBurns notifications@github.com<mailto:notifications@github.com> wrote:

It's works. Thank you so much Alan!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_GrossfieldLab_loos_issues_20-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DADH754QF2FI2ZHQV6JZQFGLQQICATA5CNFSM4JEVAQU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECGLX7Q-23issuecomment-2D546094078&d=DwMCaQ&c=4sF48jRmVAe_CH-k9mXYXEGfSnM3bY53YSKuLUQRxhA&r=49qnaP-kgQR_zujl5kbj_PmvQeXyz1NAoiLoIzsc27zuRX32UDM2oX8NQCaAsZzH&m=8jJYIDShil5OiU7L0u0h_K8oHmYn1Csm2pKAPzO9mLw&s=pNsFKIWO5iaBsBNVQQwVfdJP7dBGbQo1oedFBJZHSxw&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADH754R5IUVXYTNURFJXNATQQICATANCNFSM4JEVAQUQ&d=DwMCaQ&c=4sF48jRmVAe_CH-k9mXYXEGfSnM3bY53YSKuLUQRxhA&r=49qnaP-kgQR_zujl5kbj_PmvQeXyz1NAoiLoIzsc27zuRX32UDM2oX8NQCaAsZzH&m=8jJYIDShil5OiU7L0u0h_K8oHmYn1Csm2pKAPzO9mLw&s=M42cDcghc0rny24NZZfrn-ymsmkaCHpylDRWvbJ2aMQ&e=.

agrossfield commented 4 years ago

Fix is merged in