Skip to content

Commit

Permalink
Solved a small bug found by @swarbred (setting prepare.exclude_redund…
Browse files Browse the repository at this point in the history
…ant was having no effect).
  • Loading branch information
lucventurini committed Mar 17, 2021
1 parent f7bfb12 commit 9a5a5dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
# Version 2.2.1
Pinning sqlalchemy to <1.4.0 until sqlalchemy_utils is updated.
Moreover, solved a small bug in `prepare`: setting `prepare.exclude_redundant` to `True` in the configuration file had
no effect. Now it is equivalent to use the `-er` switch on the CLI.

# Version 2.2.0
Removed Cython from the requirements.txt file. This allows to perform the tests correctly in a Conda environment (as Conda disallows installing Cython as part of a distributed package).
Expand Down
6 changes: 5 additions & 1 deletion Mikado/subprograms/prepare.py
Expand Up @@ -91,6 +91,8 @@ def parse_prepare_options(args, mikado_config) -> Union[DaijinConfiguration, Mik
if getattr(args, "exclude_redundant", None) in (True, False):
mikado_config.prepare.exclude_redundant = args.exclude_redundant
mikado_config.prepare.files.exclude_redundant = [args.exclude_redundant] * len(mikado_config.prepare.files.gff)
elif mikado_config.prepare.exclude_redundant is True:
mikado_config.prepare.files.exclude_redundant = [True] * len(mikado_config.prepare.files.gff)
elif not mikado_config.prepare.files.exclude_redundant:
mikado_config.prepare.files.exclude_redundant = [False] * len(mikado_config.prepare.files.gff)
elif len(mikado_config.prepare.files.exclude_redundant) != len(mikado_config.prepare.files.gff):
Expand All @@ -99,7 +101,8 @@ def parse_prepare_options(args, mikado_config) -> Union[DaijinConfiguration, Mik
if not mikado_config.prepare.files.reference:
mikado_config.prepare.files.reference = [False] * len(mikado_config.prepare.files.gff)
elif len(mikado_config.prepare.files.reference) != len(mikado_config.prepare.files.gff):
raise InvalidConfiguration("Mismatch between is_reference and gff files")
raise InvalidConfiguration(
"Mismatch between 'reference' and 'gff' in the prepare.files section. They must be of the same length.")

# Set values from fields
mikado_config.prepare.minimum_cdna_length = getattr(args, "minimum_cdna_length", None) if \
Expand Down Expand Up @@ -138,6 +141,7 @@ def setup(args, logger=None) -> (argparse.Namespace, Union[MikadoConfiguration,
and the command line options.
:param args: the ArgumentParser-derived namespace.
:param logger: the logger to use for the function call. If none is provided, a new one will be created.
"""

if logger is None or not isinstance(logger, logging.Logger):
Expand Down

0 comments on commit 9a5a5dc

Please sign in to comment.