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

UnboundLocalError: local variable 'chr_results' referenced before assignment #7

Open
yuanlizhanshi opened this issue Nov 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@yuanlizhanshi
Copy link

yuanlizhanshi commented Nov 27, 2024

Error on the dev branch (0.3.5) version:

--> 269 adata.varp[key] = sliding_graphical_lasso(
270 adata=adata,
271 window_size=window_size,
272 unit_distance=unit_distance,
273 distance_constraint=distance_constraint,
274 s=s,
275 organism=organism,
276 max_alpha_iteration=max_alpha_iteration,
277 distance_parameter_convergence=distance_parameter_convergence,
278 max_elements=max_elements,
279 n_samples=n_samples,
280 n_samples_maxtry=n_samples_maxtry,
281 seed=seed,
282 njobs=njobs,
283 verbose=verbose
284 )

File ~/miniconda3/envs/omicverse/lib/python3.10/site-packages/circe/circe.py:1036, in sliding_graphical_lasso(adata, window_size, unit_distance, distance_constraint, s, organism, max_alpha_iteration, distance_parameter_convergence, max_elements, n_samples, n_samples_maxtry, init_method, verbose, seed, njobs, threads_per_worker)
1033 except Exception as e:
1034 logger.warning("Exception occurred: %s", e)
-> 1036 full_results = sp.sparse.block_diag(chr_results)
1038 # Display collected log messages at the end of the script
1039 if verbose:

UnboundLocalError: local variable 'chr_results' referenced before assignment

@r-trimbour r-trimbour self-assigned this Nov 27, 2024
@r-trimbour
Copy link
Member

r-trimbour commented Nov 27, 2024

Hi !

I wasn't able to reproduce your issue on the data you send, the code ran through for me. I just updated the verbose in the dev branch to make debugging easier when re-downloading.

It's thus more likely a package compatibility version issue that a data compatibility issue.

  1. If you're working with conda, maybe you can try to create a new empty environment and run it there ?
  2. Can you try running there: ci.compute_atac_network(atac, verbose=True) if you still have the issue ? It should now displays more details.
  3. If you have still the issue then, could send me the package version of your environment to try to reproduce the error ?
    You can have it with pip list and conda list

@r-trimbour r-trimbour added the bug Something isn't working label Nov 27, 2024
@r-trimbour
Copy link
Member

Hi @yuanlizhanshi,
Could you solve your problem ?
I'll close the issue by the end of the week :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants