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

IndexError in disconnectivity_graph.py", line 643 #175

Open
tessavdheiden opened this issue Jun 30, 2023 · 0 comments
Open

IndexError in disconnectivity_graph.py", line 643 #175

tessavdheiden opened this issue Jun 30, 2023 · 0 comments

Comments

@tessavdheiden
Copy link

Hey!

I'm eager to start working with the disconnectivity graphs.
I've created a minimal example, but I receive an error:
pele/utils/disconnectivity_graph.py", line 643, in __init__ self.gmin0 = elist[0][1] IndexError: list index out of range

Here's the example:

from pele.systems import BaseSystem
class MySystem(BaseSystem):
    def __init__(self, natoms):
        super(MySystem, self).__init__()
        self.natoms = natoms
        self.params.database.accuracy = 0.001

    def get_potential(self):
        return MyPot(self.natoms)

import numpy as np
natoms = 8
system = MySystem(natoms)
database = system.create_database()

from pele.utils.disconnectivity_graph import DisconnectivityGraph, database2graph
import matplotlib.pyplot as plt
#convert the database to a networkx graph
graph = database2graph(database)
dg = DisconnectivityGraph(graph, nlevels=3, center_gmin=True)
dg.calculate()
dg.plot()
plt.show()
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

1 participant