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

Uninformative Error when context not set in Scallopy #42

Open
buddha314 opened this issue Jan 25, 2025 · 0 comments
Open

Uninformative Error when context not set in Scallopy #42

buddha314 opened this issue Jan 25, 2025 · 0 comments

Comments

@buddha314
Copy link

WIthout the provenenance, this error on tuple size appears with no indication of cause

  ctx = scallopy.ScallopContext()
    
   ctx.add_relation("digit_1", int)
   ctx.add_facts("digit_1", [(random.random(), (i,)) for i in range(4)])

yields

   ctx.add_facts("digit_1", [(random.random(), (i,)) for i in range(4)])
  File "/root/miniconda3/lib/python3.12/site-packages/scallopy/utils/history.py", line 23, in wrapper
    return f(this, *pos_args, **kw_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/lib/python3.12/site-packages/scallopy/context.py", line 555, in add_facts
    self._internal.add_facts(relation, elems)
IndexError: Invalid tuple size

It is correct with this, but that wasn't clear.

  ctx = scallopy.ScallopContext(provenance="topkproofs")
    
  ctx.add_relation("digit_1", int)
  ctx.add_facts("digit_1", [(random.random(), (i,)) for i in range(4)])
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