forked from M-Labs/artiq
1
0
Fork 0

language,worker: preserve order of arguments

This commit is contained in:
Sebastien Bourdeauducq 2015-07-17 19:32:38 +02:00
parent 6b36d93cc2
commit 2576036ba1
2 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,4 @@
from collections import OrderedDict
from inspect import isclass from inspect import isclass
@ -41,7 +42,7 @@ class HasEnvironment:
parameters, results, arguments).""" parameters, results, arguments)."""
def __init__(self, dmgr=None, pdb=None, rdb=None, *, def __init__(self, dmgr=None, pdb=None, rdb=None, *,
param_override=dict(), default_arg_none=False, **kwargs): param_override=dict(), default_arg_none=False, **kwargs):
self.requested_args = dict() self.requested_args = OrderedDict()
self.__dmgr = dmgr self.__dmgr = dmgr
self.__pdb = pdb self.__pdb = pdb

View File

@ -127,8 +127,8 @@ def examine(dmgr, pdb, rdb, file):
if name[-1] == ".": if name[-1] == ".":
name = name[:-1] name = name[:-1]
exp_inst = exp_class(dmgr, pdb, rdb, default_arg_none=True) exp_inst = exp_class(dmgr, pdb, rdb, default_arg_none=True)
arguments = {k: v.describe() arguments = [(k, v.describe())
for k, v in exp_inst.requested_args.items()} for k, v in exp_inst.requested_args.items()]
register_experiment(class_name, name, arguments) register_experiment(class_name, name, arguments)