From b7920703f4f0d194b964a0785e3657ca9239b309 Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Mon, 12 Feb 2024 21:56:28 +0100 Subject: [PATCH 1/4] Improve error feedback when matching fails --- .gitignore | 1 + nextplot/common.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cbe9649..658b13b 100644 --- a/.gitignore +++ b/.gitignore @@ -142,3 +142,4 @@ tmp/ *.pbf *.ch build/ +*.json diff --git a/nextplot/common.py b/nextplot/common.py index 48e36de..62583bf 100644 --- a/nextplot/common.py +++ b/nextplot/common.py @@ -148,7 +148,11 @@ def extract_position(value, jpath_x="", jpath_y="") -> types.Position: else: return types.Position(float(value[0]), float(value[1]), desc) except Exception: - print("error parsing point," + " is the given JSON path pointing to the correct data?") + print( + f"error parsing point using {jpath_x} and {jpath_y}, " + + "please make sure the paths point to valid numbers x/y. point data:" + ) + print(desc) raise @@ -195,6 +199,10 @@ def extract_position_groups( # Extract all groups groups, oob_indices = [], [] for match in group_expression.find(group_data): + # If the value is null, we skip it (with a warning) + if match.value is None: + print(f"Warning! Found 'null' value at {str(match.full_path)}, skipping...") + continue # If no separate position file was given, we expect positions to be given group = [] if len(positions) == 0: From fef6433ab8c83a74451f4082a8d5f4c8ad46e98e Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Mon, 12 Feb 2024 21:57:09 +0100 Subject: [PATCH 2/4] Bump version --- nextplot/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextplot/__about__.py b/nextplot/__about__.py index b66eb20..7e5c80d 100644 --- a/nextplot/__about__.py +++ b/nextplot/__about__.py @@ -1 +1 @@ -__version__ = "v0.1.2" +__version__ = "v0.1.3" From 8869be6b8319aaf5818fecf8ff5120822516564d Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Mon, 12 Feb 2024 22:31:52 +0100 Subject: [PATCH 3/4] Revert manual version bump --- nextplot/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextplot/__about__.py b/nextplot/__about__.py index 7e5c80d..b66eb20 100644 --- a/nextplot/__about__.py +++ b/nextplot/__about__.py @@ -1 +1 @@ -__version__ = "v0.1.3" +__version__ = "v0.1.2" From e5e4fd64cc3c82747a8061ba473360182fd38cb4 Mon Sep 17 00:00:00 2001 From: nextmv-bot Date: Mon, 12 Feb 2024 21:34:44 +0000 Subject: [PATCH 4/4] Bump version to v0.1.3 --- nextplot/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextplot/__about__.py b/nextplot/__about__.py index b66eb20..7e5c80d 100644 --- a/nextplot/__about__.py +++ b/nextplot/__about__.py @@ -1 +1 @@ -__version__ = "v0.1.2" +__version__ = "v0.1.3"