diff --git a/lymask/invocation.py b/lymask/invocation.py index 0d17f4d..7b52399 100644 --- a/lymask/invocation.py +++ b/lymask/invocation.py @@ -21,7 +21,7 @@ def _main(layout, ymlfile, tech_obj=None): assert_valid_dataprep_steps(step_list) for func_info in step_list: func_name, kwargs = func_info_to_func_and_kwargs(func_info) - message('lymask doing {}'.format(func_name)) + message('lymask doing {}: {}'.format(func_name, kwargs)) func = all_dpfunc_dict[func_name] for TOP_ind in layout.each_top_cell(): # call it @@ -42,7 +42,7 @@ def _drc_main(layout, ymlfile, tech_obj=None): for func_info in step_list: func_name, kwargs = func_info_to_func_and_kwargs(func_info) - message('lymask doing {}'.format(func_name)) + message('lymask doing {}: {}'.format(func_name, kwargs)) func = all_drcfunc_dict[func_name] for TOP_ind in layout.each_top_cell(): func(layout.cell(TOP_ind), rdb, **kwargs) diff --git a/lymask/library.py b/lymask/library.py index a76c4db..ae3bbb1 100644 --- a/lymask/library.py +++ b/lymask/library.py @@ -4,7 +4,7 @@ from __future__ import division, print_function, absolute_import from functools import wraps from lymask.utilities import active_technology, lys -from lygadgets import pya, message_loud +from lygadgets import pya, message, message_loud try: dbu = active_technology().dbu @@ -15,11 +15,20 @@ def as_region(cell, layname): ''' Mostly a convenience brevity function. If a layer isn't in the layer set, return an empty region instead of crashing + If a list, will return the union of the listed layers ''' - try: - return pya.Region(cell.shapes(lys[layname])) - except KeyError: - return pya.Region() + if isinstance(layname, (list, tuple)): + union = pya.Region() + for one_lay in layname: + union += as_region(cell, one_lay) + return union + else: + try: + pya_layer = lys[layname] + except KeyError: + message(f'{layname} not found in layerset.') + return pya.Region() + return pya.Region(cell.shapes(pya_layer)) _thread_count = None diff --git a/lymask/utilities.py b/lymask/utilities.py index 30f0147..b9d643d 100644 --- a/lymask/utilities.py +++ b/lymask/utilities.py @@ -1,6 +1,6 @@ from __future__ import division, print_function, absolute_import import os -from lygadgets import isGUI, pya, message, lyp_to_layerlist, patch_environment +from lygadgets import isGUI, pya, message, message_loud, lyp_to_layerlist, patch_environment from lygadgets.technology import Technology, klayout_last_open_technology #: This global variable to be deprecated