pybiolib 1.2.174__py3-none-any.whl → 1.2.180.dev1__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/cli/run.py CHANGED
@@ -4,18 +4,28 @@ import click
4
4
 
5
5
  from biolib import biolib_errors, utils
6
6
  from biolib.app import BioLibApp
7
- from biolib.typing_utils import Tuple
7
+ from biolib.experiments.experiment import Experiment
8
+ from biolib.typing_utils import Optional, Tuple
8
9
 
9
10
 
10
11
  @click.command(
11
12
  context_settings=dict(ignore_unknown_options=True, allow_interspersed_args=False),
12
- help='Run an application on BioLib',
13
+ help='Run an application on BioLib.',
13
14
  )
14
- @click.option('--local', is_flag=True, required=False, help='Run the application locally')
15
- @click.option('--non-blocking', is_flag=True, required=False, help='Run the application non blocking')
15
+ @click.option('--experiment', type=str, required=False, help='Experiment name or URI to add the run to.')
16
+ @click.option('--local', is_flag=True, required=False, help='Run the application locally.')
17
+ @click.option('--non-blocking', is_flag=True, required=False, help='Run the application non blocking.')
16
18
  @click.argument('uri', required=True)
17
19
  @click.argument('args', nargs=-1, type=click.UNPROCESSED)
18
- def run(local: bool, non_blocking: bool, uri: str, args: Tuple[str]) -> None:
20
+ def run(experiment: Optional[str], local: bool, non_blocking: bool, uri: str, args: Tuple[str]) -> None:
21
+ if experiment:
22
+ with Experiment(uri=experiment):
23
+ _run(local=local, non_blocking=non_blocking, uri=uri, args=args)
24
+ else:
25
+ _run(local=local, non_blocking=non_blocking, uri=uri, args=args)
26
+
27
+
28
+ def _run(local: bool, non_blocking: bool, uri: str, args: Tuple[str]) -> None:
19
29
  try:
20
30
  app = BioLibApp(uri=uri)
21
31
  except biolib_errors.BioLibError as error:
@@ -134,7 +134,7 @@ class Experiment:
134
134
  def show(self) -> None:
135
135
  BioLibTable(
136
136
  columns_to_row_map=Experiment._table_columns_to_row_map,
137
- rows=[self._experiment_dict],
137
+ rows=[dict(**self._experiment_dict, name=self.name, created_at=self._resource_dict['created_at'])],
138
138
  title=f'Experiment: {self.name}',
139
139
  ).print_table()
140
140
 
biolib/tables.py CHANGED
@@ -1,9 +1,9 @@
1
1
  from collections import OrderedDict
2
2
 
3
3
  from rich.console import Console
4
- from rich.table import Table, Column
4
+ from rich.table import Column, Table
5
5
 
6
- from biolib.typing_utils import List, Any
6
+ from biolib.typing_utils import Any, List
7
7
 
8
8
 
9
9
  class BioLibTable:
@@ -17,9 +17,7 @@ class BioLibTable:
17
17
  columns = [Column(header=header, **meta['params']) for header, meta in self.columns_to_row_map.items()]
18
18
  table = Table(*columns, title=self.title)
19
19
  for row in self.rows:
20
- table.add_row(
21
- *[str(row[column['key']]) for column in self.columns_to_row_map.values()]
22
- )
20
+ table.add_row(*[str(row[column['key']]) for column in self.columns_to_row_map.values()])
23
21
  return table
24
22
 
