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

AttributeErrors in verification.py: MsmsSweeps #2229

Closed
GertjanBisschop opened this issue Dec 6, 2023 · 5 comments
Closed

AttributeErrors in verification.py: MsmsSweeps #2229

GertjanBisschop opened this issue Dec 6, 2023 · 5 comments
Milestone

Comments

@GertjanBisschop
Copy link
Member

GertjanBisschop commented Dec 6, 2023

l1409: pd.error.ParseError should be pd.errors.ParseError.
l348: positions = [ mutation.position / msms_params["num_sites"] for mutation in tree_sequence.mutations() ] should probably be: positions = tree_sequence.sites_position.copy() (and then divide by "num_sites")

@jeromekelleher
Copy link
Member

Can you show the full stack trace please? I don't understand why this wouldn't have shown up before.

@jeromekelleher jeromekelleher added this to the 1.3.0 milestone Dec 6, 2023
@GertjanBisschop
Copy link
Member Author

For the pd.error:

CRITICAL root: Traceback (most recent call last):
  File "verification.py", line 1408, in _cmp_msms_vs_msp
    df_msp = self._run_msp_sample_stats(cmd)
  File "verification.py", line 1348, in _run_msp_sample_stats
    positions = [
  File "verification.py", line 1349, in <listcomp>
    mutation.position / msms_params["num_sites"]
AttributeError: 'Mutation' object has no attribute 'position'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "verification.py", line 6373, in <module>
    main()
  File "verification.py", line 6369, in main
    run_tests(suite, args)
  File "verification.py", line 6308, in run_tests
    runner.run(tests, args.output_dir, args.num_threads, not args.no_progress)
  File "verification.py", line 6277, in run
    self.__run_sequential(tests, basedir, progress)
  File "verification.py", line 6249, in __run_sequential
    test.run(basedir)
  File "verification.py", line 6210, in run
    method()
  File "verification.py", line 1428, in test_neutral_msms_vs_msp
    self._cmp_msms_vs_msp("100 300 -t 200 -r 200 500000 -N 10000")
  File "verification.py", line 1409, in _cmp_msms_vs_msp
    except pd.error.ParserError:
  File "/home/gertjan/git/msprime/venv/lib/python3.8/site-packages/pandas/__init__.py", line 264, in __getattr__
    raise AttributeError(f"module 'pandas' has no attribute '{name}'")
AttributeError: module 'pandas' has no attribute 'error'

@GertjanBisschop
Copy link
Member Author

For the mutations:

CRITICAL root: Traceback (most recent call last):
  File "verification.py", line 6373, in <module>
    main()
  File "verification.py", line 6369, in main
    run_tests(suite, args)
  File "verification.py", line 6308, in run_tests
    runner.run(tests, args.output_dir, args.num_threads, not args.no_progress)
  File "verification.py", line 6277, in run
    self.__run_sequential(tests, basedir, progress)
  File "verification.py", line 6249, in __run_sequential
    test.run(basedir)
  File "verification.py", line 6210, in run
    method()
  File "verification.py", line 1428, in test_neutral_msms_vs_msp
    self._cmp_msms_vs_msp("100 300 -t 200 -r 200 500000 -N 10000")
  File "verification.py", line 1408, in _cmp_msms_vs_msp
    df_msp = self._run_msp_sample_stats(cmd)
  File "verification.py", line 1348, in _run_msp_sample_stats
    positions = [
  File "verification.py", line 1349, in <listcomp>
    mutation.position / msms_params["num_sites"]
AttributeError: 'Mutation' object has no attribute 'position'

@jeromekelleher
Copy link
Member

Hmm - I suspect this has been failing for a bit so and was masked by the pandas error check. Let's fix the obvious mutation problem, and see if we can drop the pandas pd.error.ParserError exception check (which I can't see a good reason for)

@GertjanBisschop
Copy link
Member Author

Solved in #2230.

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

2 participants