Skip to content

Commit cdc6a20

Browse files
authored
Python Matrix (#35)
* initial commit * fix: machine * Update config.yml * try 3.12.2 * fix: `-1` key in `EdgeKeyDict.__contains__` wow...
1 parent 3913247 commit cdc6a20

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.circleci/config.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ executors:
1010

1111
machine-executor:
1212
machine:
13-
image: ubuntu-2404:2024.05.1
13+
image: ubuntu-2404:current
1414

1515
jobs:
1616
lint:
@@ -43,6 +43,9 @@ jobs:
4343
command: mypy $PACKAGE_DIR $TESTS_DIR
4444

4545
test:
46+
parameters:
47+
python_version:
48+
type: string
4649
executor: machine-executor
4750
steps:
4851
- checkout
@@ -57,8 +60,8 @@ jobs:
5760
name: Setup Python
5861
command: |
5962
pyenv --version
60-
pyenv install -f 3.10
61-
pyenv global 3.10
63+
pyenv install -f << parameters.python_version >>
64+
pyenv global << parameters.python_version >>
6265
6366
- run:
6467
name: Setup pip
@@ -81,4 +84,7 @@ workflows:
8184
build:
8285
jobs:
8386
- lint
84-
- test
87+
- test:
88+
matrix:
89+
parameters:
90+
python_version: ["3.10", "3.11", "3.12.2"]

nx_arangodb/classes/dict/adj.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,11 @@ def __contains__(self, key: str | int) -> bool:
432432
'edge/1' in G._adj['node/1']['node/2']
433433
0 in G._adj['node/1']['node/2']
434434
"""
435+
# HACK: This is a workaround for the fact that
436+
# nxadb.MultiGraph does not yet support custom edge keys
437+
if key == "-1":
438+
return False
439+
435440
if isinstance(key, int):
436441
key = self.__process_int_edge_key(key)
437442

@@ -464,7 +469,7 @@ def __contains__(self, key: str | int) -> bool:
464469
def __getitem__(self, key: str | int) -> EdgeAttrDict:
465470
"""G._adj['node/1']['node/2']['edge/1']"""
466471
# HACK: This is a workaround for the fact that
467-
# nxadb.MultiGraph does not yet support edge keys
472+
# nxadb.MultiGraph does not yet support custom edge keys
468473
if key == "-1":
469474
raise KeyError(key)
470475

0 commit comments

Comments
 (0)