pinexq-client 0.9.2.20250515.43__py3-none-any.whl → 0.9.2.20250728.45__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.
@@ -22,4 +22,4 @@ from .model import JobSortPropertiesSortParameter, ProcessingView
22
22
  from .tool import Job, JobGroup, ProcessingStep, WorkData
23
23
 
24
24
  # Protocol version the JMA is using
25
- __jma_version__ = [7, 6, 0]
25
+ __jma_version__ = [8, 0, 0]
@@ -16,7 +16,7 @@ class UserLink(LinkHco):
16
16
 
17
17
  class UserHco(Hco[UserEntity]):
18
18
  user_id: UUID = Property()
19
- user_groups: list[str] = Property()
19
+ user_grants: list[str] = Property()
20
20
 
21
21
  self_link: UserLink
22
22
 
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: openapi.json
3
- # timestamp: 2025-05-14T12:10:18+00:00
3
+ # timestamp: 2025-07-28T08:17:01+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -132,6 +132,7 @@ class InfoHtoOpenApiProperties(BaseModel):
132
132
  extra='allow',
133
133
  populate_by_name=True,
134
134
  )
135
+ organization_id: str | None = Field(None, alias='OrganizationId')
135
136
  api_version: str | None = Field(None, alias='ApiVersion')
136
137
  build_version: str | None = Field(None, alias='BuildVersion')
137
138
  used_storage_in_bytes: int | None = Field(None, alias='UsedStorageInBytes')
@@ -252,6 +253,9 @@ class ProcessingStepHtoOpenApiProperties(BaseModel):
252
253
  owner_id: str | None = Field(
253
254
  None, alias='OwnerId', description='The owner of this resource'
254
255
  )
256
+ created_by: str | None = Field(
257
+ None, alias='CreatedBy', description='The creator of this resource'
258
+ )
255
259
  version: str | None = Field(
256
260
  None, alias='Version', description='Version of the algorithm. Default = "0"'
257
261
  )
@@ -444,7 +448,7 @@ class UserHtoOpenApiProperties(BaseModel):
444
448
  populate_by_name=True,
445
449
  )
446
450
  user_id: str | None = Field(None, alias='UserId')
447
- user_groups: List[str] | None = Field(None, alias='UserGroups')
451
+ user_grants: List[str] | None = Field(None, alias='UserGrants')
448
452
 
449
453
 
450
454
  class WorkDataKind(Enum):
@@ -682,6 +686,7 @@ class JobHtoOpenApiProperties(BaseModel):
682
686
  owner_id: str | None = Field(
683
687
  None, alias='OwnerId', description='The owner of this resource'
684
688
  )
689
+ created_by: str | None = Field(None, alias='CreatedBy')
685
690
  state: JobStates | None = Field(None, alias='State')
686
691
  tags: List[str] | None = Field(None, alias='Tags')
687
692
  hidden: bool | None = Field(None, alias='Hidden')
@@ -847,6 +852,9 @@ class WorkDataHtoOpenApiProperties(BaseModel):
847
852
  owner_id: str | None = Field(
848
853
  None, alias='OwnerId', description='The owner of this resource'
849
854
  )
855
+ created_by: str | None = Field(
856
+ None, alias='CreatedBy', description='The creator of this resource'
857
+ )
850
858
  name: str | None = Field(None, alias='Name')
851
859
  created_at: AwareDatetime | None = Field(None, alias='CreatedAt')
852
860
  size_in_bytes: int | None = Field(None, alias='SizeInBytes')
@@ -1,9 +1,10 @@
1
1
  import json as json_
2
2
  import warnings
3
- from typing import Any, Self
3
+ from typing import Any, Self, List
4
4
 
5
5
  import httpx
6
6
  from httpx import URL
7
+ from pydantic import BaseModel, ConfigDict
7
8
 
8
9
  from pinexq_client.core import Link, MediaTypes, ClientException, ApiException
9
10
  from pinexq_client.core.polling import wait_until, PollingException
@@ -35,12 +36,51 @@ from pinexq_client.job_management.model import (
35
36
  SelectProcessingParameters,
36
37
  SelectWorkDataCollectionForDataSlotParameters,
37
38
  SelectWorkDataForDataSlotParameters,
38
- SetJobTagsParameters, RapidJobSetupParameters,
39
+ SetJobTagsParameters, RapidJobSetupParameters, InputDataSlotParameter,
39
40
  )
40
41
  from pinexq_client.job_management.tool.processing_step import ProcessingStep
41
42
  from pinexq_client.job_management.tool.workdata import WorkData
42
43
 
43
44
 
45
+ class InputDataSlotParameterFlexible(BaseModel):
46
+ model_config = ConfigDict(
47
+ extra='allow',
48
+ arbitrary_types_allowed=True
49
+ )
50
+ index: int
51
+ work_data_urls: List[str] | None = None
52
+ work_data_instances: List[WorkData] | None = None
53
+
54
+ @classmethod
55
+ def create(cls, *,
56
+ index: int,
57
+ work_data_urls: List[WorkDataLink] | None = None,
58
+ work_data_instances: List[WorkData] | None = None
59
+ ) -> "InputDataSlotParameterFlexible":
60
+ """Creates an instance of InputDataSlotParameterFlexible that can be used to assign work data to a job.
61
+
62
+ Args:
63
+ index: The index of the input data slot.
64
+ work_data_urls: A list of URLs pointing to the work data.
65
+ work_data_instances: A list of WorkData instances.
66
+
67
+ Returns:
68
+ An instance of InputDataSlotParameterFlexible.
69
+ """
70
+ if sum(p is not None for p in [work_data_urls, work_data_instances]) != 1:
71
+ raise ValueError("Exactly one parameter must be provided")
72
+
73
+ if work_data_instances is not None:
74
+ if not isinstance(work_data_instances, list) or any(
75
+ not isinstance(i, WorkData) for i in work_data_instances):
76
+ raise Exception('Instance passed to "work_data_instances" is not of type "list[WorkData]"')
77
+ work_data_urls = [work_data_instance.self_link() for work_data_instance in work_data_instances]
78
+ return InputDataSlotParameterFlexible(
79
+ index=index,
80
+ work_data_urls=[str(wd.get_url()) for wd in work_data_urls] if work_data_urls else None,
81
+ work_data_instances=None
82
+ )
83
+
44
84
  class Job:
45
85
  """Convenience wrapper for handling JobHcos in the JobManagement-Api.
46
86
 
@@ -61,7 +101,7 @@ class Job:
61
101
  _entrypoint: EntryPointHco
62
102
  _jobs_root: JobsRootHco
63
103
  _processing_step_root: ProcessingStepsRootHco
64
- job_hco: JobHco | None = None # Internal hco of the wrapper. This is updated by this class. You should not take a reference to this object.
104
+ job_hco: JobHco | None = None # Internal hco of the wrapper. This is updated by this class. You should not take a reference to this object.
65
105
 
66
106
  def __init__(self, client: httpx.Client):
67
107
  """
@@ -313,6 +353,19 @@ class Job:
313
353
 
314
354
  return self
315
355
 
