np-workflows 1.6.93__tar.gz → 1.6.94__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {np_workflows-1.6.93 → np_workflows-1.6.94}/PKG-INFO +1 -1
  2. {np_workflows-1.6.93 → np_workflows-1.6.94}/pyproject.toml +1 -1
  3. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/dynamic_routing/widgets.py +20 -8
  4. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows.egg-info/PKG-INFO +1 -1
  5. {np_workflows-1.6.93 → np_workflows-1.6.94}/README.md +0 -0
  6. {np_workflows-1.6.93 → np_workflows-1.6.94}/setup.cfg +0 -0
  7. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/__init__.py +0 -0
  8. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/__init__.py +0 -0
  9. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/dynamic_routing/__init__.py +0 -0
  10. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/dynamic_routing/main.py +0 -0
  11. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_P3/P3_workflow_widget.py +0 -0
  12. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_P3/__init__.py +0 -0
  13. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_P3/main_P3_pilot.py +0 -0
  14. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_barcode/__init__.py +0 -0
  15. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_barcode/barcode_workflow_widget.py +0 -0
  16. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_barcode/camstim_scripts/barcode_mapping_script.py +0 -0
  17. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_barcode/camstim_scripts/barcode_opto_script.py +0 -0
  18. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_barcode/main_barcode_pilot.py +0 -0
  19. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_loop/__init__.py +0 -0
  20. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_loop/camstim_scripts/barcode_mapping_script.py +0 -0
  21. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_loop/camstim_scripts/barcode_opto_script.py +0 -0
  22. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_loop/loop_workflow_widget.py +0 -0
  23. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_loop/main_loop_pilot.py +0 -0
  24. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_psycode/__init__.py +0 -0
  25. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_psycode/main_psycode_pilot.py +0 -0
  26. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_psycode/psycode_workflow_widget.py +0 -0
  27. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_v2/__init__.py +0 -0
  28. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_v2/main_v2_pilot.py +0 -0
  29. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_v2/v2_workflow_widget.py +0 -0
  30. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_vippo/__init__.py +0 -0
  31. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_vippo/main_vippo_pilot.py +0 -0
  32. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/openscope_vippo/vippo_workflow_widget.py +0 -0
  33. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/__init__.py +0 -0
  34. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/camstim_scripts/make_tt_stims.py +0 -0
  35. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/camstim_scripts/oct22_tt_stim_script.py +0 -0
  36. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/camstim_scripts/ttn_main_script.py +0 -0
  37. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/camstim_scripts/ttn_mapping_script.py +0 -0
  38. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/camstim_scripts/ttn_opto_script.py +0 -0
  39. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/main_ttn_pilot.py +0 -0
  40. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/ttn_session_widget.py +0 -0
  41. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/task_trained_network/ttn_stim_config.py +0 -0
  42. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/templeton/__init__.py +0 -0
  43. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/templeton/main.py +0 -0
  44. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/experiments/templeton/widgets.py +0 -0
  45. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/shared/__init__.py +0 -0
  46. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/shared/base_experiments.py +0 -0
  47. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/shared/npxc.py +0 -0
  48. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows/shared/widgets.py +0 -0
  49. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows.egg-info/SOURCES.txt +0 -0
  50. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows.egg-info/dependency_links.txt +0 -0
  51. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows.egg-info/entry_points.txt +0 -0
  52. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows.egg-info/requires.txt +0 -0
  53. {np_workflows-1.6.93 → np_workflows-1.6.94}/src/np_workflows.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: np-workflows
3
- Version: 1.6.93
3
+ Version: 1.6.94
4
4
  Summary: Ecephys and behavior workflows for the Mindscope Neuropixels team.
5
5
  Author-email: Ben Hardcastle <ben.hardcastle@alleninstitute.org>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "np-workflows"
3
- version = "1.6.93"
3
+ version = "1.6.94"
4
4
  description = "Ecephys and behavior workflows for the Mindscope Neuropixels team."
5
5
  authors = [
6
6
  { name = "Ben Hardcastle", email = "ben.hardcastle@alleninstitute.org" },
@@ -91,22 +91,34 @@ def photodoc_widget(session: np_session.Session, reminder: str) -> None:
91
91
  vimba_dir = np_config.local_to_unc(
92
92
  session.rig.mon, np_services.config_from_zk()["ImageVimba"]["data"]
93
93
  )
94
- n_files = len(tuple(vimba_dir.iterdir()))
95
- t0 = time.time()
94
+
95
+ def get_file_stats():
96
+ return {p: p.stat().st_mtime for p in vimba_dir.iterdir() if p.is_file()}
97
+
98
+ original_file_stats = get_file_stats()
99
+
96
100
  print(
97
- f"Take an image in Vimba Viewer and save it with the default name (eg should be unique)."
98
- f"\n\n*This cell will wait for a new file to be created in {vimba_dir}, then copy it to the session folder with suffix {reminder!r}*"
101
+ f"Take an image in Vimba Viewer and save it {vimba_dir} with any name + .png suffix."
102
+ f"\n\nThis cell will wait for a new file or an existing file to be modified, then copy it as {reminder!r}*"
99
103
  )
104
+ t0 = time.time()
100
105
  timeout_s = 120
101
- while len(files := tuple(vimba_dir.iterdir())) == n_files:
106
+ while True:
102
107
  time.sleep(1)
108
+ new_files = len(new_file_stats := get_file_stats()) != len(original_file_stats)
109
+ modified_files = any(
110
+ p
111
+ for p in new_file_stats
112
+ if new_file_stats[p] > original_file_stats.get(p, 0)
113
+ )
114
+ if new_files or modified_files:
115
+ break
116
+
103
117
  if time.time() - t0 > timeout_s:
104
118
  raise TimeoutError(
105
119
  f"No new image file detected in Vimba folder after {timeout_s} seconds - aborting"
106
120
  )
107
- latest_image = max(
108
- (p for p in files if p.is_file()), key=lambda f: f.stat().st_ctime
109
- )
121
+ latest_image = max(new_file_stats, key=lambda k: new_file_stats[k])
110
122
  print(f"New file detected:\n\t{latest_image.name}\nCopying to session folder")
111
123
  new_name = f"{session.npexp_path.name}_{reminder}.png"
112
124
  shutil.copy2(latest_image, session.npexp_path / new_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: np-workflows
3
- Version: 1.6.93
3
+ Version: 1.6.94
4
4
  Summary: Ecephys and behavior workflows for the Mindscope Neuropixels team.
5
5
  Author-email: Ben Hardcastle <ben.hardcastle@alleninstitute.org>
6
6
  License: MIT
File without changes
File without changes