popgenmethods / momi2

Infer demographic history with the Moran model
GNU General Public License v3.0
47 stars 11 forks source link

pop was already removed by previous move_lineages #54

Closed Github-Yilei closed 1 year ago

Github-Yilei commented 2 years ago

adding multiple pulse events to the existing model.

`model_1st.add_size_param('n_pop1') model_1st.add_leaf('pop1', N = 'n_pop1')

model_1st.add_size_param('n_pop2') model_1st.add_leaf('pop2', N = 'n_pop2')

model_1st.add_time_param("tmig_pop1_pop2") model_1st.add_pulse_param("mfrac_pop1_pop2") model_1st.move_lineages("pop1", "pop2", t = "tmig_pop1_pop2", p = "mfrac_pop1_pop2") model_1st.add_time_param("tmig_pop2_pop1") model_1st.add_pulse_param("mfrac_pop2_pop1") model_1st.move_lineages("pop2", "pop1", t = "tmig_pop2_pop1", p = "mfrac_pop2_pop1")

model_1st.add_time_param('t_pop2', lower_constraints=["tmig_pop1_pop2", "tmig_pop2_pop1"]) model_1st.move_lineages('pop1', 'pop2', t = 't_pop2')

model_2ed = model_1st.copy()

model_2ed.add_size_param('n_pop3') model_2ed.add_leaf('pop3', N = 'n_pop3')

model_2ed.add_time_param("tmig_pop3_pop2") model_2ed.add_pulse_param("mfrac__pop3_pop2") model_2ed.move_lineages("pop3", "pop2", t = "tmig_pop3_pop2", p = "mfrac_pop3_pop2") model_2ed.add_time_param("tmig_pop2_pop3") model_2ed.add_pulse_param("mfrac_pop2_pop3") model_2ed.move_lineages("pop2", "pop3", t = "tmig_pop2_pop3", p = "mfrac_pop2_pop3")

model_2ed.add_time_param('t_pop3"', lower_constraints=["tmig_pop3_pop2", "tmig_pop2_pop3"]) model_2ed.move_lineages('pop3', 'pop2', t = 't_pop3')

model_2ed.optimize(method="L-BFGS-B")`

jackkamm commented 2 years ago

It's hard for me to identify the problem here without more information. Here are some things that could help:

  1. Print out the full error message
  2. Share data and full script to reproduce the error
  3. Turn on debug logging and share the debug log:
    import logging
    logging.basicConfig(filename='debug.log', level=logging.DEBUG)
jackkamm commented 1 year ago

This is probably the same issue as here: https://github.com/popgenmethods/momi2/issues/59

I'm closing this issue now due to inactivity and to avoid duplication.