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

unbound local variable is_global #33

Open
joshdempster opened this issue Nov 7, 2023 · 1 comment
Open

unbound local variable is_global #33

joshdempster opened this issue Nov 7, 2023 · 1 comment

Comments

@joshdempster
Copy link

Trying to call est_spectra with a gene_set_dict of the form {"global": dict of gene sets} and use_cell_types=False leads to an unbound local variable error for is_global after training. Looking through the code, this happens because in this case, check_gene_set_dictionary expects a single-layered dict for gene_set_dict. This behavior isn't in the doc string. A couple suggestions:

  • Either change this so the expected format of gene_set_dict is consistent (my personal preference), or else have check_gene_set_dictionary check if global_key is in the top layer of gene_set_dict before wrapping it in another layer.
  • Expand the doc string for est_spectra to be more explicit about the format and put an example of the format in the README
  • No matter what, check that gene_set_dict is not empty after all changes are made to it and before training
@Tobiaspk
Copy link
Collaborator

Hi, thanks for raising this issue and your suggestions. PR #35 contains a new check that gene_set_dict is not empty. Agreed, ideally the format of gene_set_dict is consistent. This should also be updated in the next release.

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