np-workflows 1.6.85__py3-none-any.whl → 1.6.87__py3-none-any.whl

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.
@@ -8,7 +8,7 @@ import pathlib
8
8
  import re
9
9
  import shutil
10
10
  import time
11
- from typing import Any, ClassVar, Iterable, Literal, Optional, Protocol, Sequence, Type
11
+ from typing import Any, ClassVar, Iterable, Literal, Mapping, Optional, Protocol, Sequence, Type
12
12
 
13
13
  import fabric
14
14
  import invoke
@@ -382,6 +382,12 @@ class PipelineExperiment(WithSession):
382
382
  renamed_folders.append(renamed)
383
383
  logger.info('Renamed split ephys folders %r', split_folders)
384
384
  np_services.OpenEphys.data_files = renamed_folders
385
+
386
+ @staticmethod
387
+ def contains_uuid(text: str) -> bool:
388
+ hexchars = '[0-9a-fA-F]'
389
+ pattern = rf"{hexchars}{{8}}-{hexchars}{{4}}-{hexchars}{{4}}-{hexchars}{{4}}-{hexchars}{{12}}"
390
+ return re.search(pattern, text) is not None
385
391
 
386
392
  def copy_data_files(self) -> None:
387
393
  """Copy data files from raw data storage to session folder for all services."""
@@ -405,6 +411,10 @@ class PipelineExperiment(WithSession):
405
411
  for _ in ('opto', 'main', 'mapping', 'behavior'):
406
412
  if _ in file.name:
407
413
  renamed = f'{self.session.folder}.{"stim" if _ == "main" else _}.pkl'
414
+ break
415
+ else:
416
+ if self.contains_uuid(file.name):
417
+ renamed = f'{self.session.folder}.behavior.pkl'
408
418
  elif file.suffix in ('.json', '.mp4') and (cam_label := re.match('Behavior|Eye|Face',file.name)):
409
419
  renamed = f'{self.session.folder}.{cam_label.group().lower()}{file.suffix}'
410
420
  elif file.suffix in ('.json', '.mp4') and (cam_label := re.match('BEH|EYE|FACE',file.name)):
@@ -702,7 +712,13 @@ class DynamicRoutingExperiment(WithSession):
702
712
  else:
703
713
  np_services.ScriptCamstim.script = self.camstim_script.as_posix()
704
714
 
705
- np_services.ScriptCamstim.params = params
715
+ if (script_override_params := getattr(self, 'script_override_params', None)) is not None:
716
+ if not isinstance(script_override_params, Mapping):
717
+ raise TypeError(f"script_override_params must be a dict/Mapping, got {type(script_override_params)}")
718
+ else:
719
+ script_override_params = {}
720
+
721
+ np_services.ScriptCamstim.params = params | script_override_params
706
722
 
707
723
  self.update_state()
708
724
  self.log(f"{stim} started")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: np-workflows
3
- Version: 1.6.85
3
+ Version: 1.6.87
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
- np_workflows-1.6.85.dist-info/METADATA,sha256=hgjdOcKPZODfeCp2zJex33Jbyzv3_VVFXqlqgr3avnc,3991
2
- np_workflows-1.6.85.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- np_workflows-1.6.85.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ np_workflows-1.6.87.dist-info/METADATA,sha256=16Az2imZW_pvWAIUzXIII_-GpT91PVkRscVaoS-87DM,3991
2
+ np_workflows-1.6.87.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ np_workflows-1.6.87.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
4
  np_workflows/__init__.py,sha256=QWnSRZ3THmQPF6HO8rFC4EkcjGd5ypap7BssqKqva64,232
5
5
  np_workflows/assets/images/logo_np_hab.png,sha256=N1skdSq4lQv0liucargHoulzfE-zeTYoud-wAePD2VY,10071
6
6
  np_workflows/assets/images/logo_np_vis.png,sha256=yDaQ3dQcX1OXPN8Rsne9SvaevUlgvVRcw_tWs02cyTU,19349
@@ -62,9 +62,9 @@ np_workflows/experiments/templeton/__init__.py,sha256=LrTnP6DnkTSB-sdadvSOJvLZMZ
62
62
  np_workflows/experiments/templeton/main.py,sha256=5JDBN4fQbBy2PfiUh6OQr0NVZo-h58la3C-mgfLsU3Y,2906
63
63
  np_workflows/experiments/templeton/widgets.py,sha256=e0t7zhD0N-i6Q5_8EWW4lYrESuAb7hIz_BEL4NPaywo,2884
64
64
  np_workflows/shared/__init__.py,sha256=L9h5R3dioT8m0KcwjlQV5_eoEFoneJHEzDTGaH4_ySg,131
65
- np_workflows/shared/base_experiments.py,sha256=-RPtBgsKnfFVL_UO8tm_G1RJI5cqqmLnsJD0KXzIFqA,33644
65
+ np_workflows/shared/base_experiments.py,sha256=K0G4XSMkpP2s6c9XZAtxaj9niRd8GLpZQ6FVX3YDPuA,34500
66
66
  np_workflows/shared/camstim_scripts/flash_250ms.stim,sha256=ARwNQPJRRQwEaD_k0oXR1lafdafWlf_Kvfbq6TVEkDU,408
67
67
  np_workflows/shared/camstim_scripts/gabor_20_deg_250ms.stim,sha256=xvuRMORZiN9IuOLWZbNTWuxmhfHefGnZtIpeYcsQXpE,718
68
68
  np_workflows/shared/npxc.py,sha256=NWi826e14EEt3vKlsLwsQ2wYcsLk9Ea_Hrb8hn2iA3Y,6689
69
69
  np_workflows/shared/widgets.py,sha256=aehptvxluwfyRs7Sa4ZSvCMhOwGCxhUM7STBR4wFG5k,26880
70
- np_workflows-1.6.85.dist-info/RECORD,,
70
+ np_workflows-1.6.87.dist-info/RECORD,,