pybiolib 1.1.1418__py3-none-any.whl → 1.1.1420__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.
biolib/jobs/job.py CHANGED
@@ -37,7 +37,7 @@ class Job:
37
37
  self._job_dict: JobDict = job_dict
38
38
  self._job_dict_last_fetched_at: datetime = datetime.utcnow()
39
39
  self._result: Optional[JobResult] = None
40
- self._module_input_dict: Optional[ModuleInputDict] = None
40
+ self._cached_input_arguments: Optional[List[str]] = None
41
41
 
42
42
  def __str__(self):
43
43
  return f"Job for {self._job_dict['app_uri']} created at {self._job_dict['created_at']} ({self._uuid})"
@@ -116,33 +116,24 @@ class Job:
116
116
  return self.result.get_exit_code()
117
117
 
118
118
  def _get_module_input(self) -> ModuleInputDict:
119
- if not self._module_input_dict:
120
- self._refetch_job_dict()
121
- try:
122
- presigned_download_url = BiolibJobApi.get_job_storage_download_url(
123
- job_uuid=self._job_dict['uuid'],
124
- job_auth_token=self._job_dict['auth_token'],
125
- storage_type='input',
126
- )
127
- response = requests.get(url=presigned_download_url)
128
- response.raise_for_status()
129
- module_input_serialized: bytes = response.content
130
- except Exception as error:
131
- # TODO: Improve error handling and messages
132
- raise error
133
-
134
- try:
135
- self._module_input_dict = ModuleInput(module_input_serialized).deserialize()
136
- except Exception as error:
137
- # TODO: Improve error handling and messages
138
- raise error
139
-
140
- return self._module_input_dict
119
+ self._refetch_job_dict()
120
+ presigned_download_url = BiolibJobApi.get_job_storage_download_url(
121
+ job_uuid=self._job_dict['uuid'],
122
+ job_auth_token=self._job_dict['auth_token'],
123
+ storage_type='input',
124
+ )
125
+ response = requests.get(url=presigned_download_url)
126
+ response.raise_for_status()
127
+ module_input_serialized: bytes = response.content
128
+ return ModuleInput(module_input_serialized).deserialize()
141
129
 
142
130
  def get_input_arguments(self) -> List[str]:
143
- logger.debug('Getting input arguments...')
144
- module_input = self._get_module_input()
145
- return module_input['arguments']
131
+ if self._cached_input_arguments is None:
132
+ logger.debug('Fetching input arguments...')
133
+ module_input = self._get_module_input()
134
+ self._cached_input_arguments = module_input['arguments']
135
+
136
+ return self._cached_input_arguments
146
137
 
147
138
  def save_input_files(self, output_dir: str) -> None:
148
139
  logger.info('Downloading input files...')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.1.1418
3
+ Version: 1.1.1420
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -76,7 +76,7 @@ biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
76
76
  biolib/experiments/experiment.py,sha256=NjJOFktfTbgHNtIDavyQP_uL_-gSGwYHfycybPLJRKU,5939
77
77
  biolib/experiments/types.py,sha256=n9GxdFA7cLMfHvLLqLmZzX31ELeSSkMXFoEEdFsdWGY,171
78
78
  biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
79
- biolib/jobs/job.py,sha256=kZQHDRIxb8pFV8CUHe_aOHYiDQXQdbZ5jArA5H9yfPs,15244
79
+ biolib/jobs/job.py,sha256=Alshkwmpnv_15zKY2hZ_lFeFV2ShycJO5C3dhZsgKD4,14910
80
80
  biolib/jobs/job_result.py,sha256=8GasUmUXD8SjUYrE2N-HrDx7-AI6TEkFONH8H91t01Q,4913
81
81
  biolib/jobs/types.py,sha256=kn4Vc0fDi6jFVcjpcKH6AYFKXkVA_CaRvtmsJoSyr0c,905
82
82
  biolib/lfs/__init__.py,sha256=wspftSqe_x7xPMZbeW8mcIBuxbHFCiFI3V4TuZU4nZ4,193
@@ -96,8 +96,8 @@ biolib/utils/cache_state.py,sha256=BFrZlV4XZIueIFzAFiPidX4hmwADKY5Y5ZuqlerF5l0,3
96
96
  biolib/utils/multipart_uploader.py,sha256=Bf09MJcIOBwzG8L1i5UeQ2cNcYohxklhhWWAMpnE41I,9671
97
97
  biolib/utils/seq_util.py,sha256=QRLYIPg1yM_LF9bFuM-Ow14gTHoG3rOK6CeGHD705qw,2612
98
98
  biolib/utils/zip/remote_zip.py,sha256=NCdUnVbGCv7SfXCI-yVU-is_OnyWmLAnVpIdSvo-W4k,23500
99
- pybiolib-1.1.1418.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
100
- pybiolib-1.1.1418.dist-info/METADATA,sha256=O85GU1rWcFDrMKcONK-Wj0DRrc7bMcMzWGqIK04FAvQ,1492
101
- pybiolib-1.1.1418.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
102
- pybiolib-1.1.1418.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
103
- pybiolib-1.1.1418.dist-info/RECORD,,
99
+ pybiolib-1.1.1420.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
100
+ pybiolib-1.1.1420.dist-info/METADATA,sha256=gvld8xTOveRhdDjevpxT-qmRc4uDbWSylZjwzMdiC7U,1492
101
+ pybiolib-1.1.1420.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
102
+ pybiolib-1.1.1420.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
103
+ pybiolib-1.1.1420.dist-info/RECORD,,