forked from Deltares-research/PathwaysGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
251 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Examples | ||
======== | ||
Some of the examples use io.StringIO to be able to treat a string as a file. When using | ||
``ap_plot_graphs`` to plot graphs, the name of a file can be passed containing similar content | ||
as shown in the examples. | ||
|
||
This section contains examples for plotting graphs using the ``adaptation_pathways`` | ||
package. The same plots can be created by storing the information about the actions and sequences | ||
in a text- or binary-formatted dataset and using the ``ap_plot_graphs`` command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
foreach(name IN ITEMS index get_started) | ||
configure_file( | ||
${name}.rst | ||
${name}.rst | ||
COPYONLY | ||
foreach(name IN ITEMS | ||
generator.png | ||
generator.rst | ||
get_started.rst | ||
import_export.rst | ||
index.rst | ||
plot.rst | ||
) | ||
configure_file(${name} ${name} COPYONLY) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
Examples | ||
======== | ||
|
||
This section contains examples for plotting pathway maps using the ``adaptation_pathways`` | ||
package. The same plots can be created by storing the information about the actions and sequences | ||
in a text- or binary-formatted dataset and using the ``ap_plot_pathway_map`` command. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Pathway Generator | ||
================= | ||
See also: :mod:`adaptation_pathways.cli.pathway_generator` | ||
|
||
The package contains a GUI application called ``ap_pathway_generator``. It can be used to | ||
interactively create pathways and save the results to a (binary) file. | ||
|
||
.. note:: | ||
|
||
The pathway generator is a proof of concept application. It proofs that the pathway plots | ||
can be made part of an easy to install desktop application, made with Python. It is not | ||
finished and not fool-proof yet. There are many things not working correctly or still missing. | ||
|
||
Example for starting the application and initializing it with information from a text- or | ||
binary-formatted dataset called ``my_pathways``. | ||
|
||
.. code-block:: bash | ||
ap_pathway_generator my_pathways | ||
For help about the usage of the command type ``ap_pathway_generator --help``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
Import and export | ||
================= | ||
|
||
The package contains two utilities for translating information about the pathways from text | ||
formats to a binary format and back: ``ap_import`` and ``ap_export``. | ||
|
||
|
||
Text format | ||
----------- | ||
|
||
Information about pathways can be stored in two text files, named ``<basename>-action.txt`` | ||
and ``<basename>-sequence.txt``. The ``<basename>`` part can be replaced by any name that makes | ||
sense to you. | ||
|
||
``<basename>-action.txt`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
This file contains columns with information about the actions: | ||
|
||
- name: string without spaces | ||
- colour: Information about the RGBA values, in hexadecimal format | ||
|
||
Example:: | ||
|
||
current #ff4c566a | ||
a #ffbf616a | ||
b #ffd08770 | ||
c #ffebcb8b | ||
|
||
Actions can be defined in terms of other actions (action combinations). This may have an | ||
influence on how such actions are visualized. The format for that is: | ||
``action(other_action1 & other_action2)``. For example, in the previous example, an action | ||
combination ``d`` could be added as follows:: | ||
|
||
d(a & b) #ffa3be8c | ||
|
||
|
||
``<basename>-sequence.txt`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
This file contains columns with information about the sequences of actions that together make | ||
up pathways: | ||
|
||
- from-action name: name of action from ``<basename>-action.txt`` | ||
- to-action name: name of action from ``<basename>-action.txt`` | ||
- tipping point: integer ≥ 0 | ||
|
||
Example:: | ||
|
||
current current 2030 | ||
current a 2040 | ||
current b 2050 | ||
a c 2060 | ||
|
||
To differentiate the same action in different pathways, action editions can be used. The format | ||
for that is: ``action[edition]``. For example, in the previous example, action ``c`` can also | ||
be used as a continuation of the sequence ``current b`` as follows:: | ||
|
||
b c[2] 2070 | ||
|
||
|
||
Import from text format to binary format | ||
---------------------------------------- | ||
See also: :mod:`adaptation_pathways.cli.import_` | ||
|
||
Example for importing data from ``my_pathways-action.txt`` and ``my_pathways-sequence.txt`` to | ||
``my_pathways.apw``: | ||
|
||
.. code-block:: bash | ||
ap_import my_pathways my_pathways | ||
For help about the usage of the command type ``ap_import --help``. | ||
|
||
|
||
Export from binary format to text format | ||
---------------------------------------- | ||
See also: :mod:`adaptation_pathways.cli.export` | ||
|
||
Example for exporting data from ``my_pathways.apw`` to ``my_pathways-action.txt`` and | ||
``my_pathways-sequence.txt``: | ||
|
||
.. code-block:: bash | ||
ap_export my_pathways my_pathways | ||
For help about the usage of the command type ``ap_export --help``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Plotting pathways | ||
================= | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
Examples <example/index> | ||
|
||
|
||
The package contains two command-line applications. One is called ``ap_plot_graphs`` and can | ||
be used to gain insight into various kinds of graphs used to store information about pathways, | ||
and one is called ``ap_plot_pathway_map`` and can be used to visualize pathway maps in the | ||
so-called :const:`CLASSIC <adaptation_pathways.plot.util.PathwayMapLayout.CLASSIC>` layout. | ||
|
||
|
||
``ap_plot_graphs`` | ||
------------------ | ||
See also: | ||
:mod:`adaptation_pathways.cli.plot_graphs`, | ||
:class:`SequenceGraph <adaptation_pathways.graph.sequence_graph.SequenceGraph>`, | ||
:class:`PathwayGraph <adaptation_pathways.graph.pathway_graph.PathwayGraph>`, | ||
:class:`PathwayMap <adaptation_pathways.graph.pathway_map.PathwayMap>` | ||
|
||
This command takes information about pathways as input, and outputs a plot of the sequence | ||
graph, a plot of the pathway graph and a plot of the pathway map in :const:`DEFAULT | ||
<adaptation_pathways.plot.util.PathwayMapLayout.DEFAULT>` layout. | ||
|
||
Example for creating plots from ``my_pathways-action.txt`` and ``my_pathways-sequence.txt`` | ||
(or ``my_pathways.apw``) to ``./my_pathways-sequence_graph.pdf``, | ||
``./my_pathways-pathway_graph.pdf``, and ``./my_pathways-pathway_map.pdf``: | ||
|
||
.. code-block:: bash | ||
ap_plot_graphs my_pathways . | ||
For help about the usage of the command type ``ap_plot_graphs --help``. | ||
|
||
|
||
``ap_plot_pathway_map`` | ||
----------------------- | ||
See also: | ||
:mod:`adaptation_pathways.cli.plot_pathway_map`, | ||
:class:`PathwayMap <adaptation_pathways.graph.pathway_map.PathwayMap>` | ||
|
||
This command takes information about pathways as input, and outputs a single plot containing | ||
the pathway map in :const:`CLASSIC <adaptation_pathways.plot.util.PathwayMapLayout.CLASSIC>` | ||
layout. | ||
|
||
Example for creating a plot from ``my_pathways-action.txt`` and ``my_pathways-sequence.txt`` | ||
(or ``my_pathways.apw``) to ``./my_pathways.pdf``: | ||
|
||
.. code-block:: bash | ||
ap_plot_pathway_map my_pathways my_pathways.pdf | ||
For help about the usage of the command type ``ap_plot_pathway_map --help``. |
File renamed without changes.
Oops, something went wrong.