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

Typerror when running RMSD #4

Open
ignaciomigliaro opened this issue Sep 28, 2023 · 1 comment
Open

Typerror when running RMSD #4

ignaciomigliaro opened this issue Sep 28, 2023 · 1 comment

Comments

@ignaciomigliaro
Copy link

Hi, great software, I have been trying to run the RMSD and get the visualiation , except when I try to run the calc_struct funciton, it gives the following error.


TypeError Traceback (most recent call last)
Cell In[69], line 12
9 struct_dict = read(file_path)
10 oc = OverlappingClusters(dpa=dpa, interactive=interactive)
---> 12 rmsd.calc_struct(struct_dict["3ddf4a302a"], struct_dict["8aeae1272d"])
13 oc.calc_struct(rmsd.overlapping_clusters)
14 oc.write("RMSD_Images")

File ~/programs/mcse/mcse/crystals/rmsd.py:121, in RMSD.calc_struct(self, struct1, struct2, pre)
119 if not self.H:
120 keep_idx = np.where(self.struct1.elements != "H")
--> 121 self.struct1 = self.struct1.get_sub(keep_idx, lattice=True)
122 self.struct1.get_molecule_idx(**{'mult': 1.2, 'skin': 0.0, 'update': True})
123 struct1 = self.struct1

File ~/programs/mcse/mcse/core/structure.py:442, in Structure.get_sub(self, idx, lattice, struct_id, bonds)
438 if bonds:
439 ### Pre-fetch bonds for mol_idx such that they don't need to be
440 ### re-computed upon instantiation of structure class
441 self.get_bonds(**self.bonds_kw)
--> 442 full_sub_bonds = [self.bonds[x] for x in idx]
443 new_sub_bonds = []
444 lookup = {}

File ~/programs/mcse/mcse/core/structure.py:442, in (.0)
438 if bonds:
439 ### Pre-fetch bonds for mol_idx such that they don't need to be
440 ### re-computed upon instantiation of structure class
441 self.get_bonds(**self.bonds_kw)
--> 442 full_sub_bonds = [self.bonds[x] for x in idx]
443 new_sub_bonds = []
444 lookup = {}

TypeError: only integer scalar arrays can be converted to a scalar index

My code is an exact replica of the code from the tutorial.

@ankur56
Copy link

ankur56 commented Mar 15, 2024

I am getting the same error.

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

No branches or pull requests

2 participants