356
+ def wait_for_completion(self, timeout_ms: int = 60000, polling_interval_ms: int = 500) -> Self:
357
+ """Wait for this job to reach the state 'completed'.
358
+
359
+ Args:
360
+ timeout_ms: Timeout to wait for the job to reach the next state.
361
+ polling_interval_ms: will determine how fast the API is polled for updates.
362
+ Note that low values will produce unnecessary load.
363
+
364
+ Returns:
365
+ This `Job` object
366
+ """
367
+ return self.wait_for_state(JobStates.completed, timeout_ms, polling_interval_ms)
368
+
316
369
  def assign_input_dataslot(
317
370
  self,
318
371
  index: int,
@@ -564,7 +617,7 @@ class Job:
564
617
 
565
618
  job_was_deleted = False
566
619
  try:
567
- if self.job_hco.delete_action.is_available():
620
+ if self.job_hco.delete_action.is_available():
568
621
  self.job_hco.delete_action.execute()
569
622
  # do not delete the hco here since we want to access its data slots just below
570
623
  job_was_deleted = True
@@ -663,7 +716,17 @@ class Job:
663
716
 
664
717
  def create_and_configure_rapidly(
665
718
  self,
666
- parameters: RapidJobSetupParameters
719
+ *,
720
+ name: str,
721
+ parent_job_url: JobLink | None = None,
722
+ parent_job_instance: Self | None = None,
723
+ tags: list[str] | None = None,
724
+ processing_step_url: ProcessingStepLink | None = None,
725
+ processing_step_instance: ProcessingStep | None = None,
726
+ start: bool = True,
727
+ parameters: str | None = None,
728
+ allow_output_data_slots: bool | None = None,
729
+ input_data_slots: List[InputDataSlotParameterFlexible] | None = None,
667
730
  ) -> Self:
668
731
  """
669
732
  Creates a new job and configures it rapidly with RapidJobSetupParameters.
@@ -674,7 +737,54 @@ class Job:
674
737
  Returns:
675
738
  The newly created job as `Job` object
676
739
  """
677
- job_link = self._jobs_root.rapid_job_setup_action.execute(parameters)
740
+
741
+ # handle parent job
742
+ if sum(p is not None for p in [parent_job_url, parent_job_instance]) > 1:
743
+ raise ValueError("Either none or at most 1 one of parent_job_url or parent_job_instance must be provided")
744
+ parent_job = None
745
+ if parent_job_instance is not None:
746
+ if not isinstance(parent_job_instance, Job):
747
+ raise Exception('Instance passed to "parent_job_instance" is not of type "Job"')
748
+ parent_job = parent_job_instance.self_link().get_url()
749
+ elif parent_job_url is not None:
750
+ if not isinstance(parent_job_url, JobLink):
751
+ raise Exception('Instance passed to "parent_job_url" is not of type "JobLink"')
752
+ parent_job = parent_job_url.get_url()
753
+
754
+ # handle processing step
755
+ if sum(p is not None for p in [processing_step_url, processing_step_instance]) != 1:
756
+ raise ValueError("Exactly one of processing_step_url or processing_step_instance must be provided")
757
+ if processing_step_instance is not None:
758
+ if not isinstance(processing_step_instance, ProcessingStep):
759
+ raise Exception('Instance passed to "processing_step_instance" is not of type "ProcessingStep"')
760
+ processing_step = processing_step_instance.self_link().get_url()
761
+ else:
762
+ if not isinstance(processing_step_url, ProcessingStepLink):
763
+ raise Exception('Instance passed to "processing_step_url" is not of type "ProcessingStepLink"')
764
+ processing_step = processing_step_url.get_url()
765
+
766
+ # handle input data slots
767
+ if input_data_slots is not None:
768
+ input_data_slots = [
769
+ InputDataSlotParameter(
770
+ Index=slot.index,
771
+ WorkDataUrls=slot.work_data_urls
772
+ ) for slot in input_data_slots
773
+ ]
774
+
775
+ # build RapidJobSetupParameters
776
+ params = RapidJobSetupParameters(
777
+ Name=name,
778
+ ParentJobUrl=None if parent_job is None else str(parent_job),
779
+ ProcessingStepUrl=str(processing_step),
780
+ Tags=tags,
781
+ Start=start,
782
+ Parameters=parameters,
783
+ AllowOutputDataDeletion=allow_output_data_slots,
784
+ InputDataSlots=input_data_slots
785
+ )
786
+
787
+ job_link = self._jobs_root.rapid_job_setup_action.execute(params)
678
788
  self._get_by_link(job_link)
679
789
  return self
680
790
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pinexq-client
3
- Version: 0.9.2.20250515.43
3
+ Version: 0.9.2.20250728.45
4
4
  Summary: A hypermedia-based client for the DataCybernetics PinexQ platform.
5
5
  Author-Email: =?utf-8?q?Sebastian_H=C3=B6fer?= <hoefer@data-cybernetics.com>, Mathias Reichardt <reichardt@data-cybernetics.com>, Jasim Ahmed <ahmed@data-cybernetics.com>, Pratik Poudel <poudel@data-cybernetics.com>
6
6
  Maintainer-Email: Mathias Reichardt <reichardt@data-cybernetics.com>, =?utf-8?q?Sebastian_H=C3=B6fer?= <hoefer@data-cybernetics.com>, Carsten Blank <blank@data-cybernetics.com>
@@ -1,7 +1,7 @@
1
- pinexq_client-0.9.2.20250515.43.dist-info/METADATA,sha256=0WwpBhk9GA6PUPIi3nDnyX9fvaaRIb9nloEjn2OVsBk,3279
2
- pinexq_client-0.9.2.20250515.43.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- pinexq_client-0.9.2.20250515.43.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
- pinexq_client-0.9.2.20250515.43.dist-info/licenses/LICENSE,sha256=3oz3tAhM7kOgRukkRe7wmh5T_HihZY77ZtJDJm91ZN8,1072
1
+ pinexq_client-0.9.2.20250728.45.dist-info/METADATA,sha256=rpYp7wXC3mkwpuPzLGmEjObrX6rnq74CYCvOrhnCq6A,3279
2
+ pinexq_client-0.9.2.20250728.45.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ pinexq_client-0.9.2.20250728.45.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
+ pinexq_client-0.9.2.20250728.45.dist-info/licenses/LICENSE,sha256=3oz3tAhM7kOgRukkRe7wmh5T_HihZY77ZtJDJm91ZN8,1072
5
5
  pinexq_client/core/__init__.py,sha256=zO9vUuAl6AEokL-SqQO3Jl1qrxFBZPA2kH99VNZugEU,598
6
6
  pinexq_client/core/base_relations.py,sha256=oIUS58pkbMDdqm-3YOdsenhL1smtzeAk4fp7-U595MY,162
7
7
  pinexq_client/core/enterapi.py,sha256=eB4F2_t3lCbMgKhy-M-Sf_u9MhuJMO7OGh-GB-4Cc-8,731
@@ -21,7 +21,7 @@ pinexq_client/core/model/error.py,sha256=ZDbUlwsj7d8XPMolSSLTFwgs3RBLvOvgmlEtoBu
21
21
  pinexq_client/core/model/sirenmodels.py,sha256=vGRQlhM2cSa2caxQel91Jr48KWqM-vMYX32iaQCzIds,5547
22
22
  pinexq_client/core/polling.py,sha256=Z6VXn-PCGk4XX-4tQWZG59qJyCIS0eIrpPUORQDIGrs,1077
23
23
  pinexq_client/core/sirenaccess.py,sha256=F7eZI5Pz79el0D30SYNGsiS2qWaAZF_jrCrUy-q2GgY,6992
24
- pinexq_client/job_management/__init__.py,sha256=jaOkYyOSur8EMcz4fgEFlENQFwagHKjLwlR67E9FIhs,598
24
+ pinexq_client/job_management/__init__.py,sha256=tpmrNGVVfoH6kfcU_-w1vN4kpBUxO2_zmtdt-ddgT5w,598
25
25
  pinexq_client/job_management/enterjma.py,sha256=Ivl_jVPw_gaLyU5nKbywM-bbVGpn0MoCrZ0DMbJYf3s,1411
26
26
  pinexq_client/job_management/hcos/__init__.py,sha256=TZgs5kuBk3lSBxPfn5ehgbdUgzPy2jn1PC3Ea6VQY-k,584
27
27
  pinexq_client/job_management/hcos/entrypoint_hco.py,sha256=qodjAwO_MtawUuhmaYjhGXHV-uW1k94V9gKRYZRkhn4,2234
@@ -36,18 +36,18 @@ pinexq_client/job_management/hcos/processing_step_hco.py,sha256=JH9s3ifchYvpwzPG
36
36
  pinexq_client/job_management/hcos/processing_step_used_tags_hco.py,sha256=90-2IWlYTcYX62NzmAPnmcUCwMDhmMZyBrNs_G3yigs,1067
37
37
  pinexq_client/job_management/hcos/processingstep_query_result_hco.py,sha256=YcCgigKvOIggILixgaEbmnM23FlkjCgxnhZC2Eh98dY,3817
38
38
  pinexq_client/job_management/hcos/processingsteproot_hco.py,sha256=gQBGMWEKX5kq_HwC7-eEjjfAm6oYTuIxGX5kKw_GKUM,3684
39
- pinexq_client/job_management/hcos/user_hco.py,sha256=z6USe-4nYzBfOoEx3n9_UbgomMTimg4EIa_XeVBj01A,1095
39
+ pinexq_client/job_management/hcos/user_hco.py,sha256=6GZrNeUZSZxwOiyCylkfl-pqDa1RL7Lc9Lg3vf0EuYc,1095
40
40
  pinexq_client/job_management/hcos/workdata_hco.py,sha256=utKgdvwJdtR5oFSdM0PQpjpFmH39X1RAvfF-2a1g3U8,5707
41
41
  pinexq_client/job_management/hcos/workdata_query_result_hco.py,sha256=yxEnu_COMxP3mt553JZD13jjPyqSp3DJjgd8es5Nq_E,3520
42
42
  pinexq_client/job_management/hcos/workdata_used_tags_query_result_hco.py,sha256=qB1iQpwD63579dq3tUF4DBB_rZRMqJ80y1ysf-41aOo,1087
43
43
  pinexq_client/job_management/hcos/workdataroot_hco.py,sha256=LdEPW2JJTqAWi-6zj-40lfREhthcDL6nPXQk_nfMtCA,3936
44
44
  pinexq_client/job_management/known_relations.py,sha256=f3-7RagAfeSFv9b54l5zxnLKbVQjQQHzYsM4W2QHf0Y,708
45
45
  pinexq_client/job_management/model/__init__.py,sha256=iuAKRXdW_Mxo0i3HsBfEzhJJZUKkNe3qs4gLW-ge1PU,63
46
- pinexq_client/job_management/model/open_api_generated.py,sha256=s-XtnhuK5YmBhbOqKsy09iRKrQMtZL6-N2be-g5d8QU,33211
46
+ pinexq_client/job_management/model/open_api_generated.py,sha256=0zRqgTQWp2imTfIaAwQxun9XT1xLW9BMIr6yZ_5Wkes,33577
47
47
  pinexq_client/job_management/model/sirenentities.py,sha256=MUjgByEwzQcrduCEJuNK85uAj8SLTdyaiKmnlB44h3E,3430
48
48
  pinexq_client/job_management/tool/__init__.py,sha256=zPobd-hQyANHzC0-TjJG91z9XrewvE54ZJ6VViymW5M,128
49
- pinexq_client/job_management/tool/job.py,sha256=p9WDfJiIcQMZyLfNajpxK9kSd0DqF2H9hoS7lvDIFC0,25496
49
+ pinexq_client/job_management/tool/job.py,sha256=yVEVE3RRalQy8abA2G1X-a1Tj3v32YCsDeN52LDMSp8,30572
50
50
  pinexq_client/job_management/tool/job_group.py,sha256=TNWw46UDyP2gmArhbzMAqpHa6lS2hzwarLIrxxpOMnk,4822
51
51
  pinexq_client/job_management/tool/processing_step.py,sha256=LLesEbS7vaAiCoGs7MV8bnaD8bWnkK-2YTxAsyPiJFM,10796
52
52
  pinexq_client/job_management/tool/workdata.py,sha256=wRy_yfFZUJDh-hoGUuAbQaRGtPysDmEOhLwD84Fgz04,5510
53
- pinexq_client-0.9.2.20250515.43.dist-info/RECORD,,
53
+ pinexq_client-0.9.2.20250728.45.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: pdm-backend (2.4.4)
2
+ Generator: pdm-backend (2.4.5)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any