25
23
  def print_table(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.2.174
3
+ Version: 1.2.180.dev1
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -66,7 +66,7 @@ biolib/cli/download_container.py,sha256=HIZVHOPmslGE5M2Dsp9r2cCkAEJx__vcsDz5Wt5L
66
66
  biolib/cli/init.py,sha256=wQOfii_au-d30Hp7DdH-WVw-WVraKvA_zY4za1w7DE8,821
67
67
  biolib/cli/lfs.py,sha256=z2qHUwink85mv9yDgifbVKkVwuyknGhMDTfly_gLKJM,4151
68
68
  biolib/cli/push.py,sha256=RxB4RHpjtL27Fpq7WRGojJ53R9jUuE1Cq9_NmHFzNsM,1306
69
- biolib/cli/run.py,sha256=BbvXLQ-XibjQ71Y2d4URMH_8dflNVwM0i3TIWhw_u_c,1634
69
+ biolib/cli/run.py,sha256=MCo0ZqW2pHBxOoCI3i5gAx5D0auW9fmxHqkAF4TRhms,2134
70
70
  biolib/cli/runtime.py,sha256=Xv-nrma5xX8NidWcvbUKcUvuN5TCarZa4A8mPVmF-z0,361
71
71
  biolib/cli/start.py,sha256=rg8VVY8rboFhf1iQo3zE3WA5oh_R1VWWfYJEO1gMReY,1737
72
72
  biolib/compute_node/.gitignore,sha256=GZdZ4g7HftqfOfasFpBC5zV1YQAbht1a7EzcXD6f3zg,45
@@ -101,14 +101,14 @@ biolib/compute_node/webserver/webserver_types.py,sha256=2t8EaFKESnves3BA_NBdnS2y
101
101
  biolib/compute_node/webserver/webserver_utils.py,sha256=XWvwYPbWNR3qS0FYbLLp-MDDfVk0QdaAmg3xPrT0H2s,4234
102
102
  biolib/compute_node/webserver/worker_thread.py,sha256=GRRBUqXdMKvbjyLQhYlqGIbFKeU2iiEXIe5IXi9wgdg,11806
103
103
  biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
104
- biolib/experiments/experiment.py,sha256=jIRixmQm3Gq9YdJ3I0-rE1vFukXqq6U4zXehFOJ1yZk,7614
104
+ biolib/experiments/experiment.py,sha256=m7FB7hot8CMOVrNyWGPB6FTkWQJwI0ytpIvtPxfoPME,7684
105
105
  biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
106
106
  biolib/jobs/job.py,sha256=k9uksoA7BgSU-Mw5jHtuLHdTlg-G_d_89nVoPYcUnbg,20092
107
107
  biolib/jobs/job_result.py,sha256=rALHiKYNaC9lHi_JJqBob1RubzNLwG9Z386kwRJjd2M,5885
108
108
  biolib/jobs/types.py,sha256=ezvaoTANsWazK6PmfpYcqezdfjP7MNBEBfqIZGoZhz8,997
109
109
  biolib/runtime/__init__.py,sha256=MlRepA11n2H-3plB5rzWyyHK2JmP6PiaP3i6x3vt0mg,506
110
110
  biolib/sdk/__init__.py,sha256=8uyOAKt8-Xo11jAWXCg14NkE1u0FkOBC07L3V7wGsCg,1960
111
- biolib/tables.py,sha256=acH7VjwAbadLo8P84FSnKEZxCTVsF5rEg9VPuxElNs8,872
111
+ biolib/tables.py,sha256=uxkbnXVZduZbz_1BRkpXgw_P71Puvsr8lW2ogt2VpPc,842
112
112
  biolib/templates/__init__.py,sha256=Yx62sSyDCDesRQDQgmbDsLpfgEh93fWE8r9u4g2azXk,36
113
113
  biolib/templates/example_app.py,sha256=EB3E3RT4SeO_ii5nVQqJpi5KDGNE_huF1ub-e5ZFveE,715
114
114
  biolib/typing_utils.py,sha256=ntzrlyTkUaO2OtccLYzCAGztGdca0WT5fikJUmSkT-Y,148
@@ -120,8 +120,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
120
120
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
121
121
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
122
122
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
123
- pybiolib-1.2.174.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
124
- pybiolib-1.2.174.dist-info/METADATA,sha256=whtDRAsVaAK8ZdCekzmffyOrdtKgkagocbSclm4sjrc,1507
125
- pybiolib-1.2.174.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
126
- pybiolib-1.2.174.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
127
- pybiolib-1.2.174.dist-info/RECORD,,
123
+ pybiolib-1.2.180.dev1.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
124
+ pybiolib-1.2.180.dev1.dist-info/METADATA,sha256=Gr8SFOQ8qFOhYR-kKm5v8MPmJbJl_6sL50eA9Uhg--4,1512
125
+ pybiolib-1.2.180.dev1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
126
+ pybiolib-1.2.180.dev1.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
127
+ pybiolib-1.2.180.dev1.dist-info/RECORD,,