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

from_ms() can't deal with negative growth rates in exponential form #325

Open
grahamgower opened this issue Jun 11, 2021 · 0 comments
Open

Comments

@grahamgower
Copy link
Member

grahamgower commented Jun 11, 2021

$ python -c "import demes; demes.from_ms('2 1 -t 1.0 -G -1e-5', N0=1)"
Traceback (most recent call last):
  File "/usr/lib/python3.9/argparse.py", line 1851, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.9/argparse.py", line 2060, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.9/argparse.py", line 1990, in consume_optional
    arg_count = match_argument(action, selected_patterns)
  File "/usr/lib/python3.9/argparse.py", line 2155, in _match_argument
    raise ArgumentError(action, msg)
argparse.ArgumentError: argument --growth-rate/-G: expected 1 argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/grg/.local/lib/python3.9/site-packages/demes/ms.py", line 828, in from_ms
    args, unknown = parse_ms_args(command)
  File "/home/grg/.local/lib/python3.9/site-packages/demes/ms.py", line 430, in parse_ms_args
    args, unknown = parser.parse_known_args(command.split())
  File "/usr/lib/python3.9/argparse.py", line 1854, in parse_known_args
    self.error(str(err))
  File "/home/grg/.local/lib/python3.9/site-packages/demes/ms.py", line 28, in error
    raise ValueError(str(exc))
ValueError: argument --growth-rate/-G: expected 1 argument

See fix for analogous problem in msprime's mspms: tskit-dev/msprime#1722

@grahamgower grahamgower added this to the 0.1.3 milestone Jun 11, 2021
@grahamgower grahamgower removed this from the 0.1.3 milestone Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant