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

build_transition_matrix called before applying selection #16

Open
Zsailer opened this issue Nov 30, 2018 · 0 comments
Open

build_transition_matrix called before applying selection #16

Zsailer opened this issue Nov 30, 2018 · 0 comments

Comments

@Zsailer
Copy link
Member

Zsailer commented Nov 30, 2018

Calling build_transition matrix before calling apply_selection throws:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-10-0b8c154ec8f7> in <module>
      1 gpmsm.build_transition_matrix(    fixation_model=mccandlish, 
----> 2     population_size=100)

~/Documents/research/projects/pkgs/gpvolve/gpvolve/markovmodel.py in build_transition_matrix(self, fixation_model, **params)
     96 
     97         # Get fitnesses of all nodes.
---> 98         fitness1 = np.array([self.node[node]['fitness'] for node in nodepairs[0]])
     99         fitness2 = np.array([self.node[node]['fitness'] for node in nodepairs[1]])
    100 

~/Documents/research/projects/pkgs/gpvolve/gpvolve/markovmodel.py in <listcomp>(.0)
     96 
     97         # Get fitnesses of all nodes.
---> 98         fitness1 = np.array([self.node[node]['fitness'] for node in nodepairs[0]])
     99         fitness2 = np.array([self.node[node]['fitness'] for node in nodepairs[1]])
    100 

KeyError: 'fitness'

This is a cryptic error. Exception should point users to apply_selection method.

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