Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default remove_starcat to False #169

Merged
merged 1 commit into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kadi/commands/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ def get_cmds(start=None, stop=None, inclusive_stop=False, **kwargs):
return out


def get_cmds_from_backstop(backstop, remove_starcat=True):
def get_cmds_from_backstop(backstop, remove_starcat=False):
"""
Initialize a ``CommandTable`` from ``backstop``, which can either
be a string file name or a backstop table from ``parse_cm.read_backstop``.

:param backstop: str or Table
:param remove_starcat: remove star catalog command parameters (default=True)
:param remove_starcat: remove star catalog command parameters (default=False)
:returns: :class:`~kadi.commands.commands.CommandTable` of commands
"""
if isinstance(backstop, Path):
Expand Down
4 changes: 2 additions & 2 deletions kadi/commands/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_get_cmds_inclusive_stop():

def test_get_cmds_from_backstop_and_add_cmds():
bs_file = Path(parse_cm.tests.__file__).parent / 'data' / 'CR182_0803.backstop'
bs_cmds = commands.get_cmds_from_backstop(bs_file)
bs_cmds = commands.get_cmds_from_backstop(bs_file, remove_starcat=True)

cmds = commands.get_cmds(start='2018:182:00:00:00',
stop='2018:182:08:00:00')
Expand All @@ -104,7 +104,7 @@ def test_get_cmds_from_backstop_and_add_cmds():
assert np.all(bs_cmds['params'][ok] == {})

# Accept MP_STARCAT commands
bs_cmds = commands.get_cmds_from_backstop(bs_file, remove_starcat=False)
bs_cmds = commands.get_cmds_from_backstop(bs_file)
ok = bs_cmds['type'] == 'MP_STARCAT'
assert np.count_nonzero(ok) == 15
assert np.all(bs_cmds['params'][ok] != {})