Core module for the psyplot graphical user interface
This module redefines the psyplot.project.Project
class with
additional features for an interactive usage with graphical qt user interface.
There is no need to import this module because the
GuiProject
class defined here replaces the project class in the
psyplot.project
module.
Classes:
|
Data:
The |
- class psyplot_gui.main.MainWindow(show=True)[source]
Bases:
QMainWindow
Methods:
about
()About the tool
change_cwd
(path)Change the current working directory
close
(self)closeEvent
(event)closeEvent reimplementation
edit_preferences
([exec_])Edit Spyder preferences
excepthook
(type, value, traceback)A method to replace the sys.excepthook
export_mp
(*args, **kwargs)export_sp
(*args, **kwargs)focus_on_console
(*args, **kwargs)Put focus on the ipython console
new_data_frame_editor
([df, title])Open a new dataframe editor
new_plots
([exec_])open_external_files
([fnames, project, ...])Open external files
open_files
(fnames)Open a file and ask the user how
open_mp
(*args, **kwargs)Open a new main project
open_sp
(*args, **kwargs)Open a subproject and add it to the current main project
register_shortcut
(action, shortcut[, context])Register an action for a shortcut
run
([fnames, project, engine, plot_method, ...])Create a mainwindow and open the given files or project
run_app
(*args, **kwargs)Create a QApplication, open the given files or project and enter the mainloop
save_mp
(*args, **kwargs)Save the current main project.
save_sp
(*args, **kwargs)Save the current sub project.
set_central_widget
(name)Set the central widget
Set up the default window layout
show_dependencies
([exec_])Open a dialog that shows the dependencies
This method listens to the open_files_port and opens the plot creator for new files
Attributes:
The key for the central widget for the main window in the
plugins
dictionaryInprocess console
The current keyboard shortcuts
the DataFrameEditor widgets
The keyboard shortcuts of the default layout
default widths of the dock widgets
The dockwidgets of this instance
tree widget displaying the open datasets
list of figures from the psyplot backend
tree widget displaying the open figures
general formatoptions widget
help explorer
The logger of this instance
open_external
(*args, **kwargs)A signal that is emmitted when the a signal is received through the open_files_server
The server to open external files
tab widget displaying the arrays in current main and sub project tree widget displaying the open datasets
- central_widget_key = 'console'
The key for the central widget for the main window in the
plugins
dictionary
- console = None
Inprocess console
- current_shortcuts = []
The current keyboard shortcuts
- dataframeeditors = None
the DataFrameEditor widgets
- default_shortcuts = []
The keyboard shortcuts of the default layout
- default_widths = {}
default widths of the dock widgets
- dockwidgets = []
The dockwidgets of this instance
- ds_tree = None
tree widget displaying the open datasets
- figures = []
list of figures from the psyplot backend
- figures_tree = None
tree widget displaying the open figures
- fmt_widget = None
general formatoptions widget
- help_explorer = None
help explorer
- property logger
The logger of this instance
- new_data_frame_editor(df=None, title='DataFrame Editor')[source]
Open a new dataframe editor
- Parameters:
df (pandas.DataFrame) – The dataframe to display
title (str) – The title of the dock window
- Returns:
The newly created editor
- Return type:
- open_external(*args, **kwargs)
A signal that is emmitted when the a signal is received through the open_files_server
- open_external_files(fnames=[], project=None, engine=None, plot_method=None, name=None, dims=None, encoding=None, enable_post=False, seaborn_style=None, concat_dim=None, chname={}, preset=None, decoder=None)[source]
Open external files
- Parameters:
fnames (list of str) – Either the filenames to show, or, if the project parameter is set, the a list of ,-separated filenames to make a mapping from the original filename to a new one
name (list of str) – The variable names to plot if the output parameter is set
dims (dict) – A mapping from coordinate names to integers if the project is not given
plot_method (str) – The name of the plot_method to use
project (str) – If set, the project located at the given file name is loaded
engine (str) – The engine to use for opening the dataset (see
psyplot.data.open_dataset()
)encoding (str) – The encoding to use for loading the project. If None, it is automatically determined by pickle. Note: Set this to
'latin1'
if using a project created with python2 on python3.enable_post (bool) – Enable the
post
processing formatoption. If True/set, post processing scripts are enabled in the given project. Only set this if you are sure that you can trust the given project file because it may be a security vulnerability.seaborn_style (str) – The name of the style of the seaborn package that can be used for the
seaborn.set_style()
functionconcat_dim (str) – The concatenation dimension if multiple files in fnames are provided
chname (dict) – A mapping from variable names in the project to variable names in the datasets that should be used instead
preset (str) – The filename or identifier of a preset. If the given preset is the path to an existing yaml file, it will be loaded. Otherwise we look up the preset in the psyplot configuration directory (see
get_configdir()
).decoder (str) – Keyword arguments for the decoder.
- open_files_server = None
The server to open external files
- project_content = None
tab widget displaying the arrays in current main and sub project tree widget displaying the open datasets
- classmethod run(fnames=[], project=None, engine=None, plot_method=None, name=None, dims=None, encoding=None, enable_post=False, seaborn_style=None, concat_dim=None, chname={}, preset=None, decoder=None, show=True)[source]
Create a mainwindow and open the given files or project
This class method creates a new mainwindow instance and sets the global
mainwindow
variable.- Parameters:
fnames (list of str) – Either the filenames to show, or, if the project parameter is set, the a list of ,-separated filenames to make a mapping from the original filename to a new one
name (list of str) – The variable names to plot if the output parameter is set
dims (dict) – A mapping from coordinate names to integers if the project is not given
plot_method (str) – The name of the plot_method to use
project (str) – If set, the project located at the given file name is loaded
engine (str) – The engine to use for opening the dataset (see
psyplot.data.open_dataset()
)encoding (str) – The encoding to use for loading the project. If None, it is automatically determined by pickle. Note: Set this to
'latin1'
if using a project created with python2 on python3.enable_post (bool) – Enable the
post
processing formatoption. If True/set, post processing scripts are enabled in the given project. Only set this if you are sure that you can trust the given project file because it may be a security vulnerability.seaborn_style (str) – The name of the style of the seaborn package that can be used for the
seaborn.set_style()
functionconcat_dim (str) – The concatenation dimension if multiple files in fnames are provided
chname (dict) – A mapping from variable names in the project to variable names in the datasets that should be used instead
preset (str) – The filename or identifier of a preset. If the given preset is the path to an existing yaml file, it will be loaded. Otherwise we look up the preset in the psyplot configuration directory (see
get_configdir()
).decoder (str) – Keyword arguments for the decoder.
show (bool) – If True, the created mainwindow is show
Notes
There can be only one mainwindow at the time
This method does not create a QApplication instance! See
run_app()
See also
- classmethod run_app(*args, **kwargs)[source]
Create a QApplication, open the given files or project and enter the mainloop
- Parameters:
fnames (list of str) – Either the filenames to show, or, if the project parameter is set, the a list of ,-separated filenames to make a mapping from the original filename to a new one
name (list of str) – The variable names to plot if the output parameter is set
dims (dict) – A mapping from coordinate names to integers if the project is not given
plot_method (str) – The name of the plot_method to use
project (str) – If set, the project located at the given file name is loaded
engine (str) – The engine to use for opening the dataset (see
psyplot.data.open_dataset()
)encoding (str) – The encoding to use for loading the project. If None, it is automatically determined by pickle. Note: Set this to
'latin1'
if using a project created with python2 on python3.enable_post (bool) – Enable the
post
processing formatoption. If True/set, post processing scripts are enabled in the given project. Only set this if you are sure that you can trust the given project file because it may be a security vulnerability.seaborn_style (str) – The name of the style of the seaborn package that can be used for the
seaborn.set_style()
functionconcat_dim (str) – The concatenation dimension if multiple files in fnames are provided
chname (dict) – A mapping from variable names in the project to variable names in the datasets that should be used instead
preset (str) – The filename or identifier of a preset. If the given preset is the path to an existing yaml file, it will be loaded. Otherwise we look up the preset in the psyplot configuration directory (see
get_configdir()
).decoder (str) – Keyword arguments for the decoder.
show (bool) – If True, the created mainwindow is show
See also
- set_central_widget(name)[source]
Set the central widget
- Parameters:
name (str or QWidget) – The key or the plugin widget in the
plugins
dictionary
- psyplot_gui.main.mainwindow = None
The
PyQt5.QtWidgets.QMainWindow
of the graphical user interface