Skip to content

Commit

Permalink
Update qiime info to show parallel config info
Browse files Browse the repository at this point in the history
  • Loading branch information
Oddant1 committed Jul 10, 2024
1 parent efac9fc commit d19ca45
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
37 changes: 37 additions & 0 deletions q2cli/builtin/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def info():
import q2cli.util
# This import improves performance for repeated _echo_plugins
import q2cli.core.cache
from qiime2.sdk.parallel_config import \
(PARALLEL_CONFIG, get_vendored_config)
from tomlkit import dumps
from parsl import Config

click.secho('System versions', fg='green')
_echo_version()
Expand All @@ -51,5 +55,38 @@ def info():
click.secho('\nApplication config directory', fg='green')
click.secho(q2cli.util.get_app_dir())

click.secho('\nParallel Config', fg='green')
parallel_config = PARALLEL_CONFIG.parallel_config
config_source = 'Memory'

mapping = PARALLEL_CONFIG.action_executor_mapping
mapping_source = 'Memory'

if not parallel_config or not mapping:
vendored_config, vendored_mapping, vendored_source = \
get_vendored_config()

if not parallel_config:
config_source = vendored_source
parallel_config = vendored_config

if not mapping:
mapping_source = vendored_source
mapping = vendored_mapping

click.secho(f'Config Source: {config_source}')
if isinstance(parallel_config, Config):
click.secho(parallel_config.__dict__)
elif parallel_config:
click.secho(dumps(parallel_config))
else:
click.secho('{}')

click.secho(f'\nMapping Source: {mapping_source}')
if not mapping:
click.secho('{}')
else:
click.secho(dumps(mapping))

click.secho('\nGetting help', fg='green')
click.secho('To get help with QIIME 2, visit https://qiime2.org')
4 changes: 2 additions & 2 deletions q2cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,14 @@ def __call__(self, **kwargs):
with qiime2.util.redirected_stdio(stdout=log, stderr=log):
if parallel:
from qiime2.sdk.parallel_config import \
(get_config_from_file, ParallelConfig)
(load_config_from_file, ParallelConfig)

action = action.parallel
if parallel_config_fp is None:
parallel_config = ParallelConfig()
else:
config, mapping = \
get_config_from_file(parallel_config_fp)
load_config_from_file(parallel_config_fp)
parallel_config = ParallelConfig(config, mapping)

with parallel_config:
Expand Down

0 comments on commit d19ca45

Please sign in to comment.