Skip to content

Commit 287a215

Browse files
authored
Fix: update old versions and skip probe_ids/version from json check (#69)
* Fix: update old versions and skip probe_ids/version from json check * Fix: update old versions and skip probe_ids/version from json check 2
1 parent dca31ae commit 287a215

9 files changed

Lines changed: 19 additions & 14 deletions

File tree

neuronexus/A4x8-5mm-100-200-177/A4x8-5mm-100-200-177.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"specification": "probeinterface",
3-
"version": "0.2.19",
3+
"version": "0.3.2",
44
"probes": [
55
{
66
"ndim": 2,

neuronexus/A4x8-5mm-100-400-177/A4x8-5mm-100-400-177.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"specification": "probeinterface",
3-
"version": "0.2.17",
3+
"version": "0.3.2",
44
"probes": [
55
{
66
"ndim": 2,

neuronexus/A4x8-5mm-100-400-703/A4x8-5mm-100-400-703.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"specification": "probeinterface",
3-
"version": "0.2.17",
3+
"version": "0.3.2",
44
"probes": [
55
{
66
"ndim": 2,

neuronexus/A4x8-5mm-200-400-177/A4x8-5mm-200-400-177.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"specification": "probeinterface",
3-
"version": "0.2.19",
3+
"version": "0.3.2",
44
"probes": [
55
{
66
"ndim": 2,

neuronexus/A4x8-5mm-200-400-703/A4x8-5mm-200-400-703.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"specification": "probeinterface",
3-
"version": "0.2.19",
3+
"version": "0.3.2",
44
"probes": [
55
{
66
"ndim": 2,

neuronexus/A4x8-5mm-50-200-177/A4x8-5mm-50-200-177.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"specification": "probeinterface",
3-
"version": "0.2.19",
3+
"version": "0.3.2",
44
"probes": [
55
{
66
"ndim": 2,

plexon/4S1024/4S1024.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"specification": "probeinterface",
3-
"version": "0.2.23",
3+
"version": "0.3.2",
44
"probes": [
55
{
66
"ndim": 2,

plexon/8S1024/8S1024.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"specification": "probeinterface",
3-
"version": "0.2.23",
3+
"version": "0.3.2",
44
"probes": [
55
{
66
"ndim": 2,

scripts/check_for_json_changes_in_probes.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from argparse import ArgumentParser
22
from pathlib import Path
3+
import json
34
import shutil
45

56

@@ -37,13 +38,17 @@
3738
if old_probe_json_path.is_file():
3839
with open(temp_probe_json_path, 'r') as f1, open(old_probe_json_path, 'r') as f2:
3940
# Read in json files
40-
lines1 = f1.readlines()
41-
lines2 = f2.readlines()
41+
new_probe_dict = json.load(f1)
42+
old_probe_dict = json.load(f2)
4243

43-
# We don't want to update the probes just because of a probeinterface version update.
44-
# The probeinterface version is stored on the 3rd line of the json file, so we only
45-
# compare the json files from line 3 and down.
46-
if lines1[3:] == lines2[3:]:
44+
# We don't want to update the probes just because of a probeinterface version update
45+
# or because a `probe_ids` entry was added (both are introduced automatically by newer
46+
# probeinterface versions), so we ignore those keys when comparing.
47+
for probe_dict in (new_probe_dict, old_probe_dict):
48+
probe_dict.pop("version", None)
49+
probe_dict.pop("probe_ids", None)
50+
51+
if new_probe_dict == old_probe_dict:
4752
continue
4853
else:
4954
shutil.copy(f"{temp_probe_json_path}", old_dir / probe_name)

0 commit comments

Comments
 (0)