Skip to content

'Values are either not list nor dict' error from var2value function in model.py #114

Closed

Description

@stevemussmann

Good afternoon,

I have been trying to run the gadma-run_ls_on_boot_data script and keep receiving the following error:

Traceback (most recent call last):
  File "/home/mussmann/miniconda3/envs/gadma/bin/gadma-run_ls_on_boot_data", line 10, in <module>
    sys.exit(main())
  File "/home/mussmann/miniconda3/envs/gadma/lib/python3.8/site-packages/gadma/run_ls_on_boot_data.py", line 247, in main
    res = run_job((fs_filename, fs, p0, settings))
  File "/home/mussmann/miniconda3/envs/gadma/lib/python3.8/site-packages/gadma/run_ls_on_boot_data.py", line 50, in run_job
    theta = engine.get_theta(popt, *grid_size)
  File "/home/mussmann/miniconda3/envs/gadma/lib/python3.8/site-packages/gadma/engines/dadi_engine.py", line 170, in get_theta
    return super(DadiEngine, self).get_theta(values, pts)
  File "/home/mussmann/miniconda3/envs/gadma/lib/python3.8/site-packages/gadma/engines/dadi_moments_common.py", line 136, in get_theta
    key = self._get_key(values, grid_sizes)
  File "/home/mussmann/miniconda3/envs/gadma/lib/python3.8/site-packages/gadma/engines/dadi_moments_common.py", line 71, in _get_key
    var2value = self.model.var2value(x)
  File "/home/mussmann/miniconda3/envs/gadma/lib/python3.8/site-packages/gadma/models/model.py", line 127, in var2value
    raise TypeError(f"Values are either not list nor dict: {values}")
TypeError: Values are either not list nor dict: None

The command I have been using is gadma-run_ls_on_boot_data -b sfs/ -d "gadma/3pop/efh_slow/models/m1/best_logLL_model_dadi_code.py" -o step1/ --opt log

When trying to troubleshoot the issue I noticed that I was running gadma v2.0.0, so I tried updating to v2.0.3 and still received the same error. I also get basically the same error in v2.0.0 if I try running the best_logLL_model_moments_code.py file.

Do you have any ideas of what may be causing the issue, or any recommendations for troubleshooting?

Activity

  1. changed the title [-]'Values are either not list nor dict' error from var2val function in model.py[/-] [+]'Values are either not list nor dict' error from var2value function in model.py[/+] on Apr 30, 2026
  2. stevemussmann commented on Apr 30, 2026

    @stevemussmann
    Author

    I have also attached my .sfs and .py files here (renamed to .txt since it won't let me upload .py or .sfs files)

    CVWS-IND-EFH_2026.txt
    best_logLL_model_dadi_code.txt
    best_logLL_model_moments_code.txt

  3. noscode commented on May 1, 2026

    @noscode
    Collaborator

    Hi @stevemussmann ,

    Thank you for your feedback, that is very interesting. I think the issue is in the first element of lower_bound and upper_bound. Can you remove 1.0 from lower_bound and 100000000.0 from upper_bound and check if that helps?

    Is it true that you have not modified code files generated my GADMA and that these two values were originally there? If so, then this confirms that there is a bug in GADMA that I need to fix. Thank you.

    Best,
    Ekaterina

  4. stevemussmann commented on May 1, 2026

    @stevemussmann
    Author

    Hi Ekaterina,

    Thank you for your quick response. I will remove those and report back what happens later today.

    That is correct, I did not modify the code files in any way.

    Thank you,

    -Steve

  5. stevemussmann commented on May 1, 2026

    @stevemussmann
    Author

    Hi @noscode ,

    I followed your suggestion and although gadma-run_ls_on_boot_data has not yet finished running, it has run far past the point where it crashed yesterday. It seems it will probably complete sometime after I go home for the day, but I will update again once it finishes.

    -Steve

  6. stevemussmann commented on May 4, 2026

    @stevemussmann
    Author

    Hi @noscode ,

    This completed successfully over the weekend. If you need any information from me to help troubleshoot the bug that caused this, just let me know.

    Thanks for your help,

    -Steve

  7. noscode commented on May 6, 2026

    @noscode
    Collaborator

    Thank you very much for your feedback and help, I hope this bug can be easily resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions