-
Notifications
You must be signed in to change notification settings - Fork 4
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
sanity check failure #492
Comments
I got a similar sanity check error with a different spec import requests
from comb_spec_searcher import CombinatorialSpecification
from tilings.tilescope import TileScopePack
uri = "https://api.permpal.com/garpur_run/62dffd741b6d843bb59a3f73"
data = requests.get(uri).json()
pack = TileScopePack.from_dict(data["pack"])
spec = CombinatorialSpecification.from_dict(data["specification"]) ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Input In [3], in <module>
----> 1 spec.sanity_check(1)
File ~/atrap/repos/comb_spec_searcher/comb_spec_searcher/specification.py:490, in CombinatorialSpecification.sanity_check(self, length)
488 try:
489 for n in range(length + 1):
--> 490 if not rule.sanity_check(n):
491 return False
492 except NotImplementedError:
File ~/atrap/repos/comb_spec_searcher/comb_spec_searcher/strategies/rule.py:543, in Rule.sanity_check(self, n)
538 def sanity_check(self, n: int) -> bool:
539 try:
540 return (
541 self._sanity_check_count(n)
542 and self._sanity_check_objects(n)
--> 543 and self._sanity_check_random_sample(n)
544 )
545 except SanityCheckFailure as e:
546 raise e
File ~/atrap/repos/comb_spec_searcher/comb_spec_searcher/strategies/rule.py:647, in Rule._sanity_check_random_sample(self, n)
645 self.subterms = tuple(child.get_terms for child in self.children)
646 try:
--> 647 self.random_sample_object_of_size(n, **possible_parameters[0][0])
648 except NotImplementedError:
649 # Skipping testing rules that have not implemented random_sampling.
650 self.subsamplers = tmpsamplers
File ~/atrap/repos/comb_spec_searcher/comb_spec_searcher/strategies/rule.py:535, in Rule.random_sample_object_of_size(self, n, **parameters)
531 total_count = self.count_objects_of_size(n=n, **parameters)
532 subobjs = self.constructor.random_sample_sub_objects(
533 total_count, self.subsamplers, self.subrecs, n, **parameters
534 )
--> 535 objs = tuple(self.backward_map(subobjs))
536 return random.choice(objs)
File ~/atrap/repos/comb_spec_searcher/comb_spec_searcher/strategies/rule.py:908, in EquivalencePathRule.backward_map(self, objs)
906 for rule in reversed(self.rules):
907 try:
--> 908 res = (next(rule.backward_map(res)),)
909 except StopIteration:
910 return
File ~/atrap/repos/comb_spec_searcher/comb_spec_searcher/strategies/rule.py:1044, in ReverseRule.backward_map(self, objs)
1042 if not len(self.original_rule.non_empty_children()) == 1:
1043 raise NotImplementedError("Cannot map forward for non equivalence rule.")
-> 1044 assert all(obj is None for obj in objs[1:])
1045 assert objs[0] is not None
1046 res = self.original_rule.forward_map(objs[0])[self.idx]
TypeError: 'NoneType' object is not subscriptable (key slice(1, None, None)) |
Two more examples: import requests
from comb_spec_searcher import CombinatorialSpecification
from tilings.tilescope import TileScopePack
uri = "https://api.permpal.com/garpur_run/62e000d667d0aaf5374f1fd5"
data = requests.get(uri).json()
pack = TileScopePack.from_dict(data["pack"])
spec = CombinatorialSpecification.from_dict(data["specification"])
spec.sanity_check(2) import requests
from comb_spec_searcher import CombinatorialSpecification
from tilings.tilescope import TileScopePack
uri = "https://api.permpal.com/garpur_run/62e004f03a0324176007e7a1"
data = requests.get(uri).json()
pack = TileScopePack.from_dict(data["pack"])
spec = CombinatorialSpecification.from_dict(data["specification"])
spec.sanity_check(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: