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

Possibly using variable before assignment #1044

Open
ns-rse opened this issue Dec 10, 2024 · 0 comments
Open

Possibly using variable before assignment #1044

ns-rse opened this issue Dec 10, 2024 · 0 comments
Labels

Comments

@ns-rse
Copy link
Collaborator

ns-rse commented Dec 10, 2024

I touched topostats/tracing/ordered_tracing.py and pylint reported some possible problems that may come back to bite us...

topostats/tracing/ordered_tracing.py:937:40: E0606: Possibly using variable 'ordered_traces_data' before assignment (possibly-used-before-assignment)
topostats/tracing/ordered_tracing.py:945:12: E0606: Possibly using variable 'tracing_stats' before assignment (possibly-used-before-assignment)
topostats/tracing/ordered_tracing.py:948:42: E0606: Possibly using variable 'grain_molstats' before assignment (possibly-used-before-assignment)
topostats/tracing/ordered_tracing.py:958:23: E0606: Possibly using variable 'images' before assignment (possibly-used-before-assignment)

If any of the earlier stages that generate these fails then they will not exist when they are added to the various dictionaries noted at the above lines.

We probably need a try: ... except: in case any of the tracing methods fail for a given grain.

@ns-rse ns-rse added the v2.3.2 label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant