# HG changeset patch # User drewp@bigasterisk.com # Date 1632287951 25200 # Node ID a2347393b43e0bd2b619599513f4bac68f5acbb0 # Parent 4fd9fdfcf16a93120c59a29cc39423ac1ea0efc9 comments, debug, dead code diff -r 4fd9fdfcf16a -r a2347393b43e service/mqtt_to_rdf/candidate_binding.py --- a/service/mqtt_to_rdf/candidate_binding.py Mon Sep 20 23:20:46 2021 -0700 +++ b/service/mqtt_to_rdf/candidate_binding.py Tue Sep 21 22:19:11 2021 -0700 @@ -12,7 +12,7 @@ INDENT = ' ' -class BindingConflict(ValueError): +class BindingConflict(ValueError): # might be the same as `Inconsistent` pass @@ -56,11 +56,6 @@ raise BindingConflict(f'thought {k} would be {self.binding[k]} but another Evaluation said it should be {v}') self.binding[k] = v - def subtract(self, removeBindings: 'CandidateBinding'): - for k, v in removeBindings.binding.items(): - if k in self.binding: - del self.binding[k] - def copy(self): return CandidateBinding(self.binding.copy()) diff -r 4fd9fdfcf16a -r a2347393b43e service/mqtt_to_rdf/inference.py --- a/service/mqtt_to_rdf/inference.py Mon Sep 20 23:20:46 2021 -0700 +++ b/service/mqtt_to_rdf/inference.py Tue Sep 21 22:19:11 2021 -0700 @@ -63,9 +63,10 @@ self._current = CandidateBinding({}) # only ours- do not store prev, since it could change without us self._pastEnd = False - self._seenBindings: List[CandidateBinding] = [] # combined bindings (up to our ring) that we've returned + self._seenBindings: List[CandidateBinding] = [] # combined bindings (up to our ring) that we've returned if ringlog.isEnabledFor(logging.DEBUG): + ringlog.debug('') ringlog.debug(f'{INDENT*6} introducing {self!r}({self.lhsChunk}, {self._alignedMatches=})') self.restart() @@ -88,7 +89,6 @@ augmentedWorkingSet = list( applyChunky(self.prev.currentBinding(), self._alignedMatches, returnBoundStatementsOnly=False)) - ringlog.debug(f'{INDENT*6} --> {self}.advance has {augmentedWorkingSet=} {self._current=}') if self._advanceWithPlainMatches(augmentedWorkingSet): ringlog.debug(f'{INDENT*6} <-- {self}.advance finished with plain matches') @@ -234,7 +234,7 @@ yield BoundLhs(self, lastRing.currentBinding()) - self._debugChunkStack('odometer', chunkStack) + # self._debugChunkStack('odometer', chunkStack) done = self._advanceTheStack(chunkStack)