Skip to content

Commit 0a600bc

Browse files
committed
lint: fix ruff complaints
1 parent b6c6f04 commit 0a600bc

File tree

8 files changed

+19
-23
lines changed

8 files changed

+19
-23
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
- **0.16.0** (January 08, 2026)
4+
- Housekeeping:
5+
- Migrated from Poetry to uv for package management
6+
- Updated GitHub Actions workflows to use uv and added testing for Python 3.12 through 3.14
7+
- Upgraded from `lark-parser` to `lark` for parsing
8+
- Updated copyright years
39
- **0.15.0** (August 21 2024)
410
- Backwards-incompatible changes:
511
- Removed the Docker container provisioning functionality from the `Neo4jExecutor` class. To continue using this functionality, please use the `tamarind` package directly, or install `dotmotif==0.14.0`

dotmotif/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,6 @@ def load(fname: Union[str, IO[bytes]]) -> "Motif":
248248
result = pickle.load(f)
249249
f.close()
250250
return result
251+
252+
253+
__all__ = ["Motif", "MotifError", "NetworkXExecutor", "GrandIsoExecutor"]

dotmotif/executors/test_neo4jexecutor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import dotmotif
22
from dotmotif.executors.Neo4jExecutor import Neo4jExecutor, _quoted_if_necessary
33
import unittest
4-
import networkx as nx
54

65

76
class TestNeo4jExecutor_Automorphisms(unittest.TestCase):

dotmotif/ingest/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class NetworkXConverter(abc.ABC):
1919

2020
pass
2121

22-
def to_graph(self) -> nx.Graph:
23-
...
22+
def to_graph(self) -> nx.Graph: ...
2423

2524

2625
class EdgelistConverter(NetworkXConverter):
@@ -53,12 +52,12 @@ def __init__(
5352
raise KeyError(f"Dataframe does not contain column {v_id_column}.")
5453
self._graph = nx.DiGraph() if directed else nx.Graph()
5554
for i, row in data.iterrows():
56-
if u_id_column_dtype != str:
55+
if u_id_column_dtype is not str:
5756
u = np.format_float_positional(row[u_id_column])
5857
else:
5958
u = row[u_id_column]
6059

61-
if v_id_column_dtype != str:
60+
if v_id_column_dtype is not str:
6261
v = np.format_float_positional(row[v_id_column])
6362
else:
6463
v = row[v_id_column]

dotmotif/ingest/test_ingest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_ingest(self):
2424

2525
def test_read_csv(self):
2626
converter = EdgelistConverter(
27-
io.StringIO("source,target\n" "A,B\n" "A,C\n"),
27+
io.StringIO("source,target\nA,B\nA,C\n"),
2828
"source",
2929
"target",
3030
)

dotmotif/parsers/v2/test_v2_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_can_create_variables_with_underscores(self):
5151

5252
def test_cannot_create_variables_with_dashes(self):
5353
with self.assertRaises(Exception):
54-
dm = dotmotif.Motif("""A -> B-""")
54+
dotmotif.Motif("""A -> B-""")
5555

5656
def test_can_create_variables_with_numbers(self):
5757
dm = dotmotif.Motif("""A_2 -> B1""")
@@ -503,7 +503,7 @@ def test_failed_node_lookup(self):
503503
C.radius < B.radius
504504
"""
505505
with self.assertRaises(KeyError):
506-
dm = dotmotif.Motif(exp)
506+
dotmotif.Motif(exp)
507507

508508

509509
class TestEdgeAliasConstraints(unittest.TestCase):
@@ -546,7 +546,7 @@ def test_failed_edge_lookup(self):
546546
acb.radius = 3
547547
"""
548548
with self.assertRaises(KeyError):
549-
dm = dotmotif.Motif(exp)
549+
dotmotif.Motif(exp)
550550

551551
def test_quoted_attribute_edge_constraint(self):
552552
exp = """\

dotmotif/tests/test_dm_flags.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,6 @@ def test_dm_parser_limit(self):
7070
dm.from_motif(_DEMO_G_MIN)
7171
self.assertFalse("LIMIT" in Neo4jExecutor.motif_to_cypher(dm).strip())
7272

73-
def test_from_nx_import(self):
74-
G = nx.Graph()
75-
G.add_edge("A", "B")
76-
G.add_edge("B", "C")
77-
78-
g = nx.Graph()
79-
g.add_edge("A", "B")
80-
dm = dotmotif.Motif().from_nx(g)
81-
82-
E = GrandIsoExecutor(graph=G)
83-
self.assertEqual(len(E.find(dm)), 4)
84-
8573
def test_from_nx_import(self):
8674
G = nx.Graph()
8775
G.add_edge("A", "B")

dotmotif/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
Requires nx>=2.0
77
"""
8+
89
import hashlib
910
import json
1011
import networkx as nx
@@ -13,12 +14,12 @@
1314
def untype_string(string):
1415
try:
1516
return eval(string)
16-
except:
17+
except: # noqa
1718
try:
1819
if int(string) == float(string):
1920
return int(string)
2021
return float(string)
21-
except:
22+
except: # noqa
2223
return str(string)
2324

2425

0 commit comments

Comments
 (0)