Mercurial > code > home > repos > homeauto
diff service/mqtt_to_rdf/inference.py @ 1653:e7d594c065d4
minor refactoring
author | drewp@bigasterisk.com |
---|---|
date | Sun, 19 Sep 2021 13:20:39 -0700 |
parents | dddfa09ea0b9 |
children | d8e5b2232474 |
line wrap: on
line diff
--- a/service/mqtt_to_rdf/inference.py Sun Sep 19 13:19:20 2021 -0700 +++ b/service/mqtt_to_rdf/inference.py Sun Sep 19 13:20:39 2021 -0700 @@ -252,9 +252,10 @@ """make ChunkLooper for each stmt in our LHS graph, but do it in a way that they all start out valid (or else raise NoOptions). static chunks have already been confirmed.""" - log.info(f'{INDENT*2} stats={dict(stats)}') - log.info(f'{INDENT*2} taking permutations of {len(self.graph.patternChunks)=}') - for i, perm in enumerate(itertools.permutations(self.graph.patternChunks)): + log.info(f' {INDENT*4} stats={dict(stats)}') + chunks = self.graph.patternChunks.union(self.graph.chunksUsedByFuncs) + log.info(f' {INDENT*4} taking permutations of {len(chunks)=}') + for i, perm in enumerate(itertools.permutations(chunks)): stmtStack: List[ChunkLooper] = [] prev: Optional[ChunkLooper] = None if log.isEnabledFor(logging.DEBUG):