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

local queue variable undefined #87

Open
dax-westerman opened this issue Sep 11, 2024 · 1 comment
Open

local queue variable undefined #87

dax-westerman opened this issue Sep 11, 2024 · 1 comment

Comments

@dax-westerman
Copy link
Collaborator

dax-westerman commented Sep 11, 2024

Within sequencer.py

if batch is None:
self.queue.task_done()
return

@dax-westerman
Copy link
Collaborator Author

dax-westerman commented Sep 11, 2024

Running step2.sh with --workers set to any value > 0 moves the code into a multithreaded mode. A reference to queue causes an error when hit, as it appears to be an un-initialized variable. Specifically, it's the line batch = queue.get(True) in the following:

def next_batch(self):
        if not isinstance(self.queue, str):
            try:
                batch = queue.get(True)
                if isinstance(batch, ExitProcess):
                    return None
                return batch
            except qmod.Empty:
                print("qmod empty")
                return []

Based on the code, it looks like this is a reference to the member variable self.queue.

I am trying this change in #83; if this resolves the issue, will update with comment here.

How to Replicate

Code called with the following:

python X:\_\Project - PERC\clever-rockies/src/step2/sequencer.py --lexicon "x:/_/Project - PERC/clever-rockies/res/dicts/dict.txt" --section-headers "x:/_/Project - PERC/clever-rockies/res/headers.txt" --main-targets LONELINESS --snippet-length 250 --snippets --notes "x:/_/Project - PERC/clever-rockies/tests/resources/test_notes/test_notes_with_metadata_one_line_tab_delim.txt" --workers 0 --output "x:/_/Project - PERC/clever-rockies/tests/output/LONELINESS" --left-gram-context 3 --right-gram-context 2 "

Results in infinite loop with error.

image

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

1 participant