gsdview.traitsbase

Tool configuration utilities.

Functions

Trait(*value_type, **metadata) Creates a trait definition.
add_operation_to_map(_operation2cmdline_map, ...) Add a new entry into operation to commandline tool map
extract_operationinfos(...) Extract all infos from _operation2cmdline_map
gray(range, **traits) Generator function for the ‘gray’ colormap.

Classes

Any(**metadata[, default_value]) Defines a trait whose value can be anything.
ArrayPlotData(*data, **kw) A PlotData implementation class that handles a list of Numpy arrays
BaseFloat(**metadata[, default_value]) Defines a trait whose value must be a Python float.
BaseInt(**metadata[, default_value]) Defines a trait whose value must be a Python int.
BasePixelWin(*args, **kwargs)
BaseProjection Base class for Projections. It needs to be subclassed
BaseWin(*args, **kwargs) Base class for input parameters in image window selection.
Bool(**metadata[, default_value]) Defines a trait whose value must be a Python boolean using a C-level
ChacoSelectionTool(*args, **kw[, component])
ColorBar(*args, **kw) A color bar for a color-mapped plot.
ComponentEditor(*args, **traits) wxPython editor factory for Enable components.
CoorWin(*args, **kwargs) Trait component to select an area on image with geographic coordinate values.
CornerSizeCoorWin Trait component to select an area on image.
CornerSizePixelWin Trait component to select an area on image.
CornerSizeProjWin Trait component to select an area on image.
CornersCoorWin Trait component to select an area on image.
CornersPixelWin Trait component to select an area on image with row-column
CornersProjWin Trait component to select an area on image.
DataRange1D(*datasources, **kwtraits) Represents a 1-D data range.
DefaultDirectoryEditor Editor factory for directory editors.
DefaultFileEditor Editor factory for file editors.
Directory(**metadata[, value, auto_set, ...]) Defines a trait whose value must be the name of a directory using a
DirectoryEditor2(*args, **traits) Custom directory Editor Factory using SimpledirectoryEditor2
Enum(*args, **metadata) Defines a trait whose value must be one of a specified set of values
File(**metadata[, value, filter, auto_set, ...]) Defines a trait whose value must be the name of a file using a C-level
FileEditor2(*args, **traits) Custom File Editor Factory using SimpleFileEditor2
FileSelection
Float(**metadata[, default_value]) Defines a trait whose value must be a Python float using a C-level fast
Group(*values, **traits) Represents a grouping of items in a user interface view.
HGroup(*values, **traits) A group whose items are laid out horizontally.
HPlotContainer(*components, **traits) A plot container that stacks all of its components horizontally.
Handler Provides access to and control over the run-time workings of a
HasTraits Enables any Python class derived from it to have trait atttributes.
ImagePlot(**kwargs) A plot based on an image.
ImgSubwindow Trait component to select an area on image
InputComponent Input section component in tool configuration
Instance(**metadata[, klass, factory, args, ...]) Defines a trait whose value must be an instance of a specified class,
InstanceEditor Editor factory for instance editors.
Int(**metadata[, default_value]) Defines a trait whose value must be a Python int using a C-level fast
Item(**traits[, value]) An element in a Traits-based user interface.
LinearMapper Maps a 1-D data space to and from screen space by specifying a range in
List(**metadata[, trait, value, minlen, ...]) Defines a trait whose value must be a list whose items are of the
ModalWinHandler Use only with modal trait views.
MouseSubwindow() Trait component to select an area on image with mouse cursor
MultipleFile
NoLimitsZoomTool(*args, **kw[, component]) Chaco ZoomTool withouth limits to zoom factors
NonZeroPositiveFloat(**metadata[, default_value]) Float validated only when > 0
NonZeroPositiveInt(**metadata[, default_value]) Integer validated only when > 0
OddPositiveInt(**metadata[, default_value]) Integer validated only when >= 0 and odd
OptionalRange(object[, style])
OptionalTrait(object[, style]) Base Trait component to make an optional Trait Type GUI.
OutputComponent Output section component in tool configuration
PanTool(**kwtraits[, component]) A tool that enables the user to pan a plot by clicking a mouse
PixelWin(*args, **kwargs) Trait component to select an area on image.
Plot(**kwtraits[, data]) Represents a correlated set of data, renderers, and axes in a single screen region.
PositiveFloat(**metadata[, default_value]) Float validated only when >= 0
PositiveInt(**metadata[, default_value]) Integer validated only when >= 0
ProjWin(*args, **kwargs) Trait component to select an area on image.
Range(**metadata[, low, high, value, ...]) Defines a trait whose numeric value must be in a specified range using
RangeEditor Editor factory for range editors.
RectSize
SetEditor Editor factory for editors for sets.
SimpleQtDirectoryEditor Simple style of editor for directories, which displays a text field
SimpleQtFileEditor Simple style of file editor, consisting of a text field and a Browse
SpecificComponent Specific section component in tool configuration
Str(**metadata[, default_value]) Defines a trait whose value must be a Python string using a C-level
String(**metadata[, value, minlen, maxlen, ...]) Defines a trait whose value must be a Python string whose length is
ToolDescriptor(executable[, cwd, env, ...]) Command line tool desctiptor
TraitsDataset
TraitsToolDescriptor([executable, cwd, env, ...]) Tool configuration and cmdline building.
VGroup(*values, **traits) A group whose items are laid out vertically.
View(*values, **traits) A Traits-based user interface for one or more objects.
ZoomTool Selects a range along the index or value axis.
class gsdview.traitsbase.BasePixelWin(*args, **kwargs)
get2corners()
setvalues(rect_coords, check=False)
class gsdview.traitsbase.BaseProjection
Base class for Projections. It needs to be subclassed
class gsdview.traitsbase.BaseWin(*args, **kwargs)

Base class for input parameters in image window selection.

It’s intended to be subclassed for specific parameters (for example pixel, coordinates,...)

check_values()
extractargs()
setvalues(rect_coords, check=True)
class gsdview.traitsbase.CoorWin(*args, **kwargs)

Trait component to select an area on image with geographic coordinate values.

It is composed of other Trait components

setvalues(rect_coords, check=True)
class gsdview.traitsbase.CornerSizeCoorWin

Trait component to select an area on image.

It uses geographic coordinate values of a corner and rectangle size

check_values()
extractargs(parname='--projoff')

parname could be a string or a list or tuple of 4 elements.

It depends on if tool require the form ‘parameter_name parameter_values’ or 4 couples of ‘parameter_name parameter_value’

class gsdview.traitsbase.CornerSizePixelWin

Trait component to select an area on image.

It uses row-column values of a corner and rectangle size

check_values(xwinmax=None, ywinmax=None)
extractargs(xwinmax=None, ywinmax=None, parname='--srcwoff')

parname could be a string or a list or tuple of 4 elements.

It depends on if tool require the form ‘parameter_name parameter_values’ or 4 couples of ‘parameter_name parameter_value’

class gsdview.traitsbase.CornerSizeProjWin

Trait component to select an area on image.

It uses projected coordinate values of a corner and rectangle size

check_values()
extractargs(parname='--projoff')

parname could be a string or a list or tuple of 4 elements.

It depends on if tool require the form ‘parameter_name parameter_values’ or 4 couples of ‘parameter_name parameter_value’

class gsdview.traitsbase.CornersCoorWin

Trait component to select an area on image.

It uses geographic coordinate values of two corners

check_values()
extractargs(parname='--projwin')

parname could be a string or a list or tuple of 4 elements.

It depends on if tool require the form ‘parameter_name parameter_values’ or 4 couples of ‘parameter_name parameter_value’

class gsdview.traitsbase.CornersPixelWin

Trait component to select an area on image with row-column values of two corners.

check_values(xwinmax=None, ywinmax=None)
extractargs(xwinmax=None, ywinmax=None, parname='--srcwin')

parname could be a string or a list or tuple of 4 elements.

It depends on if tool require the form ‘parameter_name parameter_values’ or 4 couples of ‘parameter_name parameter_value’

class gsdview.traitsbase.CornersProjWin

Trait component to select an area on image.

It uses projected coordinate values of two corners

check_values()
extractargs(parname='--projwin')

parname could be a string or a list or tuple of 4 elements.

It depends on if tool require the form ‘parameter_name parameter_values’ or 4 couples of ‘parameter_name parameter_value’

class gsdview.traitsbase.DirectoryEditor2(*args, **traits)

Custom directory Editor Factory using SimpledirectoryEditor2

Add default_workdir option

class gsdview.traitsbase.FileEditor2(*args, **traits)

Custom File Editor Factory using SimpleFileEditor2

Return _SimpleFileEditor2 as ‘simple’ Factory to allow setting of starting QFileDialog directory and other customizations

class gsdview.traitsbase.FileSelection
class gsdview.traitsbase.ImgSubwindow

Trait component to select an area on image

check_values()
Call this function when ‘OK’ button is pressed on subwindow windows
extractargs(xwinmax=None, ywinmax=None)
class gsdview.traitsbase.InputComponent

Input section component in tool configuration

extractargs(xwinmax=None, ywinmax=None)
Return input section args for cmdline, except src_dataset
reset_traits(*args, **metadata)
Overrire standard method
setup(basefilename=None, datasetname=None, workdir='/home/valentino', findoverview_cb=None)
class gsdview.traitsbase.ModalWinHandler

Use only with modal trait views.

init(info)

Override standard method.

Useful to avoid resizable-modal windows are not hidden behind the MainWindow probably because of a Traits bug setting _StickyDialog flag to Qt.Window instead of Qt.Dialog.

class gsdview.traitsbase.MouseSubwindow

Trait component to select an area on image with mouse cursor

Add a custom implementation

extractargs(xwinmax=None, ywinmax=None)
selection_finished()
setup_overview(overview, realsizes=(None, None))
class gsdview.traitsbase.MultipleFile
class gsdview.traitsbase.NonZeroPositiveFloat(default_value=<enthought.traits.trait_handlers.NoDefaultSpecified object at 0x1c942d0>, **metadata)

Float validated only when > 0

validate(object, name, value)
class gsdview.traitsbase.NonZeroPositiveInt(default_value=<enthought.traits.trait_handlers.NoDefaultSpecified object at 0x1c942d0>, **metadata)

Integer validated only when > 0

validate(object, name, value)
class gsdview.traitsbase.OddPositiveInt(default_value=<enthought.traits.trait_handlers.NoDefaultSpecified object at 0x1c942d0>, **metadata)

Integer validated only when >= 0 and odd

validate(object, name, value)
class gsdview.traitsbase.OptionalRange(object, style='simple')
class gsdview.traitsbase.OptionalTrait(object, style='simple')

Base Trait component to make an optional Trait Type GUI.

To create an optional component use an Instance Trait with a Trait Type object.

For example:

optional_num = Instance(
        OptionalTrait,
        args=(Int(default_value=1, enter_set=True),) #warning "," mandatorily
        )

optional_instance = Instance(
    OptionalTrait,
    args=(
        Instance(D, (),
                editor=InstanceEditor(label='Interpolator')
            ), #warning "," mandatorily
    )
)
addvalue()
setvaluestyle(style)
Set value style.
trait_view(parent=None)
class gsdview.traitsbase.OutputComponent

Output section component in tool configuration

extractargs()
This method is intended to be overridden in subclasses
setup(base_src_filename=None, workdir='/home/valentino')
class gsdview.traitsbase.PixelWin(*args, **kwargs)

Trait component to select an area on image.

It uses row-column values. It is composed of other Trait components

extractargs(xwinmax, ywinmax)
Override base method to add x and y maximums
class gsdview.traitsbase.PositiveFloat(default_value=<enthought.traits.trait_handlers.NoDefaultSpecified object at 0x1c942d0>, **metadata)

Float validated only when >= 0

validate(object, name, value)
class gsdview.traitsbase.PositiveInt(default_value=<enthought.traits.trait_handlers.NoDefaultSpecified object at 0x1c942d0>, **metadata)

Integer validated only when >= 0

validate(object, name, value)
class gsdview.traitsbase.ProjWin(*args, **kwargs)

Trait component to select an area on image.

It uses projected coordinate values. It is composed of other Trait components

setvalues(rect_coords, check=True)
class gsdview.traitsbase.RectSize
class gsdview.traitsbase.SpecificComponent

Specific section component in tool configuration

Add a custom implementation for every tool.

extractargs()
This method is intended to be overridden in subclasses
setup(*args, **kwargs)
This method is intended to be overridden in subclasses
class gsdview.traitsbase.TraitsDataset
getdataset()
setdataset(fullname)
class gsdview.traitsbase.TraitsToolDescriptor(executable='', cwd=None, env=None, isextraenv=True, stdout_handler=None, stderr_handler=None, mainwin=None)

Tool configuration and cmdline building.

cmdline()
Return the command line
env
extractargs()
Return args for generic tool.
setup_tool(curr_datasetname, curr_basefilename=None, operation='', workdir='/home/valentino', findoverview_cb=None, area_selected=None)
Add specific setup to base method
update_src_win()
gsdview.traitsbase.add_operation_to_map(_operation2cmdline_map, menupos, tooldescriptor, icon=None, statustipstring=None, shortcut=None)

Add a new entry into operation to commandline tool map

Parameters :
  • _operation2cmdline_map: map to fill with new operation. It’s a dict such as:

    (menu position) -> (tooldescriptor, view, icon, statustipstring, shortcut)
  • menupos: operation position in menubar (with operation name too) used as key for _operation2cmdline_map. It is a tuple such as:

    (menu name, [(submenu names)], operation name)
  • tooldescriptor: Commandline tool descriptor

  • icon:

  • statustipstring:

  • shortcut:

gsdview.traitsbase.extract_operationinfos(_operation2cmdline_map, menupos)

Extract all infos from _operation2cmdline_map

Parameters :
  • _operation2cmdline_map: map to fill with new operation. It’s a dict such as:

    (menu position) -> (tooldescriptor, icon, statustipstring, shortcut)
  • menupos: operation position in menubar (with operation name too) used as key for _operation2cmdline_map. It is a tuple such as:

    (menu name, [(submenu names)], operation name)

Previous topic

gsdview.metadatamng

Next topic

gsdview.chacobase

This Page