You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not enough to correctly import a set of k-points and bands into a BandsData object to be able to use it properly. If k-points labels are not specified - the bands object will complain:
/home/epfl/work/venv-lsmo/local/lib/python2.7/site-packages/aiida/orm/data/array/bands.py in _matplotlib_get_dict(self, main_file_name, comments, title, legend, legend2, y_max_lim, y_min_lim, y_origin, prettify_format, **kwargs)
805 labels = plot_info['labels']
806 # prepare xticks labels
--> 807 tick_pos, tick_labels = zip(*labels)
808
809 #all_data['bands'] = the_bands.tolist()
ValueError: need more than 0 values to unpack
if I add (at least one) labels: it works
In [9]: n.labels =[(0,'G')]
In [10]: n.show_mpl()
In [11]:
another problem occurs if one does not include the labels of the very first and very last k-point:
In [11]: n2.labels =[(10,'A'), (20, 'B')] # total number is 39
In [12]: n2.show_mpl()
In [13]:
as one can see in the figure below, the k-points 0-9 and 21-38 were cut:
And the last thing is the lack of documentation. Without help I would spend a lot more time trying to figure out the label-related logic.
Therefore the suggestions to improve would be:
- fix empty labels array bug
- fix problem with cutting k-points
- add documentation on how to create and visualize BandsData object
The text was updated successfully, but these errors were encountered:
fixes#2491
* fix problem with empty labels array
* Fix bands plotting
If the first and/or the last kpoint label does not point to the first and/or
the last kpoint - the plotted band structure was cut on the left and/or right
sides. To avoid this I add empty labels to the first and/or the last kpoints
if they are not labeled.
* Add documentation on how to use the BandsData object
It is not enough to correctly import a set of k-points and bands into a BandsData object to be able to use it properly. If k-points labels are not specified - the bands object will complain:
if I add (at least one) labels: it works
another problem occurs if one does not include the labels of the very first and very last k-point:
as one can see in the figure below, the k-points 0-9 and 21-38 were cut:
![bands](https://user-images.githubusercontent.com/13118485/52875720-533d0580-3155-11e9-9588-e1aad5ec7fd3.png)
And the last thing is the lack of documentation. Without help I would spend a lot more time trying to figure out the label-related logic.
Therefore the suggestions to improve would be:
The text was updated successfully, but these errors were encountered: