diff --git a/cre/fact.py b/cre/fact.py index 5d27a9f..9521583 100644 --- a/cre/fact.py +++ b/cre/fact.py @@ -368,7 +368,7 @@ def _standardize_conversions(conversions, attr_type, context): stand_conv = {} for conv_type, conv_op in conversions.items(): conv_type = _standardize_type(conv_type, context) - print(attr_type) + # print(attr_type) if(isinstance(conv_op, UntypedCREFunc)): conv_op = conv_op(attr_type) assert conv_op.return_type == conv_type, f"{conv_op} does not return conversion type {conv_type}." stand_conv[conv_type] = conv_op diff --git a/cre/memset.py b/cre/memset.py index 5f1dc36..ccb7589 100644 --- a/cre/memset.py +++ b/cre/memset.py @@ -955,7 +955,7 @@ def ctor(): ''' source_to_cache('MemSetIndexer', long_hash, source) ctor = import_from_cached('MemSetIndexer', long_hash, ['ctor'])['ctor'] - print(ctor) + # print(ctor) _indexer_ctor_impls[tup] = ctor return _indexer_ctor_impls[tup] diff --git a/cre/transform/memset_builder.py b/cre/transform/memset_builder.py index de98587..4eff9bf 100644 --- a/cre/transform/memset_builder.py +++ b/cre/transform/memset_builder.py @@ -1,3 +1,4 @@ +from numba.typed import List from cre.context import cre_context from cre.memset import MemSet @@ -43,9 +44,19 @@ def tranform(self, state_dict, out_memset=None, return_map=False): if(attr not in config): continue val_name = config[attr] if(not val_name): continue # i.e. skip if None or empty str - if(val_name not in fact_instances): - raise ValueError(f"Reference to unspecified fact {val_name}.") - setattr(fact, attr, fact_instances[val_name]) + + if isinstance(val_name, list): + fact_list = [] + for elem_val_name in val_name: + if(not elem_val_name): continue # i.e. skip if None or empty str + if(elem_val_name not in fact_instances): + raise ValueError(f"Reference to unspecified fact {elem_val_name} in {val_name}.") + fact_list.append(fact_instances[elem_val_name]) + setattr(fact, attr, List(fact_list)) + else: + if(val_name not in fact_instances): + raise ValueError(f"Reference to unspecified fact {val_name}.") + setattr(fact, attr, fact_instances[val_name]) # Declare each fact to a new MemSet if(out_memset is None):