straditize.widgets.tutorial.beginner module¶
The tutorial of straditize
This module contains a guided tour to get started with straditize
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
|
Tutorial page to clean the diagram part |
|
The page for recognizing column names |
|
Tutorial page for the control |
|
The page for creating the reader |
|
The page for digitizing the diagram |
|
The last page of the tutorial |
|
TutorialPage for loading the straditizer image |
|
The page for finding and editing the samples |
|
TutorialPage for selecting the data part |
|
The page for separating the columns |
|
The tutorial page for translating the y-axis |
|
The tutorial page for translating the y-axis |
|
A tutorial for digitizing an area diagram |
|
A documentation viewer for the tutorial docs |
|
A widget for navigating through the tutorial. |
|
A base class for the tutorial pages |
-
class
straditize.widgets.tutorial.beginner.
CleanImagePage
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
Tutorial page to clean the diagram part
- Parameters
Methods
activate
()Method that is called, when the page is activated
Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
icon_to_bytes
(icon)skip
()Skip the steps in this page
Attributes
bool(x) -> bool
bool(x) -> bool
Boolean that is True, if the steps are all finished
-
btn_remove_xaxes_clicked
= False¶
-
btn_remove_yaxes_clicked
= False¶
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
class
straditize.widgets.tutorial.beginner.
ColumnNames
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
The page for recognizing column names
- Parameters
Methods
activate
()Method that is called, when the page is activated
Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
hint_for_wrong_name
(col, curr, ref)Display a hint if a name is not correctly set
skip
()Skip the steps in this page
Attributes
The column names in the diagram
Boolean that is True, if the steps are all finished
bool(x) -> bool
-
column_names
= ['Pinus', 'Juniperus', 'Quercus ilex-type', 'Chenopodiaceae']¶ The column names in the diagram
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
class
straditize.widgets.tutorial.beginner.
ControlIntro
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
Tutorial page for the control
- Parameters
Methods
activate
()Method that is called, when the page is activated
-
class
straditize.widgets.tutorial.beginner.
CreateReader
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
The page for creating the reader
- Parameters
Methods
hint
()A method that should display a hint to the user
skip
()Skip the steps in this page
Attributes
Boolean that is True, if the steps are all finished
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
class
straditize.widgets.tutorial.beginner.
DigitizePage
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
The page for digitizing the diagram
- Parameters
Methods
hint
()A method that should display a hint to the user
skip
()Skip the steps in this page
Attributes
Boolean that is True, if the steps are all finished
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
class
straditize.widgets.tutorial.beginner.
FinishPage
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
The last page of the tutorial
- Parameters
Methods
show
()Reimplemented to release the help explorer lock
-
class
straditize.widgets.tutorial.beginner.
LoadImage
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
TutorialPage for loading the straditizer image
- Parameters
Methods
activate
()Method that is called, when the page is activated
Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
skip
()Skip the steps in this page
Attributes
Boolean that is True, if the steps are all finished
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
class
straditize.widgets.tutorial.beginner.
SamplesPage
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
The page for finding and editing the samples
- Parameters
Methods
activate
()Method that is called, when the page is activated
Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
skip
()Skip the steps in this page
Attributes
bool(x) -> bool
Boolean that is True, if the steps are all finished
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
class
straditize.widgets.tutorial.beginner.
SelectDataPart
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
TutorialPage for selecting the data part
- Parameters
Methods
activate
()Method that is called, when the page is activated
check_mark
(mark)Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
is_valid_x
(x)is_valid_y
(y)skip
()Skip the steps in this page
Attributes
bool(x) -> bool
Boolean that is True, if the steps are all finished
Built-in mutable sequence.
The reference x- and y- limits
true if the data box should be removed at the end
Valid ranges for xmin and xmax
Valid ranges for ymin and ymax
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
marks
= []¶
-
ref_lims
= array([[ 258, 1803], [ 375, 1666]])¶ The reference x- and y- limits
-
remove_data_box
= True¶ true if the data box should be removed at the end
-
valid_xlims
= array([[ 221, 263], [1730, 1922]])¶ Valid ranges for xmin and xmax
-
valid_ylims
= array([[ 346, 403], [1648, 1701]])¶ Valid ranges for ymin and ymax
-
class
straditize.widgets.tutorial.beginner.
SeparateColumns
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
The page for separating the columns
- Parameters
Methods
activate
()Method that is called, when the page is activated
Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
skip
()Skip the steps in this page
Attributes
bool(x) -> bool
Boolean that is True, if the steps are all finished
int([x]) -> integer
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
ncols
= 4¶
-
class
straditize.widgets.tutorial.beginner.
TranslateXAxis
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
The tutorial page for translating the y-axis
- Parameters
Methods
activate
()Method that is called, when the page is activated
Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
skip
()Skip the steps in this page
Attributes
bool(x) -> bool
Boolean that is True, if the steps are all finished
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
class
straditize.widgets.tutorial.beginner.
TranslateYAxis
(filename, tutorial)[source]¶ Bases:
straditize.widgets.tutorial.beginner.TutorialPage
The tutorial page for translating the y-axis
- Parameters
Methods
activate
()Method that is called, when the page is activated
Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
skip
()Skip the steps in this page
Attributes
bool(x) -> bool
Boolean that is True, if the steps are all finished
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
class
straditize.widgets.tutorial.beginner.
Tutorial
(straditizer_widgets)[source]¶ Bases:
straditize.widgets.StraditizerControlBase
,straditize.widgets.tutorial.beginner.TutorialPage
A tutorial for digitizing an area diagram
Methods
close
()Close the tutorial and remove the widgets
display_hint
(i)Display the hint for a tutorial page
Get the rst files for the tutorial
goto_page
(old, new)Go to another page
refresh
()Refresh from the straditizer
Setup the
pages
attribute and initialize the tutorial pagesshow
()Show the documentation of the tutorial
skip_page
(i)Skip a tutorial page
validate_page
(i[, silent])Validate a tutorial page
Attributes
The current page of the tutorial (corresponding to the
The number of the page that loads the diagram image (i.e.
A
TutorialNavigation
to navigate through the tutorialA list of the
TutorialPages
for this tutorialA
TutorialDocs
to display the RST-files of the tutorial-
property
current_page
¶ The current page of the tutorial (corresponding to the
TutorialNavigation.current_step
)
-
get_doc_files
()[source]¶ Get the rst files for the tutorial
- Returns
str – The path to the tutorial introduction file
list of str – The paths of the remaining tutorial files
-
goto_page
(old, new)[source]¶ Go to another page
- Parameters
old (int) – The index of the old page in the
pages
attribute that is subject to be deactivated (seeTutorialPage.deactivate()
)new (int) – The index of the new page in the
pages
attribute that is subject to be activated (seeTutorialPage.activate()
)
-
property
load_image_step
¶ The number of the page that loads the diagram image (i.e. the index of the
LoadImage
instance in thepages
attribute
A
TutorialNavigation
to navigate through the tutorial
-
pages
= []¶ A list of the
TutorialPages
for this tutorial
-
tutorial_docs
= None¶ A
TutorialDocs
to display the RST-files of the tutorial
-
validate_page
(i, silent=False)[source]¶ Validate a tutorial page
- Parameters
silent (bool) – If True, and the page is not yet finished (see
TutorialPage.is_finished
), the hint is displayed
- Returns
True, if the page
is_finished
- Return type
-
property
-
class
straditize.widgets.tutorial.beginner.
TutorialDocs
(*args, **kwargs)[source]¶ Bases:
psyplot_gui.help_explorer.UrlHelp
,psyplot_gui.common.DockMixin
A documentation viewer for the tutorial docs
This viewer is accessible through the
Tutorial.tutorial_docs
attribute and shows thesrc_file
for the tutorialpages
Attributes
str(object=’’) -> str
-
dock_position
= 2¶
-
title
= 'Straditize tutorial'¶
-
Bases:
PyQt5.QtWidgets.QWidget
A widget for navigating through the tutorial. It has a button to go to the previous step and to go to the next step. Furthermore it has a progressbar implemented a hint button
- Parameters
validate (callable) – A callable that takes the
current_step
as an argument and returns abool
whether the current step is valid and finished, or not
Attributes
The current step in the tutorial
hint_requested
(*args, **kwargs)Signal that is emitted if the hint of the current step is requested
skipped
(*args, **kwargs)Signal that is emitted, if the step is skipped
step_changed
(*args, **kwargs)Signal that is emitted, when the step changes.
Methods
Trigger the
hint_requested
signal with the current stepIncrease the
current_step
by oneDecrease the
current_step
by oneEnable the buttons based on the
current_step
setEnabled
(enable)Enable or disable the navigation buttons
Change the
current_step
Trigger the
step_changed
signal with the current stepskip
()Skip the
current_step
and emit theskipped
signalThe current step in the tutorial
Trigger the
hint_requested
signal with the current step
Increase the
current_step
by one
Decrease the
current_step
by one
Signal that is emitted if the hint of the current step is requested
Enable the buttons based on the
current_step
Enable or disable the navigation buttons
- Parameters
enable (bool) – Whether to enable or disable the buttons
Change the
current_step
- Parameters
i (int) – The
current_step
to switch to
Trigger the
step_changed
signal with the current step
Skip the
current_step
and emit theskipped
signal
Signal that is emitted, if the step is skipped
Signal that is emitted, when the step changes. The first integer is the old step, the second one the current step
-
class
straditize.widgets.tutorial.beginner.
TutorialPage
(filename, tutorial)[source]¶ Bases:
object
A base class for the tutorial pages
Subclasses show implement the
show_hint()
method and theis_finished()
property- Parameters
Methods
activate
()Method that is called, when the page is activated
Method that is called, when the page is deactivated
hint
()A method that should display a hint to the user
lock_viewer
(lock)Set or unset the url lock of the HTML viewer
refresh
()show
()Show the page and browse the
filename
in the tutorial docsShow a hint to the user
show_tooltip_at_widget
(tooltip, widget[, …])Show a tooltip close to a widget
show_tooltip_in_plot
(tooltip, x, y[, …])Show a tooltip in the matplotlib figure at the given coordinates
skip
()Skip the steps in this page
Attributes
Boolean that is True, if the steps are all finished
True if the user clicked the btn_select_data button
The basename of the stratigraphic diagram image for this tutorial
The source directory for the docs
The complete path to the of the stratigraphic diagram image for this
-
property
is_finished
¶ Boolean that is True, if the steps are all finished
-
property
is_selecting
¶ True if the user clicked the btn_select_data button
-
show_tooltip_in_plot
(tooltip, x, y, timeout=20000, transform=None)[source]¶ Show a tooltip in the matplotlib figure at the given coordinates
- Parameters
tooltip (str) – The tooltip to display
x (float) – The x-coordinate of where to display the tooltip
y (float) – The y-coordinate of where to display the tooltip
timeout (int) – The time that the tool tip shall be displayed, in milliseconds
transform (matplotlib transformation) – The matplotlib transformation to use. If None, the
self.stradi.ax.transData
transformation is used and x and y are expected to be in data coordinates
-
src_base
= 'beginner-tutorial.png'¶ The basename of the stratigraphic diagram image for this tutorial
-
src_dir
= '/home/docs/checkouts/readthedocs.org/user_builds/straditize/checkouts/latest/straditize/widgets/tutorial/beginner'¶ The source directory for the docs
-
src_file
= '/home/docs/checkouts/readthedocs.org/user_builds/straditize/checkouts/latest/straditize/widgets/tutorial/beginner/beginner-tutorial.png'¶ The complete path to the of the stratigraphic diagram image for this tutorial