Changeset - e6ae7bfc12f2
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 20 months ago 2023-05-24 03:08:24
drewp@bigasterisk.com
logging adjustments
2 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/effect/effecteval.py
Show inline comments
 
@@ -95,25 +95,24 @@ class EffectEval2:
 
            devs.append((d, da, v))
 
        self.devs = DeviceSettings(self.graph, devs)
 

	
 
    def compute(self, inputs:EffectSettings) -> DeviceSettings:
 

	
 
        s=0
 
        for e,ea,v in inputs.asList():
 
            if not isinstance(v, float):
 
                raise TypeError
 
            if ea==L9['strength']:
 
                s = v
 

	
 
        print('scaled to', effect_scale(s, self.devs))
 
        return effect_scale(s,self.devs )
 

	
 
        return self.function(inputs)
 

	
 
def effect_scale(strength: float, devs: DeviceSettings) -> DeviceSettings:
 
    out = []
 
    for d,da,v in devs.asList():
 
        out.append((d, da, scale(v, strength)))
 
    return DeviceSettings(devs.graph, out)
 

	
 
@dataclass
 
class EffectEval:
light9/rdfdb/service.py
Show inline comments
 
import logging
 
import os
 
from pathlib import Path
 

	
 
from light9.run_local import log
 

	
 
import rdfdb.service
 
from rdflib import URIRef
 

	
 
from light9 import showconfig
 
from light9.run_local import log
 

	
 
logging.getLogger('rdfdb').setLevel(logging.INFO)
 
logging.getLogger('rdfdb.file').setLevel(logging.INFO)
 
logging.getLogger('rdfdb.graph').setLevel(logging.INFO)
 
logging.getLogger('rdfdb.net').setLevel(logging.DEBUG)
 
rdfRoot = Path(os.environ['LIGHT9_SHOW'].rstrip('/') + '/')
 
showUri = URIRef(showconfig.showUri() + '/')
 

	
 
app = rdfdb.service.makeApp(  #
 
    dirUriMap={rdfRoot: showUri},
 
    prefixes={
 
        'show': showUri,
 
        '': URIRef('http://light9.bigasterisk.com/'),
 
        'rdf': URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
 
        'rdfs': URIRef('http://www.w3.org/2000/01/rdf-schema#'),
 
        'xsd': URIRef('http://www.w3.org/2001/XMLSchema#'),
 
        'effect': URIRef('http://light9.bigasterisk.com/effect/'),
 
        'dev': URIRef('http://light9.bigasterisk.com/theater/skyline/device/'),
 
    })
 
log.info('made app')
 
\ No newline at end of file
0 comments (0 inline, 0 general)