changeset 1667:a2347393b43e

comments, debug, dead code
author drewp@bigasterisk.com
date Tue, 21 Sep 2021 22:19:11 -0700
parents 4fd9fdfcf16a
children 89e53cb8a01c
files service/mqtt_to_rdf/candidate_binding.py service/mqtt_to_rdf/inference.py
diffstat 2 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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())
 
--- 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)