aind-codeocean-dispatch 0.2.0__py3-none-any.whl → 0.2.1__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.
@@ -33,9 +33,13 @@ from typing import TYPE_CHECKING, Any, Literal, TypeVar
33
33
  import requests
34
34
  from aind_code_ocean_pipeline_utils.cache import input_fingerprint
35
35
  from aind_code_ocean_pipeline_utils.process import GracefulExit, check_shutdown
36
+
37
+ # Import paths that exist across supported SDK versions; 0.17 moved the models to
38
+ # ``codeocean.models`` and kept these as re-exports.
39
+ from codeocean.components import Ownership
40
+ from codeocean.computation import Computation, ComputationEndStatus, ComputationState, RunParams
41
+ from codeocean.data_asset import DataAsset, DataAssetParams, DataAssetSearchParams, DataAssetState
36
42
  from codeocean.error import Error as CodeOceanError
37
- from codeocean.models.computation import Computation, ComputationEndStatus, ComputationState, RunParams
38
- from codeocean.models.data_asset import DataAsset, DataAssetParams, DataAssetSearchParams, DataAssetState
39
43
 
40
44
  if TYPE_CHECKING:
41
45
  from codeocean import CodeOcean
@@ -88,8 +92,8 @@ class Job:
88
92
  can depend on it. ``None`` stops at a successful computation.
89
93
  key : str, optional
90
94
  Resume key (see :func:`job_key`), added to the captured asset as
91
- :func:`key_tag`. With ``reuse=True``, a Ready asset carrying it is returned
92
- instead of launching. ``None`` never reuses.
95
+ :func:`key_tag`. With ``reuse=True``, a Ready asset carrying it that the
96
+ caller created is returned instead of launching. ``None`` never reuses.
93
97
  """
94
98
 
95
99
  label: str
@@ -243,7 +247,9 @@ def run_jobs(
243
247
  capture_retries : int, optional
244
248
  New capture attempts per job after a capture ends in the Failed state.
245
249
  reuse : bool, optional
246
- Return a Ready asset tagged with a job's key instead of launching it.
250
+ Return a Ready asset tagged with a job's key instead of launching it. Only
251
+ assets the caller created count: another user running identical inputs
252
+ produces the same key, and their asset is not the caller's to consume.
247
253
  poll_interval_s : float, optional
248
254
  Seconds between status checks of each running computation.
249
255
  timeout_s : float, optional
@@ -479,7 +485,7 @@ class _Dispatcher:
479
485
  if slot.next_at > _now():
480
486
  continue
481
487
  tag = key_tag(slot.job.key)
482
- params = DataAssetSearchParams(query=f"tag:{tag}", limit=100)
488
+ params = DataAssetSearchParams(query=f"tag:{tag}", ownership=Ownership.Created, limit=100)
483
489
  try:
484
490
  results = self.client.data_assets.search_data_assets(params)
485
491
  except (CodeOceanError, requests.RequestException) as exc:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: aind-codeocean-dispatch
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Launch, monitor, and capture batches of Code Ocean capsule runs
5
5
  Project-URL: Repository, https://github.com/AllenNeuralDynamics/aind-codeocean-dispatch/
6
6
  Project-URL: Issues, https://github.com/AllenNeuralDynamics/aind-codeocean-dispatch/issues
@@ -12,7 +12,7 @@ License-File: LICENSE
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Requires-Python: >=3.11
14
14
  Requires-Dist: aind-code-ocean-pipeline-utils>=0.7.1
15
- Requires-Dist: codeocean>=0.17
15
+ Requires-Dist: codeocean>=0.13
16
16
  Description-Content-Type: text/markdown
17
17
 
18
18
  # AIND Code Ocean dispatch
@@ -0,0 +1,7 @@
1
+ aind_codeocean_dispatch/__init__.py,sha256=NcdbegNPvYKWVRArhlkdEL7HP9kof1OOiH8aRcrcszY,660
2
+ aind_codeocean_dispatch/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
+ aind_codeocean_dispatch/runner.py,sha256=6z6mt520K08TVGXdLJuYG3Q_Dqgef2UbEOHkE2qGJJk,24559
4
+ aind_codeocean_dispatch-0.2.1.dist-info/METADATA,sha256=NKCY6sbelEID-ZiXGEYdiAUY89d0PhiarMm0o4Qzt20,2797
5
+ aind_codeocean_dispatch-0.2.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
6
+ aind_codeocean_dispatch-0.2.1.dist-info/licenses/LICENSE,sha256=zMZxYbR1i_XxgyJP_rPSWKcxY7QtyxUOzbIpowHNjCs,1093
7
+ aind_codeocean_dispatch-0.2.1.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- aind_codeocean_dispatch/__init__.py,sha256=NcdbegNPvYKWVRArhlkdEL7HP9kof1OOiH8aRcrcszY,660
2
- aind_codeocean_dispatch/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
- aind_codeocean_dispatch/runner.py,sha256=hMeVmd5v5bWCF_2CQYkNV5HzD_Ywn5eyORzNqQGkHA4,24178
4
- aind_codeocean_dispatch-0.2.0.dist-info/METADATA,sha256=vPbl6NmG66g2-gKqzmGsJkPIeP-wvb5K7ZaacsFL8Rc,2797
5
- aind_codeocean_dispatch-0.2.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
6
- aind_codeocean_dispatch-0.2.0.dist-info/licenses/LICENSE,sha256=zMZxYbR1i_XxgyJP_rPSWKcxY7QtyxUOzbIpowHNjCs,1093
7
- aind_codeocean_dispatch-0.2.0.dist-info/RECORD,,