From 09444969ef744304bd5539d29b033ea3bd0840ec Mon Sep 17 00:00:00 2001 From: Gregory Peairs Date: Fri, 13 Nov 2026 15:50:53 +0100 Subject: [PATCH] Warn for unknown render keyword arguments --- CHANGELOG.md | 6 + docs/src/concepts/render.md | 2 + docs/src/developers/conventions.md | 7 +- docs/src/reference/api.md | 1 + src/DeviceLayout.jl | 3 + src/precompile.jl | 1 + src/render/render.jl | 5 +- src/render_kwargs.jl | 82 +++++++ src/schematics/schematics.jl | 1 + src/schematics/solidmodels.jl | 4 +- src/solidmodels/render.jl | 22 ++ src/solidmodels/solidmodels_experimental.jl | 1 + src/styles.jl | 10 +- test/test_render_kwargs.jl | 234 ++++++++++++++++++++ test/test_schematic_solidmodel.jl | 6 +- 15 files changed, 377 insertions(+), 8 deletions(-) create mode 100644 src/render_kwargs.jl create mode 100644 test/test_render_kwargs.jl diff --git a/CHANGELOG.md b/CHANGELOG.md index 95a52ef06..80a14bf31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format of this changelog is based on ## Unreleased +### Added + + - `render!` warns about each keyword argument it doesn't recognize, which it would otherwise + ignore silently, once per session and once per `Schematic` render. `OptionalStyle` flags are recognized automatically, and + `DeviceLayout.register_render_kwarg!` registers other custom rendering options. + ### Fixed - `halo` of a path style with zero extent at its start covers the rest of the style, and diff --git a/docs/src/concepts/render.md b/docs/src/concepts/render.md index 8efc88ad2..9ece40686 100644 --- a/docs/src/concepts/render.md +++ b/docs/src/concepts/render.md @@ -20,6 +20,8 @@ The behavior of [`render!`](@ref) can be customized with keyword arguments. Many Additional rendering options can be provided for user-defined [conditional rendering](#Conditional-Rendering). +When rendering to a `Cell` or `SolidModel`, `render!` warns about a keyword argument it doesn't recognize, since a misspelled option would otherwise be ignored. Flags of `OptionalStyle`s are recognized automatically; register other custom options with [`DeviceLayout.register_render_kwarg!`](@ref). + ## Targets Rendering options and the `map_meta` function can also be provided using a `Target` instead of keywords: `render!(cell, coordsys, target)`. This is especially useful in schematic-driven design, where various `Target`s can be specified as part of your [PDK](./pdks.md), allowing you to target different process technologies or simulation backends given a single design. (The name "Target" is meant to evoke "compilation target".) diff --git a/docs/src/developers/conventions.md b/docs/src/developers/conventions.md index cdb527c2d..a2758492c 100644 --- a/docs/src/developers/conventions.md +++ b/docs/src/developers/conventions.md @@ -49,9 +49,12 @@ otherwise. Throw an error rather than guess at what the user intended until changed. - The `uniquename` counter, the `Memoization` cache for B-spline tangent optimization, and the PolyText font caches are process-global. +- `render_kwargs.jl` keeps the set of keyword arguments `render!` recognizes, to which each + `OptionalStyle` adds its flag, and the set of unknown keyword arguments `render!` has + already warned about. - Some warnings are shown once per session: deprecation warnings with `maxlog=1` (see - [Deprecations](@ref dev-deprecations)), and `recover_curves` warns once per entity type - about lost curves. Test items share a process, so a test asserting such a warning + [Deprecations](@ref dev-deprecations)), `recover_curves` warns once per entity type + about lost curves, and `render!` warns once about each unknown keyword argument (until the next `Schematic` render). Test items share a process, so a test asserting such a warning depends on nothing earlier having triggered it. ## Style diff --git a/docs/src/reference/api.md b/docs/src/reference/api.md index 19b6e24f7..c7a78c161 100644 --- a/docs/src/reference/api.md +++ b/docs/src/reference/api.md @@ -288,6 +288,7 @@ See [Shapes](./shapes.md). ```@docs render! + DeviceLayout.register_render_kwarg! DeviceLayout.discretize_curve ``` diff --git a/src/DeviceLayout.jl b/src/DeviceLayout.jl index 6eba4e687..b54dbbfd4 100644 --- a/src/DeviceLayout.jl +++ b/src/DeviceLayout.jl @@ -215,6 +215,9 @@ export GeometryEntity, export transform, translate, rotate, rotate90, magnify, reflect_across_xaxis, reflect_across_line +# Before styles.jl: the `OptionalStyle` constructor registers its flag +include("render_kwargs.jl") + # Entity styles include("styles.jl") export OptionalStyle, diff --git a/src/precompile.jl b/src/precompile.jl index 54cea0926..6ffa6b5cb 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -126,6 +126,7 @@ else end # Reset any DeviceLayout-owned globals touched by workload reset_uniquename!() + reset_render_kwarg_warnings!() # Don't bake stale Clipper handles into the package image global _clip = nothing end diff --git a/src/render/render.jl b/src/render/render.jl index e3c0f445f..58a1e5ff4 100644 --- a/src/render/render.jl +++ b/src/render/render.jl @@ -40,6 +40,7 @@ function render!( meta::GDSMeta=GDSMeta(); kwargs... ) where {S} + warn_unknown_render_kwargs(kwargs) render!.(cell, to_polygons(obj; kwargs...), meta; kwargs...) return cell end @@ -104,6 +105,7 @@ function _render!( map_meta=default_meta_map, kwargs... ) where {S} + warn_unknown_render_kwargs(kwargs) stack = Vector{Tuple{Cell, GeometryReference}}() _render_elements!(cell, cs; map_meta=map_meta, memoized_cells=memoized_cells, kwargs...) @@ -222,6 +224,7 @@ Rendering a `GeometryStructure` to a `Cell` uses the optional keyword arguments its reference hierarchy) to render as `prerendered_cell`. Additional keyword arguments are passed to [`to_polygons`](@ref) for each entity and may be used for -certain entity types to control how they are converted to polygons. +certain entity types to control how they are converted to polygons. A keyword argument that is +not a known rendering option gives a warning; see [`DeviceLayout.register_render_kwarg!`](@ref). """ render!(c::Cell, s::GeometryStructure; kwargs...) = _render!(c, s; kwargs...) diff --git a/src/render_kwargs.jl b/src/render_kwargs.jl new file mode 100644 index 000000000..099ca633d --- /dev/null +++ b/src/render_kwargs.jl @@ -0,0 +1,82 @@ +# Keywords declared by the method that runs the check never reach it, so they need no entry. +# The names are not specific to the destination, so a built-in flag passed to a target that +# ignores it does not warn. +mutable struct _RenderKwargNames + # Each set is replaced rather than mutated, so `render!` reads them without the lock + @atomic known::Set{Symbol} + # Not `maxlog`: the file sink of a schematic's log ignores it, and the check runs per entity + @atomic warned::Set{Symbol} +end +const _RENDER_KWARG_NAMES = _RenderKwargNames( + Set{Symbol}([ + # Entity conversion (`to_polygons`, `SolidModels.to_primitives`) + :atol, + :rtol, + :Δθ, + :rounded, + # Forwarded to each entity when rendering to a `Cell` + :map_meta, + :memoized_cells, + # Flags of the built-in `OptionalStyle`s, set by targets + :simulation, + :artwork, + :solidmodel + ]), + Set{Symbol}() +) +# `OptionalStyle`s register their flags, and geometry may be built on several threads +const _RENDER_KWARGS_LOCK = ReentrantLock() + +""" + DeviceLayout.register_render_kwarg!(s::Symbol) + +Declare `s` a valid keyword argument for `render!`, so that passing it does not warn. + +`render!` warns about each keyword argument it does not recognize, once per session and once +per render of a `Schematic`. +Constructing an [`OptionalStyle`](@ref) registers its flag automatically. Call this for a +custom option read some other way, for example by a `to_polygons` method for your own style. + +A package that constructs an `OptionalStyle` at top level should call this for the flag in +its `__init__`, because registrations made while precompiling are not kept. +""" +function register_render_kwarg!(s::Symbol) + s in (@atomic _RENDER_KWARG_NAMES.known) && return nothing + @lock _RENDER_KWARGS_LOCK begin + known = @atomic _RENDER_KWARG_NAMES.known + @atomic _RENDER_KWARG_NAMES.known = push!(copy(known), s) + end + return nothing +end + +function warn_unknown_render_kwargs(kwargs, caller=:render!) + _all_known_or_warned(kwargs) && return nothing + unknown = @lock _RENDER_KWARGS_LOCK begin + warned = @atomic _RENDER_KWARG_NAMES.warned + new = setdiff(keys(kwargs), @atomic(_RENDER_KWARG_NAMES.known), warned) + isempty(new) || @atomic _RENDER_KWARG_NAMES.warned = union(warned, new) + new + end + for k in unknown + @warn "`$caller` does not recognize the keyword argument `$k`, which may have no effect. Check the spelling, or register a custom rendering option with `DeviceLayout.register_render_kwarg!(:$k)`." + end + return nothing +end + +# Called by each `Schematic` render, so that every schematic's log and `strict=:warn` see the +# warning +function reset_render_kwarg_warnings!() + @lock _RENDER_KWARGS_LOCK begin + @atomic _RENDER_KWARG_NAMES.warned = Set{Symbol}() + end + return nothing +end + +function _all_known_or_warned(kwargs) + known = @atomic _RENDER_KWARG_NAMES.known + warned = @atomic _RENDER_KWARG_NAMES.warned + for k in keys(kwargs) + (k in known || k in warned) || return false + end + return true +end diff --git a/src/schematics/schematics.jl b/src/schematics/schematics.jl index 7e3aef6b4..ccb75a544 100644 --- a/src/schematics/schematics.jl +++ b/src/schematics/schematics.jl @@ -1709,6 +1709,7 @@ function render!( sch.checked[] || error( "Cannot render an unchecked Schematic. Run check!(sch::Schematic), or override by setting sch.checked[] = true (not recommended!)" ) + DeviceLayout.reset_render_kwarg_warnings!() reopen_logfile(sch, :render) try with_logger(sch.logger) do diff --git a/src/schematics/solidmodels.jl b/src/schematics/solidmodels.jl index 72c91ea71..f4385988f 100644 --- a/src/schematics/solidmodels.jl +++ b/src/schematics/solidmodels.jl @@ -463,6 +463,7 @@ function render!(sm::SolidModel, sch::Schematic, target::Target; strict=:error, sch.checked[] || error( "cannot render an unchecked Schematic. Run check!(sch::Schematic), or override by setting sch.checked[] = true (not recommended!)" ) + DeviceLayout.reset_render_kwarg_warnings!() reopen_logfile(sch, :render_solidmodel) try with_logger(sch.logger) do @@ -704,6 +705,7 @@ function SolidModels.render_conformal!( sch.checked[] || error( "cannot render an unchecked Schematic. Run check!(sch::Schematic), or override by setting sch.checked[] = true (not recommended!)" ) + DeviceLayout.reset_render_kwarg_warnings!() reopen_logfile(sch, :render_solidmodel) try with_logger(sch.logger) do @@ -808,7 +810,7 @@ function _render_conformal!(sm, sch, target; context, kwargs...) ) # That render samples mesh sizes from the formed regions, which carry no `MeshSized` # styles, so sample them again from the original elements, as `render!` does - SolidModels.populate_size_fields!( + SolidModels.populate_size_fields_unchecked!( mapped; primitives_of=(el; kw...) -> SolidModels.to_primitives(sm, el; kw...), zmap, diff --git a/src/solidmodels/render.jl b/src/solidmodels/render.jl index 4f5f8823e..656a48bbe 100644 --- a/src/solidmodels/render.jl +++ b/src/solidmodels/render.jl @@ -1151,6 +1151,25 @@ function populate_size_fields!( zmap=(_) -> 0.0, curvature_sizing=true, kwargs... +) + DeviceLayout.warn_unknown_render_kwargs(kwargs, :populate_size_fields!) + return populate_size_fields_unchecked!( + cs; + primitives_of, + zmap, + curvature_sizing, + kwargs... + ) +end + +# For `render_conformal!(sm, sch, target)`, which passes all the target's rendering options, +# including those `render!` declares, after its own render has checked them +function populate_size_fields_unchecked!( + cs::AbstractCoordinateSystem; + primitives_of, + zmap, + curvature_sizing=true, + kwargs... ) flat = flatten(cs) clear_mesh_control_points!() @@ -1296,6 +1315,8 @@ Available postrendering operations include [`translate!`](@ref), [`extrude_z!`]( Additional keyword arguments are passed to [`DeviceLayout.SolidModels.to_primitives`](@ref) (which falls back to [`to_polygons`](@ref)) and may be used for certain entity types to control how entities of `cs` are converted to primitives and added to `sm`. +A keyword argument that is not a known rendering option gives a warning; see +[`DeviceLayout.register_render_kwarg!`](@ref). """ function render!( sm::SolidModel, @@ -1425,6 +1446,7 @@ function _render_orchestrator!( verbose=false, kwargs... ) where {T} + DeviceLayout.warn_unknown_render_kwargs(kwargs) t_render = time_ns() reporter = _step_reporter(verbose) gmsh.model.set_current(name(sm)) diff --git a/src/solidmodels/solidmodels_experimental.jl b/src/solidmodels/solidmodels_experimental.jl index d1bb73ac5..41c93ef0e 100644 --- a/src/solidmodels/solidmodels_experimental.jl +++ b/src/solidmodels/solidmodels_experimental.jl @@ -126,6 +126,7 @@ function render!( previous_stage_level = get(sch.logger.max_level_logged, stage, Logging.Debug) delete!(sch.logger.max_level_logged, stage) try + DeviceLayout.reset_render_kwarg_warnings!() # Route geometry preparation, construction, and postprocessing diagnostics through # the render stage so the final strictness check sees the complete operation. reopen_logfile(sch, stage) diff --git a/src/styles.jl b/src/styles.jl index dfea244e7..023d5a617 100644 --- a/src/styles.jl +++ b/src/styles.jl @@ -271,6 +271,11 @@ to_polygons(ent::GeometryEntity, ::MeshSized; kwargs...) = to_polygons(ent; kwar Style that depends on a Boolean rendering option `flag` with default `default`. +Constructing an `OptionalStyle` registers `flag` as a rendering option, so `render!` doesn't +warn about it. A package that constructs one at top level should call +[`DeviceLayout.register_render_kwarg!`](@ref) for its flag in `__init__`, because +registrations made while precompiling are not kept. + `lowerleft`, `upperright`, `bounds`, `footprint`, and `halo` are forwarded to the underlying entity styled with the default style. @@ -288,7 +293,10 @@ struct OptionalStyle <: GeometryEntityStyle false_style::GeometryEntityStyle flag::Symbol default::Bool - OptionalStyle(a::GeometryEntityStyle, b, c, d) = new(a, b, c, d) # Silence Aqua + function OptionalStyle(a::GeometryEntityStyle, b, c, d) + register_render_kwarg!(c) # So `render!(...; flag=...)` doesn't warn + return new(a, b, c, d) # Silence Aqua + end end function OptionalStyle( true_style::GeometryEntityStyle, diff --git a/test/test_render_kwargs.jl b/test/test_render_kwargs.jl new file mode 100644 index 000000000..cc330f011 --- /dev/null +++ b/test/test_render_kwargs.jl @@ -0,0 +1,234 @@ +# Each unknown keyword warns once until the warnings are reset, so each item resets them first +# and every assertion within an item uses a keyword name of its own. + +@testitem "render kwargs: unknown keywords warn" setup = [CommonTestSetup] begin + using DeviceLayout.SchematicDrivenLayout: ProcessTechnology, ArtworkTarget + DeviceLayout.reset_render_kwarg_warnings!() + + is_unknown(k) = + log -> log.level == Logging.Warn && occursin("keyword argument `$k`", log.message) + + cs = CoordinateSystem("kwargs_cs", nm) + place!(cs, Rectangle(1μm, 1μm), GDSMeta(1, 0)) + pa = Path(nm) + straight!(pa, 1μm, Paths.Trace(1μm)) + place!(cs, pa, GDSMeta()) + + # Structure entry; the entity and path entries reached from it don't repeat the warning + logs, _ = Test.collect_test_logs() do + return render!(Cell("c", nm), cs; atoll=1.0nm) + end + @test count(is_unknown(:atoll), logs) == 1 + + # Once per keyword: repeats are silent, but a different keyword still warns + logs, _ = Test.collect_test_logs() do + for _ = 1:5 + render!(Cell("c", nm), cs; atoll=1.0nm) + end + return render!(Cell("c", nm), cs; atoll=1.0nm, tol=1.0nm) + end + @test count(is_unknown(:atoll), logs) == 0 + @test count(is_unknown(:tol), logs) == 1 + + # Through a target + target = ArtworkTarget(ProcessTechnology((; base=GDSMeta(1, 0)), (;))) + logs, _ = Test.collect_test_logs() do + return render!(Cell("c", nm), cs, target; target_typo=1.0nm) + end + @test count(is_unknown(:target_typo), logs) == 1 + + # `Cell(cs)`, even with no entity to check + logs, _ = Test.collect_test_logs() do + return Cell(CoordinateSystem("kwargs_empty", nm); cell_typo=1.0nm) + end + @test count(is_unknown(:cell_typo), logs) == 1 + + # Entity and path entries called directly + logs, _ = Test.collect_test_logs() do + render!(Cell("c", nm), Rectangle(1μm, 1μm), GDSMeta(); entity_typo=1.0nm) + return render!(Cell("c", nm), pa, GDSMeta(); path_typo=1.0nm) + end + @test count(is_unknown(:entity_typo), logs) == 1 + @test count(is_unknown(:path_typo), logs) == 1 +end + +@testitem "render kwargs: schematic log" setup = [CommonTestSetup] begin + using DeviceLayout.SchematicDrivenLayout + DeviceLayout.reset_render_kwarg_warnings!() + + dir = mktempdir() + target = ArtworkTarget(ProcessTechnology((; base=GDSMeta(1, 0)), (;))) + # A second schematic with the same typo warns again, in its own log + for name in ("kwargs_sch", "kwargs_sch_2") + logs, _ = Test.collect_test_logs() do + sch = plan(SchematicGraph(name); log_dir=dir) + for i = 1:50 + place!(sch.coordinate_system, Rectangle(1μm, 1μm) + Point(2i, 0)μm, :base) + end + check!(sch) + # `strict=:warn` sees the warning, which reaches the log file once, not per entity + @test_throws ErrorException render!( + Cell("c", nm), + sch, + target; + schematic_typo=1.0nm, + strict=:warn + ) + end + @test count("`schematic_typo`", read(joinpath(dir, "$name.log"), String)) == 1 + @test count(log -> occursin("`schematic_typo`", log.message), logs) == 1 + end +end + +@testitem "render kwargs: SolidModel" setup = [CommonTestSetup, QuietGmshSetup] begin + using DeviceLayout.SchematicDrivenLayout + import DeviceLayout.SolidModelsExperimental + DeviceLayout.reset_render_kwarg_warnings!() + + is_unknown(k) = + log -> log.level == Logging.Warn && occursin("keyword argument `$k`", log.message) + + cs = CoordinateSystem("kwargs_sm_cs", nm) + place!(cs, Rectangle(1μm, 1μm), SemanticMeta(:base)) + logs, _ = Test.collect_test_logs() do + render!(SolidModel("kwargs_sm"; overwrite=true), cs; zmapp=identity) + SolidModels.render_conformal!( + SolidModel("kwargs_conformal"; overwrite=true), + cs; + conformal_typo=1 + ) + return SolidModels.populate_size_fields!(cs; size_typo=1) + end + @test count(is_unknown(:zmapp), logs) == 1 + @test count(is_unknown(:conformal_typo), logs) == 1 + @test count(is_unknown(:size_typo), logs) == 1 + @test any(log -> startswith(log.message, "`populate_size_fields!` does not"), logs) + + # In the target's rendering options, through a schematic + dir = mktempdir() + tech = ProcessTechnology((;), (; height=(; base=0μm), thickness=(; base=1μm))) + logs, _ = Test.collect_test_logs() do + sch = plan(SchematicGraph("kwargs_sm_sch"); log_dir=dir) + for i = 1:20 + place!(sch.coordinate_system, Rectangle(1μm, 1μm) + Point(2i, 0)μm, :base) + end + check!(sch) + return render!( + SolidModel("kwargs_sm_sch"; overwrite=true), + sch, + SolidModelTarget(tech; target_sm_typo=1); + strict=:no + ) + end + @test count("`target_sm_typo`", read(joinpath(dir, "kwargs_sm_sch.log"), String)) == 1 + @test count(is_unknown(:target_sm_typo), logs) == 1 + + # Each conformal schematic render warns in its own log, and not about the target's + # options that `render!` declares + for name in ("kwargs_conformal_sch", "kwargs_conformal_sch_2") + conformal_logs, _ = Test.collect_test_logs() do + sch = plan(SchematicGraph(name); log_dir=dir) + place!(sch.coordinate_system, Rectangle(1μm, 1μm), :base) + check!(sch) + @test_throws ErrorException SolidModels.render_conformal!( + SolidModel(name; overwrite=true), + sch, + SolidModelTarget(tech; skip_unused_layers=true, auto_union=true); + conformal_sch_typo=1, + strict=:warn + ) + end + @test count("`conformal_sch_typo`", read(joinpath(dir, "$name.log"), String)) == 1 + @test count(log -> log.level == Logging.Warn, conformal_logs) == 1 + end + + # Same for the experimental schematic render, which also opens its own log + exp_target = SolidModelsExperimental.SolidModelTarget( + SolidModelsExperimental.SourceStack( + :metal => SolidModelsExperimental.SourceLayer( + SolidModelsExperimental.METAL; + level=1, + offset=0.0, + thickness=0.0 + ); + levels=(1 => 0.0,) + ) + ) + for name in ("kwargs_exp_sch", "kwargs_exp_sch_2") + exp_logs, _ = Test.collect_test_logs() do + cs = CoordinateSystem{Float64}("$(name)_cs") + place!(cs, Rectangle(10.0, 10.0), SolidModelsExperimental.LayerRef(:metal)) + sg = SchematicGraph(name) + add_node!(sg, BasicComponent(cs); base_id="q1") + sch = check!(plan(sg; log_dir=dir)) + @test_throws ErrorException render!( + SolidModel(name; overwrite=true), + sch, + exp_target; + select_terminals=false, # the fixture has no Ground locator + exp_sch_typo=1, + strict=:warn + ) + end + @test count("`exp_sch_typo`", read(joinpath(dir, "$name.log"), String)) == 1 + @test count(log -> log.level >= Logging.Warn, exp_logs) == 1 + end +end + +@testitem "render kwargs: known keywords don't warn" setup = + [CommonTestSetup, QuietGmshSetup] begin + using DeviceLayout.SchematicDrivenLayout + DeviceLayout.reset_render_kwarg_warnings!() + + cs = CoordinateSystem("known_cs", nm) + place!(cs, Rectangle(1μm, 1μm), GDSMeta(1, 0)) + place!(cs, Circle(1μm), GDSMeta(1, 0)) + sm_cs = CoordinateSystem("known_sm_cs", nm) + place!(sm_cs, Circle(1μm), SemanticMeta(:base)) + target = ArtworkTarget(ProcessTechnology((; base=GDSMeta(1, 0)), (;))) + tech = ProcessTechnology((;), (; height=(; base=0μm), thickness=(; base=1μm))) + + @test_logs min_level = Logging.Warn begin + render!(Cell("c", nm), cs; atol=0.5nm, rtol=1e-3, map_meta=identity) + render!(Cell("c", nm), cs; Δθ=5°) + render!(Cell("c", nm), cs; simulation=true, artwork=false, solidmodel=false) + render!(Cell("c", nm), cs, target) # Target sets `simulation` and `artwork` + render!( + SolidModel("known_sm"; overwrite=true), + sm_cs; + zmap=(_) -> 0nm, + auto_union=true, + curvature_sizing=false, + Δθ=10° + ) + sch = plan(SchematicGraph("known_sch"); log_dir=nothing) + place!(sch.coordinate_system, Circle(1μm), :base) + check!(sch) + render!( + SolidModel("known_sch"; overwrite=true), + sch, + SolidModelTarget(tech; skip_unused_layers=true); + component_fragment=:global, + post_fragment_ops=[] + ) + end +end + +@testitem "render kwargs: registration" setup = [CommonTestSetup] begin + DeviceLayout.reset_render_kwarg_warnings!() + cs = CoordinateSystem("reg_cs", nm) + place!(cs, Rectangle(1μm, 1μm), GDSMeta(1, 0)) + + # OptionalStyle registers its flag + place!(cs, optional_entity(Rectangle(1μm, 1μm), :kwargs_test_flag), GDSMeta(1, 0)) + @test_logs min_level = Logging.Warn render!(Cell("c", nm), cs; kwargs_test_flag=true) + + # Manual registration, of a name that is new each time this item runs + manual = Symbol(:kwargs_test_manual_, gensym()) + logs, _ = Test.collect_test_logs() do + return render!(Cell("c", nm), cs; manual => true) + end + @test count(log -> occursin("keyword argument `$manual`", log.message), logs) == 1 + DeviceLayout.register_render_kwarg!(manual) + @test_logs min_level = Logging.Warn render!(Cell("c", nm), cs; manual => true) +end diff --git a/test/test_schematic_solidmodel.jl b/test/test_schematic_solidmodel.jl index d2765dea7..297e2ce67 100644 --- a/test/test_schematic_solidmodel.jl +++ b/test/test_schematic_solidmodel.jl @@ -466,10 +466,10 @@ end SolidModels.clear_mesh_control_points!() cp_schematic = deepcopy( - SolidModels.populate_size_fields!(floorplan.coordinate_system; fine_mesh=true) + SolidModels.populate_size_fields!(floorplan.coordinate_system; finemesh=true) ) @test !isempty(cp_schematic) - @test (1.0, 0.8) in keys(cp_schematic) || (10.0, 0.9) in keys(cp_schematic) + @test (1.0, 0.8) in keys(cp_schematic) # Render to a solid model tech = ProcessTechnology( @@ -547,7 +547,7 @@ end ], simulation=true, solidmodel=true, - fine_mesh=true + finemesh=true ) sm = SolidModel("test", overwrite=true)