def finalize(associations): """Check validity and duplications in an association list Parameters ---------- associations:[association[, ...]] List of associations Returns ------- finalized_associations : [association[, ...]] The validated list of associations """ finalized_asns = [] lv2_asns = [] for asn in associations: if isinstance(asn, DMSLevel2bBase): finalized = asn.finalize() if finalized is not None: lv2_asns.extend(finalized) else: finalized_asns.append(asn) # Having duplicate Level 2 associations is expected. # Suppress warnings. with warnings.catch_warnings(): warnings.simplefilter('ignore') lv2_asns = prune_duplicate_products(lv2_asns) # Ensure sequencing is correct. Utility_Level3.resequence(lv2_asns) return finalized_asns + lv2_asns
def finalize(associations): """Check validity and duplications in an association list Parameters ---------- associations:[association[, ...]] List of associations Returns ------- finalized_associations : [association[, ...]] The validated list of associations """ finalized_asns = [] lv2_asns = [] for asn in associations: if isinstance(asn, DMSLevel2bBase): finalized = asn.finalize() if finalized is not None: lv2_asns.extend(finalized) else: finalized_asns.append(asn) lv2_asns = prune_duplicate_products(lv2_asns) # Ensure sequencing is correct. Utility_Level3.resequence(lv2_asns) return finalized_asns + lv2_asns
def resequence(*args, **kwargs): """Resequence the numbers to conform to level 3 asns""" return Utility_Level3.resequence(*args, **kwargs)
def get_exposure_type(*args, **kwargs): return Utility_Level3.get_exposure_type(*args, **kwargs)
def resequence(*args, **kwargs): return Utility_Level3.resequence(*args, **kwargs)