Пример #1
0
    def __init__(self, parent, mdf_file, **kwargs):
        KpointsPanel.__init__(self, parent, mdf_file.structure, mdf_file.qpoints)
        self.parent = parent
        self.mdf_file = mdf_file

        # Connect the events fired by klist_ctrl.
        self.klist_ctrl.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onQpointActivated)
Пример #2
0
    def __init__(self, parent, mdf_file, **kwargs):
        KpointsPanel.__init__(self, parent, mdf_file.structure, mdf_file.qpoints)
        self.parent = parent
        self.mdf_file = mdf_file

        # Connect the events fired by klist_ctrl.
        self.klist_ctrl.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onQpointActivated)
Пример #3
0
    def __init__(self, parent, gsr, **kwargs):
        """
        Args:
            parent:
                parent window.
            gsr:
                `GsrFile` instance.
        """
        super(GsrFileTab, self).__init__(parent, -1, **kwargs)
        self.gsr = gsr

        splitter = wx.SplitterWindow(self, id=-1, style=wx.SP_3D)
        splitter.SetSashGravity(0.95)

        self.kpoints_panel = KpointsPanel(splitter, gsr.structure, gsr.kpoints)

        # Add Python shell
        msg = "GSR_File object is accessible via the gsr variable. Use gsr.<TAB> to access the list of methods."
        msg = marquee(msg, width=len(msg) + 8, mark="#")
        msg = "#" * len(msg) + "\n" + msg + "\n" + "#" * len(msg) + "\n"

        pyshell = Shell(splitter, introText=msg, locals={"gsr": self.gsr})
        splitter.SplitHorizontally(self.kpoints_panel, pyshell)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(splitter, 1, wx.EXPAND, 5)
        self.SetSizerAndFit(sizer)
Пример #4
0
    def __init__(self, parent, phbst, **kwargs):
        """
        Args:
            parent:
                parent window.
            phbst:
                `PhbstFile` instance.
        """
        super(PhbstFileTab, self).__init__(parent, -1, **kwargs)
        self.phbst = phbst
        self.phdos_file = None

        splitter = wx.SplitterWindow(self, id=-1, style=wx.SP_3D)
        splitter.SetSashGravity(0.95)

        self.qpoints_panel = KpointsPanel(splitter, phbst.structure, phbst.qpoints)

        # Add Python shell
        msg = "PHBST_File object is accessible via the phbst variable. Use phbst.<TAB> to access the list of methods."
        msg = marquee(msg, width=len(msg) + 8, mark="#")
        msg = "#"*len(msg) + "\n" + msg + "\n" + "#"*len(msg) + "\n"

        pyshell = Shell(splitter, introText=msg, locals={"phbst": self.phbst})
        splitter.SplitHorizontally(self.qpoints_panel, pyshell)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(splitter, 1, wx.EXPAND, 5)
        self.SetSizerAndFit(sizer)
Пример #5
0
#!/usr/bin/env python
import wx

import abipy.data as abidata

from abipy.abilab import abiopen
from abipy.gui.kpoints import KpointsPanel

gsr = abiopen(abidata.ref_file("si_nscf_GSR.nc"))

app = wx.App()
frame = wx.Frame(None, -1)
KpointsPanel(frame, gsr.structure, gsr.kpoints)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
gsr.close()