Skip to content

Fix some typos, add codespell workflow to ensure no more typos sneak in #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = .git,js
# ignore-words-list =
19 changes: 19 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Codespell
uses: codespell-project/actions-codespell@v1
2 changes: 1 addition & 1 deletion docs/dev_notes/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ A browser window will be opened with a visualization looking like this.

Posting test

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

Reproducibility
~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion docs/visualization/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Other physics parameters are:

* *Link distance variation*. Shortens the optimal distance of strong links. This is mostly useful in sparse networks as the link strengths in dense networks are small. Works well when link distance is large.
* *Collision*: Implemented with `d3.forceCollide <https://github.com/d3/d3-force#forceCollide>`_ with default strength (0.7) and makes overlapping nodes more unlikely.
* *Wiggle*: Sets the simulation *alphaTarget* to 1, causing nodes to move more freely. Useful for "wiggling" nodes out of place if the layout seems stuck in a local minumum.
* *Wiggle*: Sets the simulation *alphaTarget* to 1, causing nodes to move more freely. Useful for "wiggling" nodes out of place if the layout seems stuck in a local minimum.
* *Freeze*: Stops the force simulation. The simulation is restarted when this is untoggled. When the network nodes have initial positions (given as node-attributes "x" and "y"), "Freeze" is enabled at launch, so that the initial positions are respected.


Expand Down
6 changes: 3 additions & 3 deletions netwulf/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Test(unittest.TestCase):
maxDiff = None

def test_posting(self):
"""Test whether results are sucessfully posted to Python."""
"""Test whether results are successfully posted to Python."""
G = _get_test_network()
visualize(G,is_test=True,config=_get_test_config())

Expand All @@ -58,15 +58,15 @@ def test_reproducibility(self):
newprops, newconfig = visualize(G, config=config,is_test=True)

# test if node positions are close within 1% and subsequently
# round all positional values to the 2nd positon (e.g. 451 => 450)
# round all positional values to the 2nd position (e.g. 451 => 450)
_assert_positions_within_one_percent(props,newprops)
_drastically_round_positions(props)
_drastically_round_positions(newprops)

# the second visualization should have frozen the nodes
assert(newconfig['freeze_nodes'])

# change it so the dictionary-equal-assertion doesnt fail
# change it so the dictionary-equal-assertion doesn't fail
newconfig['freeze_nodes'] = False

self.assertDictEqual(props, newprops)
Expand Down
2 changes: 1 addition & 1 deletion netwulf/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def bind_properties_to_network(network,
>>> props, _ = netwulf.visualize(G)
>>> netwulf.bind_properties_to_network(G, props)
"""
# Add individial node attributes
# Add individual node attributes
if bind_node_positions:
x = { node['id']: node['x'] for node in network_properties['nodes'] }
y = { node['id']: node['y'] for node in network_properties['nodes'] }
Expand Down