-
Notifications
You must be signed in to change notification settings - Fork 10
Don't update probe jsons if only the probeinterface version number has changed #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5cf94ab
add look for json changes action
chrishalcrow a2c9197
remove unnecessary comments
chrishalcrow fa4c7dd
update gh action
chrishalcrow 260203a
Merge branch 'main' into dont-update-probes-just-for-version
chrishalcrow ce1f836
Merge pull request #12 from chrishalcrow/dont-update-probes-just-for-…
chrishalcrow 7499b81
ensure probeinterface is uninstalled
chrishalcrow 8d08611
move into probeinterface
chrishalcrow 1f4eb2c
check ls
chrishalcrow f3f9497
debug probeinterface version
chrishalcrow 1f60179
oups
chrishalcrow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| from pathlib import Path | ||
| import shutil | ||
|
|
||
| old_dir = Path('../imec') | ||
| new_dir = Path('./neuropixels_library_generated') | ||
|
|
||
| for temp_probe_directory in new_dir.iterdir(): | ||
|
|
||
| probe_name = str(temp_probe_directory.name) | ||
|
|
||
| temp_probe_json_path = temp_probe_directory / (probe_name + '.json') | ||
| old_probe_json_path = old_dir / probe_name / (probe_name + '.json') | ||
|
|
||
| if old_probe_json_path.is_file(): | ||
| with open(temp_probe_json_path, 'r') as f1, open(old_probe_json_path, 'r') as f2: | ||
| # Read in json files | ||
| lines1 = f1.readlines() | ||
| lines2 = f2.readlines() | ||
|
|
||
| # We don't want to update the probes just because of a probeinterface version update. | ||
| # The probeinterface version is stored on the 3rd line of the json file, so we only | ||
| # compare the json files from line 3 and down. | ||
| if lines1[3:] == lines2[3:]: | ||
| continue | ||
| else: | ||
| shutil.copy(f"{temp_probe_json_path}", f"../imec/{probe_name}") | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.