From ab427405888c650dc7bbd70653bc2fc6f7ab183e Mon Sep 17 00:00:00 2001 From: Jordan Matelsky Date: Tue, 13 Feb 2024 11:27:42 -0500 Subject: [PATCH] Roll v0.5.0 --- CHANGELOG.md | 4 ++++ README.md | 9 ++++----- grandcypher/__init__.py | 8 +++++--- setup.py | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35a30e4..8e254f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ - Support for string operators, like `CONTAINS`, `STARTS WITH`, and `ENDS WITH` (#33) - Support for negation of clauses with `NOT` (#33) +#### Performance + +- Huge performance boost for nonexhaustive queries via streaming matches (#34, thanks @davidmezzetti!) + #### Housekeeping - Added more recent version of Python (3.9 through 3.11) to CI (#33) diff --git a/README.md b/README.md index f68c87b..caa0412 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@

GrandCypher

GitHub Workflow Status (branch)
- - ```shell pip install grand-cypher +# Note: You will want a version of grandiso>=2.2.0 for best performance! +pip install -U 'grandiso>=2.2.0' ``` GrandCypher is a partial (and growing!) implementation of the Cypher graph query language written in Python, for Python data structures. @@ -75,11 +75,10 @@ RETURN | Anonymous `()` nodes | ✅ Thanks @khoale88! | | | Undirected `()-[]-()` edges | ✅ Thanks @khoale88! | | | Boolean Arithmetic (`AND`/`OR`) | ✅ Thanks @khoale88! | | -| `OPTIONAL MATCH` | 🛣 | | +| `OPTIONAL MATCH` | 🛣 | | | `(:Type)` node-labels | ✅ Thanks @khoale88! | | | `[:Type]` edge-labels | ✅ Thanks @khoale88! | | -| Graph mutations (e.g. `DELETE`, `SET`,...) | 🛣 | | - +| Graph mutations (e.g. `DELETE`, `SET`,...) | 🛣 | | | | | | | -------------- | -------------- | ---------------- | diff --git a/grandcypher/__init__.py b/grandcypher/__init__.py index cb9537a..df2940b 100644 --- a/grandcypher/__init__.py +++ b/grandcypher/__init__.py @@ -6,6 +6,7 @@ to search in a much larger graph database. """ + from typing import Dict, List, Callable, Tuple import random import string @@ -142,7 +143,7 @@ start="start", ) -__version__ = "0.2.0" +__version__ = "0.5.0" _ALPHABET = string.ascii_lowercase + string.digits @@ -427,7 +428,7 @@ def _get_true_matches(self): ): break match[b] = match[a] - else: # For/else loop + else: # For/else loop # Check if match matches where condition and add if not self._where_condition or self._where_condition( match, self._target_graph, self._return_edges @@ -453,7 +454,8 @@ def _matches_iter(self, motif): self._target_graph, is_node_attr_match=_is_node_attr_match, is_edge_attr_match=_is_edge_attr_match, - ) for c in nx.weakly_connected_components(motif) + ) + for c in nx.weakly_connected_components(motif) ] # Single match clause iterator diff --git a/setup.py b/setup.py index 187fd47..eac00bb 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="grand-cypher", - version="0.4.0", + version="0.5.0", author="Jordan Matelsky", author_email="opensource@matelsky.com", description="Query Grand graphs using Cypher",