Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix adp matrix #1872

Merged
merged 1 commit into from
Jun 29, 2024
Merged

fix adp matrix #1872

merged 1 commit into from
Jun 29, 2024

Conversation

jamesmkrieger
Copy link
Contributor

Fixes this error, picked up building the website

In [1]:        from prody import *
   ...:        protein = parsePDB('1ejg')
   ...:        calphas = protein.select('calpha')
   ...:        adp_matrix = buildADPMatrix(calphas)
@> Connecting wwPDB FTP server RCSB PDB (USA).
@> 1ejg downloaded (1ejg.pdb.gz)
@> PDB download via FTP completed (1 downloaded, 0 failed).
@> 637 atoms and 1 coordinate set(s) were parsed in 0.01s.
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[1], line 4
      2 protein = parsePDB('1ejg')
      3 calphas = protein.select('calpha')
----> 4 adp_matrix = buildADPMatrix(calphas)

File ~/code/ProDy/prody/measure/measure.py:814, in buildADPMatrix(atoms)
    812     element[0, 2] = element[2, 0] = anisou[4]
    813     element[1, 2] = element[2, 1] = anisou[5]
--> 814     adp[i*3:i*3, i*3:i*3] = element
    815 return adp

ValueError: could not broadcast input array from shape (3,3) into shape (0,0)

@jamesmkrieger
Copy link
Contributor Author

I guess this isn't essential as people don't use this function much as far as I'm aware, but if we can check it and merge it before the release that would be good.

@atbogetti
Copy link
Member

atbogetti commented Jun 17, 2024

@jamesmkrieger I can confirm this works. Somehow, the code giving the error runs just fine on 2.4.0 (the most recent conda release version), but not on the most recent Git version. In any case, your fix solves the issue.

What could have caused this to stop working in the first place?

@jamesmkrieger
Copy link
Contributor Author

I don’t know, but I’m glad it works.

Maybe it’s something to do with dimensions of one of the arrays in the input or one of the intermediate steps?

@jamesmkrieger jamesmkrieger merged commit ed88515 into prody:main Jun 29, 2024
5 checks passed
@jamesmkrieger jamesmkrieger deleted the adp_matrix branch June 29, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants