straditize.widgets.progress_widget module

Progress widget for the straditization

The ProgressWidget defined here is a ListWidget to show the current state of the stradititization.

Disclaimer

Copyright (C) 2018-2019 Philipp S. Sommer

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Classes

ColumnNamesTask(parent)

Task to specify the column names

ColumnsTask(parent)

A task to separate columns

DataLimitsTask(parent)

The task to check the data limits

DataReaderTask(parent)

A task for initializing the reader

DigitizeTask(parent)

Task to digitize the data

ExportTask(parent)

Task to export the final results

InitStraditizerTask(parent)

The task to initialize a straditizer

OccurencesTask(parent)

Task to handle occurences

ProgressTask(parent)

The base class for an item that should be shown in the ProgressWidget

ProgressWidget(straditizer_widgets, item)

A widget to show the progress of the straditization

RemoveArtifactsTask(parent)

Task to clean the binary image

RemoveLinesTask(parent)

Task to remove y-axes, x-axes, horizontal and vertical lines

SamplesTask(parent)

Task to edit and find samples

SaveProjectTask(*args, **kwargs)

Task to remember saving the project

SelectExaggerationsTask(parent)

Task to handle exaggerations

XTranslationTask(parent)

Task to specify the x-axes conversion from pixel to data units

YTranslationTask(parent)

Task to specify the y-axis conversion from pixel to data units

class straditize.widgets.progress_widget.ColumnNamesTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to specify the column names

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['columns']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'column_names'
rst_file = 'column_names'
summary = 'Specify the column names'
task_tooltip = 'Click the <i>Edit column names</i> button to insert the names for each column/variable in the diagram'
class straditize.widgets.progress_widget.ColumnsTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

A task to separate columns

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['init_reader']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'columns'
rst_file = 'select_column_starts'
summary = 'Separate the columns'
task_tooltip = 'Separate the columns (subdiagrams) of the stratigraphic diagram'
class straditize.widgets.progress_widget.DataLimitsTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

The task to check the data limits

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['init_stradi']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'datalim'
rst_file = 'select_data_part'
summary = 'Limits of the diagram'
task_tooltip = 'Specify the corners for the data part of the diagram by clicking the <i>Select data part</i> button'
class straditize.widgets.progress_widget.DataReaderTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

A task for initializing the reader

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['datalim']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'init_reader'
rst_file = 'select_reader'
summary = 'Initialize the diagram reader'
task_tooltip = 'Choose the appropriate reader type and click the <i>Convert image</i> button'
class straditize.widgets.progress_widget.DigitizeTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to digitize the data

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['remove_artifacts', 'remove_lines']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'digitize'
rst_file = 'digitize'
summary = 'Digitize the diagram'
task_tooltip = 'Click the `Digitize` button to digitize the diagram'
class straditize.widgets.progress_widget.ExportTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to export the final results

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['samples']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'export'
rst_file = 'export'
summary = 'Export the final data'
task_tooltip = 'Export the final data'
class straditize.widgets.progress_widget.InitStraditizerTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

The task to initialize a straditizer

Parameters

parent (QListWidget) – The list that holds this item

Attributes

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'init_stradi'
rst_file = 'load_image'
summary = 'Load an image or project'
task_tooltip = 'Load a straditizer image or project to get started'
class straditize.widgets.progress_widget.OccurencesTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to handle occurences

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['columns']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'occurences'
rst_file = 'occurences'
summary = 'Select occurence markers'
task_tooltip = 'Pollen diagrams often have markers for low taxon percentages to show their occurence. Mark this task as done if your diagram does not have them.'
class straditize.widgets.progress_widget.ProgressTask(parent)[source]

Bases: PyQt5.QtWidgets.QListWidgetItem

The base class for an item that should be shown in the ProgressWidget

Parameters

parent (QListWidget) – The list that holds this item

Attributes

colnames_reader

The column names reader of the straditizer

data_reader

The data reader of the straditizer

dependencies

List of name attributes that this task is depending on

dependencies_tasks

done

True if is_finished or done_by_user

done_by_user

boolean that is True, when the task is marked as done by the user

done_tooltip

The tooltip when the straditizer is done.

is_finished

A property that is True, when the task is finished

is_ready

Boolean that is True if the task is ready to be solved

name

The name of the task

progress_widget

The progress widget that shows this task

rst_file

rst file that should be displayed on double click. The filename shuould

state

The state of the task

straditizer

The straditizer of the GUI

summary

The summary of the task that is shown in the progress widget

task_tooltip

The tooltip of the item

try_finished

Same as is_finished but catches every exception

Methods

refresh()

property colnames_reader

The column names reader of the straditizer

property data_reader

The data reader of the straditizer

dependencies = []

List of name attributes that this task is depending on

property dependencies_tasks
property done

True if is_finished or done_by_user

property done_by_user

boolean that is True, when the task is marked as done by the user

done_tooltip = None

The tooltip when the straditizer is done. If None, the task_tooltip is used

property is_finished

A property that is True, when the task is finished

is_ready = True

Boolean that is True if the task is ready to be solved

name = ''

The name of the task

property progress_widget

The progress widget that shows this task

refresh()[source]
rst_file = None

rst file that should be displayed on double click. The filename shuould be without .rst ending.

property state

The state of the task

property straditizer

The straditizer of the GUI

summary = ''

The summary of the task that is shown in the progress widget

task_tooltip = ''

The tooltip of the item

property try_finished

Same as is_finished but catches every exception

class straditize.widgets.progress_widget.ProgressWidget(straditizer_widgets, item)[source]

Bases: PyQt5.QtWidgets.QWidget, straditize.widgets.StraditizerControlBase

A widget to show the progress of the straditization

Attributes

combo_display

A QComboBox to select which tasks to display (todo, done, not yet ready

info_label

A QLabel to display the tooltip of the selected task

progress_list

A QListWidget to display the ProgressTask instances

Methods

contextMenuEvent(event)

Reimplement Qt method

populate_list()

Populate the progress_list

refresh()

Refresh from the straditizer

setup_menu()

Set up the context menu

show_rst(item[, old])

Show the documentation corresponding to a :class:`ProgressTask

toggle_done_by_user()

update_info_label(item[, old])

Update the info_label from a ProgressTask

combo_display = None

A QComboBox to select which tasks to display (todo, done, not yet ready or all tasks)

contextMenuEvent(event)[source]

Reimplement Qt method

info_label = None

A QLabel to display the tooltip of the selected task

populate_list()[source]

Populate the progress_list

This method adds instances of the ProgressTask class (or it’s subclasses) to the the progress_list

progress_list = None

A QListWidget to display the ProgressTask instances

refresh()[source]

Refresh from the straditizer

setup_menu()[source]

Set up the context menu

show_rst(item, old=None)[source]

Show the documentation corresponding to a :class:`ProgressTask

Parameters
toggle_done_by_user()[source]
update_info_label(item, old=None)[source]

Update the info_label from a ProgressTask

Parameters
  • item (ProgressTask) – The selected task whose tooltip the info_label shall display

  • old (ProgressTask) – The old task that has been selected previously (this parameter is ignored)

class straditize.widgets.progress_widget.RemoveArtifactsTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to clean the binary image

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['columns']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'remove_artifacts'
rst_file = 'removing_features'
summary = 'Clean the diagram image'
task_tooltip = 'Remove all artifacts in the diagram part that do not represent data. Mark this task as done when you are finished.'
class straditize.widgets.progress_widget.RemoveLinesTask(parent)[source]

Bases: straditize.widgets.progress_widget.RemoveArtifactsTask

Task to remove y-axes, x-axes, horizontal and vertical lines

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['columns']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'remove_lines'
rst_file = 'remove_lines'
summary = 'Remove y-, x-axes and other lines'
task_tooltip = 'In order to clean the diagram part, remove all vertical and horizontal lines in the reader image. Mark this task as done when you are finished.'
class straditize.widgets.progress_widget.SamplesTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to edit and find samples

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['digitize']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'samples'
rst_file = 'samples'
summary = 'Find and edit the samples'
task_tooltip = 'Find and edit the samples using the `Edit samples` menu'
class straditize.widgets.progress_widget.SaveProjectTask(*args, **kwargs)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to remember saving the project

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

is_finished

True if the project was saved less than 5 minutes ago

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

Methods

refresh_tooltip()

tooltip()

dependencies = ['init_stradi']
property is_finished

True if the project was saved less than 5 minutes ago

name = 'save_project'
refresh_tooltip()[source]
rst_file = 'save_and_load'
summary = 'Save the straditizer'
property task_tooltip

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

tooltip()[source]
class straditize.widgets.progress_widget.SelectExaggerationsTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to handle exaggerations

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['columns']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'exag'
rst_file = 'exaggerations'
summary = 'Select exagerations'
task_tooltip = 'Pollen diagrams often display an exaggerated value of of the taxon percentage. You can select these exaggerations using the <i>Exaggerations</i> menu. Mark this task as done if your diagram does not have them.'
class straditize.widgets.progress_widget.XTranslationTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to specify the x-axes conversion from pixel to data units

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['columns']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'xaxes_trans'
rst_file = 'xaxis_translation'
summary = 'Transform the x-axes'
property task_tooltip

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

class straditize.widgets.progress_widget.YTranslationTask(parent)[source]

Bases: straditize.widgets.progress_widget.ProgressTask

Task to specify the y-axis conversion from pixel to data units

Parameters

parent (QListWidget) – The list that holds this item

Attributes

dependencies

Built-in mutable sequence.

done_tooltip

is_finished

A property that is True, when the task is finished

name

str(object=’’) -> str

rst_file

str(object=’’) -> str

summary

str(object=’’) -> str

task_tooltip

str(object=’’) -> str

dependencies = ['init_reader']
property done_tooltip
property is_finished

A property that is True, when the task is finished

name = 'yaxis_trans'
rst_file = 'yaxis_translation'
summary = 'Transform the y-axis'
task_tooltip = 'Transform the y-axis from pixel to data units'