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

error with kmos view command #58

Closed
Abel-Ding opened this issue Jul 20, 2017 · 2 comments
Closed

error with kmos view command #58

Abel-Ding opened this issue Jul 20, 2017 · 2 comments

Comments

@Abel-Ding
Copy link

Expected behavior

run thekMC model about CO adsorption and desorption according to the tutorials: A first kMC Model- the API way (http://kmos.readthedocs.io/en/latest/tutorials/index.html)

Actual behavior

I installed the kmos and the dependencies on ubuntu 16.04, and learn the tutorials "A first kMC Model-the API way"

while, after I export the xml, and try to view the model, it rised an TypeError, the error info is shown as followed:

abel@Abel:~/CL-SMR-KMC/kmos-learn/myfirst_kmc_local_smart$ kmos view
Traceback (most recent call last):
  File "/usr/local/bin/kmos", line 21, in <module>
    main()
  File "/home/abel/.local/lib/python2.7/site-packages/kmos/cli.py", line 426, in main
    view.main(steps_per_frame=options.steps_per_frame)
  File "/home/abel/.local/lib/python2.7/site-packages/kmos/view.py", line 452, in main
    viewer = KMC_Viewer(model, steps_per_frame=steps_per_frame)
  File "/home/abel/.local/lib/python2.7/site-packages/kmos/view.py", line 398, in __init__
    self.vbox, self.window)
  File "/home/abel/.local/lib/python2.7/site-packages/kmos/view.py", line 174, in __init__
    View.__init__(self, self.vbox, rotations)
TypeError: __init__() takes exactly 2 arguments (3 given)

It seems to be related to the ase.view, but I don't know how to deal with it.
How could I fix this problem? Did I do something wrong in installation?
Looking forward to your solution and suggestion.

//: # (Besides the text description, include any screenshot(s) that help us visualize the issue you're facing)

abel@Abel:~/CL-SMR-KMC/kmos-learn/myfirst_kmc_local_smart$ kmos view
Traceback (most recent call last):
  File "/usr/local/bin/kmos", line 21, in <module>
    main()
  File "/home/abel/.local/lib/python2.7/site-packages/kmos/cli.py", line 426, in main
    view.main(steps_per_frame=options.steps_per_frame)
  File "/home/abel/.local/lib/python2.7/site-packages/kmos/view.py", line 452, in main
    viewer = KMC_Viewer(model, steps_per_frame=steps_per_frame)
  File "/home/abel/.local/lib/python2.7/site-packages/kmos/view.py", line 398, in __init__
    self.vbox, self.window)
  File "/home/abel/.local/lib/python2.7/site-packages/kmos/view.py", line 174, in __init__
    View.__init__(self, self.vbox, rotations)
TypeError: __init__() takes exactly 2 arguments (3 given)

Steps to reproduce the issue

System information

  • result of kmos version, operating system, version, python version, possibly link to model file
gfortran version (4:5.3.1-1ubuntu1).
python-dev iversion (2.7.11-1).
python-glade2 version (2.24.0-4ubuntu1).
python-lxml version (3.5.0-1build1).
python-numpy version (1:1.11.0-1ubuntu1).
python-kiwi version (1.9.22-4).
python-matplotlib version (1.5.1-1ubuntu1).
python-pygoocanvas version (0.14.1-1.1ubuntu1).
gazpacho version (0.7.2-3).

abel@Abel:~/CL-SMR-KMC/kmos-learn/myfirst_kmc_local_smart$ ase info
platform        Linux-4.4.0-21-generic-x86_64-with-Ubuntu-16.04-xenial
python-2.7.12   /usr/bin/python
ase-3.15.0b1    /usr/local/lib/python2.7/dist-packages/ase-3.15.0b1-py2.7.egg/ase/
numpy-1.11.0    /usr/lib/python2.7/dist-packages/numpy/
scipy-0.17.0    /usr/lib/python2.7/dist-packages/scipy/
@jmlorenzi
Copy link
Contributor

I took a quick look and it looks like somewhere between ase version 3.12.0b1 (the one I happen to have in my workstation) and the current version, they changed the signature for ase.gui.view.View from

def __init__(self, vbox, rotations):
to
def __init__(self, rotations):

Sadly, I am not familiar with how this class works on ase and/or the significance of the vbox parameter for kmos. If you need to use the viewer as soon as possible, I would recommend reverting to and older ase version for now.

An alternative quick hack that could work, but is definitely not guarranteed to is to change
View.__init__(self, self.vbox, rotations)
to
View.__init__(self, rotations).
If you test this and works, you could then wrap this line in a try-except block, that calls the function without the vbox arguments in case of an exception.

However, I doubt this will work. I guess @mhoffman should be able to come up with an estimate on how difficult implementing support for this newer ase version would be.

Hope this helps,
Juan

@Abel-Ding
Copy link
Author

Thank you for your suggestion, I will try as you said and response to you as soon as possible.

Have a nice day,

DING Haoran

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