Merge pull request #28 from BlockScience/fix/mechsteps_ordering
support list of mechsteps instead of dict
This commit is contained in:
commit
ef7b42a39a
|
|
@ -10,8 +10,13 @@ def print_pipe(x):
|
||||||
def flatten(l):
|
def flatten(l):
|
||||||
return [item for sublist in l for item in sublist]
|
return [item for sublist in l for item in sublist]
|
||||||
|
|
||||||
|
import warnings
|
||||||
def key_filter(l, keyname):
|
def key_filter(l, keyname):
|
||||||
|
if (type(l)==list):
|
||||||
|
return [v[keyname] for v in l]
|
||||||
|
# Keeping support to dictionaries for backwards compatibility
|
||||||
|
# Should be removed in the future
|
||||||
|
warnings.warn("The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.", FutureWarning)
|
||||||
return [v[keyname] for k, v in l.items()]
|
return [v[keyname] for k, v in l.items()]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue