mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-04 06:03:10 +00:00
enable lazy eval in config
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com> # Conflicts: # DAS/validator.py
This commit is contained in:
parent
36d098cea3
commit
5b41cecb44
15
smallConf.py
15
smallConf.py
@ -111,3 +111,18 @@ def nextShape():
|
||||
chiR = chiC = chi
|
||||
shape = Shape(blockSizeR, blockSizeRK, blockSizeC, blockSizeCK, nn, fm, fr, class1ratio, chiR, chiC, vpn1, vpn2, netDegree, bwUplinkProd, bwUplink1, bwUplink2, run)
|
||||
yield shape
|
||||
|
||||
def evalConf(self, param, shape = None):
|
||||
'''Allow lazy evaluation of params in various forms
|
||||
|
||||
Examples:
|
||||
sendLineUntilR = "shape.blockSizeRK"
|
||||
sendLineUntilC = lambda shape : shape.blockSizeCK
|
||||
perNodeQueue = "self.amIproposer"
|
||||
'''
|
||||
if callable(param):
|
||||
return param(shape)
|
||||
elif isinstance(param, str):
|
||||
return eval(param)
|
||||
else:
|
||||
return param
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user