pybiolib 1.2.749__py3-none-any.whl → 1.2.766__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.
@@ -78,16 +78,32 @@ class Runtime:
78
78
  Set BioLib result name to FASTA file name (excluding file extension) or,
79
79
  if detecting a BioLib generated name, use ID of the first sequence in the fasta file
80
80
  """
81
+ try:
82
+ # Set job name to first header if FASTA text input (random BioLib file) detected
83
+ if re.match('^input_[A-Za-z0-9]+.*', path_to_fasta):
84
+ first_id = next(SeqUtil.parse_fasta(path_to_fasta)).id
85
+ result_name = first_id.replace(' ', '_')[:60]
86
+ else:
87
+ result_name = Path(path_to_fasta).stem
88
+
89
+ logger.debug(f'Setting result name to "{result_name}" from {path_to_fasta}')
90
+ Runtime.set_result_name_prefix(result_name)
91
+ except Exception as e:
92
+ logger.warning(f'Failed to set result name from fasta file {path_to_fasta}: {str(e)}')
81
93
 
82
- # Set job name to first header if FASTA text input (random BioLib file) detected
83
- if re.match('^input_[A-Za-z0-9]+.*', path_to_fasta):
84
- first_id = next(SeqUtil.parse_fasta(path_to_fasta)).id
85
- result_name = first_id.replace(' ', '_')[:60]
86
- else:
87
- result_name = Path(path_to_fasta).stem
88
-
89
- logger.debug(f'Setting result name to "{result_name}" from {path_to_fasta}')
90
- Runtime.set_result_name_prefix(result_name)
94
+ @staticmethod
95
+ def set_result_name_from_file(path_to_file: str) -> None:
96
+ try:
97
+ if path_to_file.lower().endswith('.fasta'):
98
+ return Runtime.set_result_name_prefix_from_fasta(path_to_file)
99
+
100
+ # Set job name only if not a BioLib default name
101
+ if not re.match('^input_[A-Za-z0-9]+.*', path_to_file):
102
+ result_name = Path(path_to_file).stem[:60]
103
+ logger.debug(f'Setting result name to "{result_name}" from {path_to_file}')
104
+ Runtime.set_result_name_prefix(result_name)
105
+ except Exception as e:
106
+ logger.warning(f'Failed to set result name from file {path_to_file}: {str(e)}')
91
107
 
92
108
  @staticmethod
93
109
  def create_result_note(note: str) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybiolib
3
- Version: 1.2.749
3
+ Version: 1.2.766
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  Keywords: biolib
@@ -34,7 +34,7 @@ biolib/_internal/types/result.py,sha256=MesSTBXCkaw8HydXgHf1OKGVLzsxhZ1KV5z4w-VI
34
34
  biolib/_internal/types/typing.py,sha256=qrsk8hHcGEbDpU1QQFzHAKnhQxkMe7uJ6pxHeAnfv1Y,414
35
35
  biolib/_internal/utils/__init__.py,sha256=p5vsIFyu-zYqBgdSMfwW9NC_jk7rXvvCbV4Bzd3As7c,630
36
36
  biolib/_internal/utils/multinode.py,sha256=-J3PEAK3NaOwCn--5T7vWHkA3yu5w9QhmuhkQcH-2wY,8229
37
- biolib/_runtime/runtime.py,sha256=bZQ0m39R9jOBVAtlyvzDnOobKueOAQUCwMUZjDQnO7E,4439
37
+ biolib/_runtime/runtime.py,sha256=xc4PAYyp6xlaR614taMJSQLmOKRASWYrtoMbgKpcaqQ,5306
38
38
  biolib/_session/session.py,sha256=US1Y1jfFIAm86-Lq3C7nCXpZXUJXXBVBkND9djMNYxI,1649
39
39
  biolib/api/__init__.py,sha256=mQ4u8FijqyLzjYMezMUUbbBGNB3iFmkNdjXnWPZ7Jlw,138
40
40
  biolib/api/client.py,sha256=2GpKE7QrPgyPdgJgrV7XnZByIJf1n26UCy3aoaHBs1M,7881
@@ -130,8 +130,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
130
130
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
131
131
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
132
132
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
133
- pybiolib-1.2.749.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
134
- pybiolib-1.2.749.dist-info/METADATA,sha256=hAUHVeH2pyZYFKHncVnsKqV6m2q0J29O_Qs2PUFyrIM,1570
135
- pybiolib-1.2.749.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
136
- pybiolib-1.2.749.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
137
- pybiolib-1.2.749.dist-info/RECORD,,
133
+ pybiolib-1.2.766.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
134
+ pybiolib-1.2.766.dist-info/METADATA,sha256=t2TFimPTCI6m_21fBdZPmWrmii5B4zRPhn0dk4DLDWI,1570
135
+ pybiolib-1.2.766.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
136
+ pybiolib-1.2.766.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
137
+ pybiolib-1.2.766.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.2
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any