diff --git a/docs/_toc.yml b/docs/_toc.yml index db1b78e9..0556e36d 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -69,7 +69,5 @@ parts: - file: changelog - url: https://gdsfactory.github.io/gdsfactory title: gdsfactory - - url: https://github.com/gdsfactory/gdsfactory-photonics-training + - url: https://gdsfactory.github.io/gdsfactory-photonics-training/index.html title: gdsfactory-photonics-training - - url: https://piel.readthedocs.io/en/latest/index.html - title: electronics-integration diff --git a/gplugins/femwell/mode_solver.py b/gplugins/femwell/mode_solver.py index ea0698db..2ab3e1ba 100644 --- a/gplugins/femwell/mode_solver.py +++ b/gplugins/femwell/mode_solver.py @@ -120,15 +120,15 @@ def compute_component_slice_modes( Keyword Args: resolutions (Dict): Pairs {"layername": {"resolution": float, "distance": "float}} to roughly control mesh refinement within and away from entity, respectively. - mesh_scaling_factor (float): factor multiply mesh geometry by. - default_resolution_min (float): gmsh minimal edge length. - default_resolution_max (float): gmsh maximal edge length. + default_characteristic_length (float): gmsh characteristic length. background_tag (str): name of the background layer to add (default: no background added). background_padding (Tuple): [xleft, ydown, xright, yup] distances to add to the components and to fill with background_tag. + background_remeshing_file (str): filename to load background remeshing from. global_meshsize_array: np array [x,y,z,lc] to parametrize the mesh. global_meshsize_interpolant_func: interpolating function for global_meshsize_array. extra_shapes_dict: Optional[OrderedDict] of {key: geo} with key a label and geo a shapely (Multi)Polygon or (Multi)LineString of extra shapes to override component. merge_by_material: boolean, if True will merge polygons from layers with the same layer.material. Physical keys will be material in this case. + wafer_layer: layer to use for WAFER padding. """ # Mesh diff --git a/gplugins/klayout/drc/count_drc.py b/gplugins/klayout/drc/count_drc.py index 8cbd1a48..8b9f6404 100644 --- a/gplugins/klayout/drc/count_drc.py +++ b/gplugins/klayout/drc/count_drc.py @@ -24,29 +24,32 @@ def count_drc(rdb_path: PathType, threshold: int = 0) -> dict[str, int]: if not rdb_path.exists(): raise FileNotFoundError(f"Cannot find {rdb_path}") - if rdb_path.is_dir(): - for rdb_file in rdb_path.glob("*.rdb"): - errors_dict[rdb_file.stem] = count_drc(rdb_file) + if not rdb_path.is_dir(): + return _get_errors(rdb_path, threshold, errors_dict) + for rdb_file in rdb_path.glob("*.rdb"): + errors_dict[rdb_file.stem] = count_drc(rdb_file) - else: - r = rdb.ReportDatabase() - r.load(rdb_path) + return errors_dict - categories = {cat.rdb_id(): cat for cat in r.each_category()} - errors_total = 0 +def _get_errors(rdb_path, threshold, errors_dict): + r = rdb.ReportDatabase() + r.load(rdb_path) - for category_id, category in categories.items(): - errors_per_category = r.each_item_per_category(category_id) - errors = len(list(errors_per_category)) - errors_total += errors + categories = {cat.rdb_id(): cat for cat in r.each_category()} - if errors > threshold: - errors_dict[category.name()] = errors + errors_total = 0 - errors_dict["total"] = errors_total - return dict(sorted(errors_dict.items(), key=lambda item: item[1], reverse=True)) - return errors_dict + for category_id, category in categories.items(): + errors_per_category = r.each_item_per_category(category_id) + errors = len(list(errors_per_category)) + errors_total += errors + + if errors > threshold: + errors_dict[category.name()] = errors + + errors_dict["total"] = errors_total + return dict(sorted(errors_dict.items(), key=lambda item: item[1], reverse=True)) def write_yaml(rdb_path: PathType, filepath: PathType, threshold: int = 0) -> None: diff --git a/gplugins/klayout/tests/test_global_density.py b/gplugins/klayout/tests/test_global_density.py index 17e5723b..a718b6db 100644 --- a/gplugins/klayout/tests/test_global_density.py +++ b/gplugins/klayout/tests/test_global_density.py @@ -22,9 +22,7 @@ def component_test_density1( small_rect2_offset=(25, 25), ): c = gf.Component() - _large_rect = c << gf.components.rectangle( - size=large_rect_size, layer=(1, 0), centered=True - ) + _ = c << gf.components.rectangle(size=large_rect_size, layer=(1, 0), centered=True) small_rect1 = c << gf.components.rectangle( size=small_rect1_size, layer=(2, 0), centered=True ) @@ -60,7 +58,7 @@ def manual_density_calculation( small_rect1_size=small_rect1_sizes[0], small_rect2_size=small_rect2_sizes[0], ), -] * 3 + [0.5] +] * 3 + [0.125] @pytest.mark.parametrize( @@ -87,7 +85,6 @@ def test_estimate_weighted_global_density( tile_size, expected_global_density, ): - # Create test gds gdspath = PATH.test_data / "test_gds_global_density.gds" test_component = component_test_density1( large_rect_size=large_rect_size, @@ -108,5 +105,5 @@ def test_estimate_weighted_global_density( estimated_density = estimate_weighted_global_density( Xi=Xi, Yi=Yi, Zi=Zi, bbox=get_gds_bbox(gdspath) ) - + print(estimated_density, expected_global_density) assert np.isclose(estimated_density, expected_global_density)