Skip to content

Commit c6624cc

Browse files
committed
Fix script
1 parent 0b7bf22 commit c6624cc

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/generate_cambridge_neurotech_library.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
run: |
3030
# probeinterface
3131
git clone https://github.com/spikeinterface/probeinterface ./probeinterface
32-
ls probeinterface/resources
3332
3433
# cambridge neurotech probe maps
3534
git clone https://github.com/cambridge-neurotech/probe_maps.git ./probe_maps
@@ -43,7 +42,7 @@ jobs:
4342
python ../probeinterface/resources/generate_cambridgeneurotech_library.py ../probe_maps/ --output-folder ./cambridge_library_generated/
4443
4544
# check for json changes (except probeinterface version)
46-
python check_for_json_changes_in_probes.py ../cambridgeneurotech/ ./cambridge_library_generated/
45+
python check_for_json_changes_in_probes.py ../cambridgeneurotech/ ./cambridge_library_generated/ --copy-figures
4746
# clean up
4847
rm -r cambridge_library_generated/
4948
cd ..
@@ -62,7 +61,7 @@ jobs:
6261
echo "No changes to commit"
6362
echo "changes=false" >> $GITHUB_OUTPUT
6463
else
65-
git commit -m "Update json files for NP probes"
64+
git commit -m "Update json files for cambridge neurotech probes"
6665
echo "changes=true" >> $GITHUB_OUTPUT
6766
fi
6867

scripts/check_for_json_changes_in_probes.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
help="Path to the new probes directory",
1818
)
1919

20+
parser.add_argument(
21+
"--copy-figures",
22+
action="store_true",
23+
help="If set, copies figures as well when JSON files are different.",
24+
)
25+
2026

2127
if __name__ == "__main__":
2228
args = parser.parse_args()
@@ -40,5 +46,11 @@
4046
if lines1[3:] == lines2[3:]:
4147
continue
4248
else:
43-
shutil.copy(f"{temp_probe_json_path}", f"../imec/{probe_name}")
49+
shutil.copy(f"{temp_probe_json_path}", old_dir / probe_name)
50+
if args.copy_figures:
51+
temp_figure_path = temp_probe_directory / (probe_name + '.png')
52+
shutil.copy(f"{temp_figure_path}", old_dir / probe_name)
53+
54+
55+
4456

0 commit comments

Comments
 (0)