Skip to content

Commit

Permalink
add suppress_output to update_organism
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Maughmer committed Sep 2, 2020
1 parent 36894ff commit e289a58
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Or with the Arrow client:
History
-------

- 4.2.8
- Added --suppress_output to update_organism
- 4.2.7
- Renamed --return_all option to --suppress_output
- 4.2.6
Expand Down
7 changes: 6 additions & 1 deletion apollo/organisms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def add_organism(self, common_name, directory, blatdb=None, genus=None,
return data

def update_organism(self, organism_id, common_name, directory, blatdb=None, species=None, genus=None, public=False,
no_reload_sequences=False):
no_reload_sequences=False, suppress_output=False):
"""
Update an organism
Expand Down Expand Up @@ -102,6 +102,9 @@ def update_organism(self, organism_id, common_name, directory, blatdb=None, spec
:type no_reload_sequences: bool
:param no_reload_sequences: Set this if you don't want Apollo to reload genome sequences (no change in genome sequence)
:type suppress_output: bool
:param suppress_output: Suppress output of all organisms (true / false) (default false)
:rtype: dict
:return: a dictionary with information about the updated organism
"""
Expand All @@ -119,6 +122,8 @@ def update_organism(self, organism_id, common_name, directory, blatdb=None, spec
data['genus'] = genus
if species is not None:
data['species'] = species
if suppress_output is not None and suppress_output is True:
data['returnAllOrganisms'] = False

response = self.post('updateOrganismInfo', data)[0]

Expand Down
9 changes: 7 additions & 2 deletions arrow/commands/organisms/update_organism.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@
help="Set this if you don't want Apollo to reload genome sequences (no change in genome sequence)",
is_flag=True
)
@click.option(
"--suppress_output",
help="Suppress output of all organisms (true / false) (default false)",
is_flag=True
)
@pass_context
@custom_exception
@dict_output
def cli(ctx, organism_id, common_name, directory, blatdb="", species="", genus="", public=False, no_reload_sequences=False):
def cli(ctx, organism_id, common_name, directory, blatdb="", species="", genus="", public=False, no_reload_sequences=False, suppress_output=False):
"""Update an organism
Output:
a dictionary with information about the updated organism
"""
return ctx.gi.organisms.update_organism(organism_id, common_name, directory, blatdb=blatdb, species=species, genus=genus, public=public, no_reload_sequences=no_reload_sequences)
return ctx.gi.organisms.update_organism(organism_id, common_name, directory, blatdb=blatdb, species=species, genus=genus, public=public, no_reload_sequences=no_reload_sequences, suppress_output=suppress_output)
3 changes: 3 additions & 0 deletions docs/commands/organisms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,8 @@ Update an organism
--no_reload_sequences Set this if you don't want Apollo to reload genome
sequences (no change in genome sequence)
--suppress_output Suppress output of all organisms (true / false)
(default false)
-h, --help Show this message and exit.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="apollo",
version='4.2.7',
version='4.2.8',
description="Apollo API library",
long_description=readme,
author="Helena Rasche;Anthony Bretaudeau;Nathan Dunn",
Expand Down

0 comments on commit e289a58

Please sign in to comment.