Skip to content

[CRASHFIX] Fix DisCoCirc crash when first sentence has no nouns - #262

Open
unprovable wants to merge 1 commit into
Quantinuum:mainfrom
QuantumVillage:nounless_sentence_fix
Open

unprovable wants to merge 1 commit into
Quantinuum:mainfrom
QuantumVillage:nounless_sentence_fix

Conversation

@unprovable

Copy link
Copy Markdown

text2circuit crashes with "ValueError: max() arg is an empty sequence" when a sentence has no surviving nouns and no wires exist yet, e.g. a first sentence whose nouns were all pruned, or one with no nouns at all. Such a sentence produces an empty diagram, so changed behaviour to skip it instead.

Add a test checking that pruning every noun of the first sentence gives the same circuit as the remaining text alone, in frame and sandwich mode. It is commented out for now, as it should wait until PR #261 merges, as it utilizes the _transitive_tree test helper present there.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant