Skip to content

Commit

Permalink
adapted docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benmaier committed May 23, 2019
1 parent e3826ea commit 7bf2982
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 26 deletions.
Binary file added docs/dev_notes/img/test_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/dev_notes/img/test_matplotlib.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 30 additions & 1 deletion docs/dev_notes/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,19 @@ with an output looking like this

.. code:: bash
PLACEHOLDER
---------- coverage: platform darwin, python 3.7.3-final-0 -----------
Name Stmts Miss Cover
-----------------------------------------------
netwulf/__init__.py 4 0 100%
netwulf/interactive.py 154 24 84%
netwulf/metadata.py 9 0 100%
netwulf/tests/__init__.py 1 0 100%
netwulf/tests/test_all.py 70 2 97%
netwulf/tools.py 92 1 99%
-----------------------------------------------
TOTAL 330 27 92%
================ 5 passed, 4 warnings in 58.81 seconds ================
If you open a pull request, make sure you ran the tests and copy the test report
as a comment with your pull request like so
Expand Down Expand Up @@ -61,6 +73,23 @@ A browser window will be opened with a visualization looking like this.

It will close automatically.

Config
~~~~~~~

The config test starts a visualization with a configuration where each entry differs from its default value.

.. code:: python
T.test_config_adaption()
A browser window will be opened with a visualization looking like this.

.. figure:: img/test_config.png

Posting test

It will close automatically. The test checks wether the returned configuration is equal to the posted configuration.

Reproducibility
~~~~~~~~~~~~~~~

Expand Down
29 changes: 15 additions & 14 deletions docs/python_api/post_back.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,33 @@ which was used to generate this figure will resemble
default_config = {
# Input/output
'zoom': 1.5,
'zoom': 1,
# Physics
'node_charge': -30,
'node_charge': -45,
'node_gravity': 0.1,
'link_distance': 10,
'node_collision': False,
'link_distance': 15,
'link_distance_variation': 0,
'node_collision': True,
'wiggle_nodes': False,
'freeze_nodes': False,
# Nodes
'node_fill_color': '#16a085',
'node_stroke_color': '#000000',
'node_fill_color': '#79aaa0',
'node_stroke_color': '#555555',
'node_label_color': '#000000',
'display_node_labels': False,
'scale_node_size_by_strength': False,
'node_size': 10,
'node_stroke_width': 0.5,
'node_size_unevenness': 0.5,
'node_size': 5,
'node_stroke_width': 1,
'node_size_variation': 0.5,
# Links
'link_color': '#7c7c7c',
'link_width': 5,
'link_width': 2,
'link_alpha': 0.5,
'link_width_unevenness': 0.5,
'link_width_variation': 0.5,
# Thresholding
'display_singleton_nodes': False,
'min_link_weight_percentage': 0,
'max_link_weight_percentage': 100
'display_singleton_nodes': True,
'min_link_weight_percentile': 0,
'max_link_weight_percentile': 1
}
If the visualization was started from a Jupyter notebook, a picture of the stylized
Expand Down
22 changes: 11 additions & 11 deletions netwulf/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,35 +196,35 @@ def visualize(network,
default_config = {
# Input/output
'zoom': 1.5,
'zoom': 1,
# Physics
'node_charge': -30,
'node_charge': -45,
'node_gravity': 0.1,
'link_distance': 10,
'link_distance': 15,
'link_distance_variation': 0,
'node_collision': False,
'node_collision': True,
'wiggle_nodes': False,
'freeze_nodes': False,
# Nodes
'node_fill_color': '#16a085',
'node_stroke_color': '#000000',
'node_fill_color': '#79aaa0',
'node_stroke_color': '#555555',
'node_label_color': '#000000',
'display_node_labels': False,
'scale_node_size_by_strength': False,
'node_size': 10,
'node_stroke_width': 0.5,
'node_size': 5,
'node_stroke_width': 1,
'node_size_variation': 0.5,
# Links
'link_color': '#7c7c7c',
'link_width': 5,
'link_width': 2,
'link_alpha': 0.5,
'link_width_variation': 0.5,
# Thresholding
'display_singleton_nodes': False,
'display_singleton_nodes': True,
'min_link_weight_percentile': 0,
'max_link_weight_percentile': 1
}
plot_in_cell_below : bool, default : True
When started from a Jupyter notebook, this will show a
reproduced matplotlib figure of the stylized network
in a cell below. Only works if ``verbose = False``.
Expand Down

0 comments on commit 7bf2982

Please sign in to comment.