Skip to content

Commit

Permalink
comment out pylint until more progress is made on error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
aridyckovsky committed Feb 23, 2024
1 parent 59f31e5 commit ec15462
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 23 deletions.
27 changes: 14 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ repos:
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.10
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
src/
]
# - repo: local
# hooks:
# - id: pylint
# name: pylint
# entry: pylint
# language: system
# types: [python]
# args:
# [
# "--output-format=colorized",
# "-rn", # Only display messages
# #"-sn", # Don't display the score
# src/gentopo/topology/,
# ]
1 change: 0 additions & 1 deletion src/gentopo/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
invoke_without_command=True,
)
@click.version_option(version=__version__, prog_name="gentopo")
# @click.option("--db", "-d", envvar="WORDS_TUI_DB", default=Path.home() / ".words-tui.db", help="Database file to use")
def gentopo():
# TODO
# generate()
Expand Down
11 changes: 5 additions & 6 deletions src/gentopo/topology/families.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
families = Registry()


@families.register
@families.register # pylint: disable=E1101
def lattice(n: int, k: int) -> nx.Graph:
if k == n:
return nx.complete_graph(n)
Expand All @@ -22,7 +22,7 @@ def lattice(n: int, k: int) -> nx.Graph:
return G


@families.register
@families.register # pylint: disable=E1101
def small_world(n: int, k: int, p: float, rounds: int) -> nx.Graph:
"""
Generates a connected small world network with n nodes.
Expand All @@ -48,13 +48,12 @@ def small_world(n: int, k: int, p: float, rounds: int) -> nx.Graph:
# skip if w has as many edges as possible rounds
if G.degree(w) >= rounds:
continue
else:
G.remove_edge(u, v)
G.add_edge(u, w)
G.remove_edge(u, v)
G.add_edge(u, w)
return G


@families.register
@families.register # pylint: disable=E1101
def connected_small_world(n: int, k: int, p: float, rounds: int, tries: int = 100):
for i in range(tries):
G = families.small_world(n, k, p, rounds)
Expand Down
6 changes: 4 additions & 2 deletions src/gentopo/topology/generate.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
"""
generate.py
"""

from gentopo.topology.validate_config import validate_config
from gentopo.topology.utils import visualize
from gentopo.topology.utils import create_topology_dir
from gentopo.topology.utils import write_topology_json
from gentopo.topology.families import complete

# from gentopo.topology.families import complete
from gentopo.topology.families import small_world


dispatcher = {
"complete": complete,
# "complete": complete,
"small_world": small_world,
}

Expand Down
2 changes: 1 addition & 1 deletion src/gentopo/topology/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def write_topology_json(study_name, topology_id, graph):
id=topology_id,
created_for=study_name,
created_at=dt.strftime(format="%Y-%m-%dT%H:%M:%S"),
omega=nx.smallworld.omega(graph),
omega=nx.omega(graph),
network=nx.node_link_data(graph),
)
filename = f"studies/{study_name}/{topology_id}/metadata.json"
Expand Down
1 change: 1 addition & 0 deletions src/gentopo/utils/decorators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Decorators for GenTopo methods
"""

import functools


Expand Down

0 comments on commit ec15462

Please sign in to comment.