Mercurial > code > home > repos > homeauto
comparison service/mqtt_to_rdf/inference.py @ 1667:a2347393b43e
comments, debug, dead code
author | drewp@bigasterisk.com |
---|---|
date | Tue, 21 Sep 2021 22:19:11 -0700 |
parents | 1a7c1261302c |
children | 89e53cb8a01c |
comparison
equal
deleted
inserted
replaced
1666:4fd9fdfcf16a | 1667:a2347393b43e |
---|---|
61 self._shortId = next(_chunkLooperShortId) | 61 self._shortId = next(_chunkLooperShortId) |
62 self._alignedMatches = list(self.lhsChunk.ruleMatchesFrom(self.workingSet)) | 62 self._alignedMatches = list(self.lhsChunk.ruleMatchesFrom(self.workingSet)) |
63 | 63 |
64 self._current = CandidateBinding({}) # only ours- do not store prev, since it could change without us | 64 self._current = CandidateBinding({}) # only ours- do not store prev, since it could change without us |
65 self._pastEnd = False | 65 self._pastEnd = False |
66 self._seenBindings: List[CandidateBinding] = [] # combined bindings (up to our ring) that we've returned | 66 self._seenBindings: List[CandidateBinding] = [] # combined bindings (up to our ring) that we've returned |
67 | 67 |
68 if ringlog.isEnabledFor(logging.DEBUG): | 68 if ringlog.isEnabledFor(logging.DEBUG): |
69 ringlog.debug('') | |
69 ringlog.debug(f'{INDENT*6} introducing {self!r}({self.lhsChunk}, {self._alignedMatches=})') | 70 ringlog.debug(f'{INDENT*6} introducing {self!r}({self.lhsChunk}, {self._alignedMatches=})') |
70 | 71 |
71 self.restart() | 72 self.restart() |
72 | 73 |
73 def _prevBindings(self) -> CandidateBinding: | 74 def _prevBindings(self) -> CandidateBinding: |
86 augmentedWorkingSet = self._alignedMatches | 87 augmentedWorkingSet = self._alignedMatches |
87 else: | 88 else: |
88 augmentedWorkingSet = list( | 89 augmentedWorkingSet = list( |
89 applyChunky(self.prev.currentBinding(), self._alignedMatches, returnBoundStatementsOnly=False)) | 90 applyChunky(self.prev.currentBinding(), self._alignedMatches, returnBoundStatementsOnly=False)) |
90 | 91 |
91 ringlog.debug(f'{INDENT*6} --> {self}.advance has {augmentedWorkingSet=} {self._current=}') | |
92 | 92 |
93 if self._advanceWithPlainMatches(augmentedWorkingSet): | 93 if self._advanceWithPlainMatches(augmentedWorkingSet): |
94 ringlog.debug(f'{INDENT*6} <-- {self}.advance finished with plain matches') | 94 ringlog.debug(f'{INDENT*6} <-- {self}.advance finished with plain matches') |
95 return | 95 return |
96 | 96 |
232 | 232 |
233 log.debug(f'{INDENT*4} vv findCandBindings iteration {iterCount}') | 233 log.debug(f'{INDENT*4} vv findCandBindings iteration {iterCount}') |
234 | 234 |
235 yield BoundLhs(self, lastRing.currentBinding()) | 235 yield BoundLhs(self, lastRing.currentBinding()) |
236 | 236 |
237 self._debugChunkStack('odometer', chunkStack) | 237 # self._debugChunkStack('odometer', chunkStack) |
238 | 238 |
239 done = self._advanceTheStack(chunkStack) | 239 done = self._advanceTheStack(chunkStack) |
240 | 240 |
241 self._debugChunkStack(f'odometer after ({done=})', chunkStack) | 241 self._debugChunkStack(f'odometer after ({done=})', chunkStack) |
242 | 242 |