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

OrbitalFactory('realhydrogen') broken #2419

Closed
greschd opened this issue Jan 23, 2019 · 4 comments · Fixed by #2737
Closed

OrbitalFactory('realhydrogen') broken #2419

greschd opened this issue Jan 23, 2019 · 4 comments · Fixed by #2737

Comments

@greschd
Copy link
Member

greschd commented Jan 23, 2019

version: 1.0.0a4

Since there is no 'realhydrogen' entry-point in the setup.py, the OrbitalFactory('realhydrogen') no longer works. Is this intentional or not?

@greschd
Copy link
Member Author

greschd commented Jan 23, 2019

The RealhydrogenOrbital class itself also doesn't seem to work (fresh virtualenv with only aiida-core==1.0.0a4 installed):

Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
Type "copyright", "credits" or "license" for more information.

IPython 5.8.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from aiida.common.orbital.realhydrogen import RealhydrogenOrbital

In [2]: RealhydrogenOrbital()
Out[2]: ---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/home/greschd/.virtualenvs/tmp-2ced87eca3e0a8aa/local/lib/python2.7/site-packages/IPython/core/formatters.pyc in __call__(self, obj)
    697                 type_pprinters=self.type_printers,
    698                 deferred_pprinters=self.deferred_printers)
--> 699             printer.pretty(obj)
    700             printer.flush()
    701             return stream.getvalue()

/home/greschd/.virtualenvs/tmp-2ced87eca3e0a8aa/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
    401                         if cls is not object \
    402                                 and callable(cls.__dict__.get('__repr__')):
--> 403                             return _repr_pprint(obj, self, cycle)
    404 
    405             return _default_pprint(obj, self, cycle)

/home/greschd/.virtualenvs/tmp-2ced87eca3e0a8aa/local/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)
    701     """A pprint that just redirects to the normal repr function."""
    702     # Find newlines and replace them with p.break_()
--> 703     output = repr(obj)
    704     for idx,output_line in enumerate(output.splitlines()):
    705         if idx:

/home/greschd/.virtualenvs/tmp-2ced87eca3e0a8aa/local/lib/python2.7/site-packages/aiida/common/orbital/__init__.pyc in __repr__(self)
     56 
     57     def __repr__(self):
---> 58         module_name = self.get_orbital_dict()['module_name']
     59         return '<{}: {}>'.format(module_name, str(self))
     60 

KeyError: 'module_name'

@DanielMarchand
Copy link
Contributor

DanielMarchand commented Apr 7, 2019

@greschd @giovannipizzi was this issue ever resolved? (in my personal alpha4 release this also fails). Are there other plugins that make use of OrbitalData? Maybe it would make sense to move this out of aiida_core and into wannier90

@giovannipizzi
Copy link
Member

The original aim was to have a generic class to manage orbitals.
Now, I don't know how many are actually using it... @vdikan, is siesta using this or not?
In any case, I wouldn't move it out for now, but instead move it with #2686 as already mentioned there.

On the other hand, the implementation is quite convoluted and untested. I am now refactoring a bit the code and will make a PR soon.

@vdikan
Copy link

vdikan commented Apr 10, 2019

No, at the moment we don't use it.

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 a pull request may close this issue.

4 participants