Skip to content

Commit 101dec1

Browse files
committed
docs: Minor fixes
1 parent 6865fdd commit 101dec1

11 files changed

+38
-54
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ The format of this changelog is based on
88

99
- Added `set_periodic!` to `SolidModels` to enable periodic meshes.
1010

11+
### Fixed
12+
13+
- `DecoratedStyle` and `CompoundStyle` are no longer missing any of the methods `width`, `trace`, or `gap` (forwarded to the underlying style)
14+
1115
## 1.2.0 (2025-04-28)
1216

1317
- Composite components can define `_build_subcomponents` to return a `NamedTuple` with keys that differ from component names

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ DeviceLayout.jl provides functionality for 2D/2.5D device CAD, including generat
2424

2525
## Installation
2626

27-
Julia can be downloaded [here](https://julialang.org/downloads/). We support Julia v1.10 or later.
27+
You can follow [these instructions](https://julialang.org/install/) to install Julia. We support Julia v1.10 or later.
2828

29-
From Julia, install DeviceLayout.jl using the built-in package manager:
29+
From Julia, install DeviceLayout.jl using the built-in package manager, [Pkg.jl](https://pkgdocs.julialang.org/v1/getting-started/):
3030

31-
```julia
32-
import Pkg
33-
Pkg.activate(".") # Activates an environment in the current directory
34-
Pkg.add("DeviceLayout")
31+
```r
32+
julia> ] # Pressing ] in the Julia REPL activates the Pkg REPL mode
33+
pkg> activate . # Activates an environment in the current directory
34+
pkg> add DeviceLayout # Adds DeviceLayout.jl to the environment
3535
```
3636

3737
We recommend [using an environment for each project](https://julialang.github.io/Pkg.jl/v1/environments/) rather than installing packages in the default environment.
@@ -47,15 +47,16 @@ The recommended IDE for Julia is [Visual Studio Code](https://code.visualstudio.
4747
with the [Julia for Visual Studio Code extension](https://www.julia-vscode.org/).
4848

4949
Since Julia has a just-in-time compiler, the first time code is executed may take much
50-
longer than any other times. This means that a lot of time will be wasted repeating
51-
compilations if you run DeviceLayout.jl in a script like you would in other languages. For
52-
readability, it is best to split up your CAD code into functions that have clearly named
53-
inputs and perform a well-defined task.
50+
longer than subsequent times in the same Julia session. This means that a lot of time will be wasted repeating
51+
compilations if you run your DeviceLayout.jl code by calling a script from the command line each time,
52+
like you might in other languages.
5453

55-
It is also best to avoid writing statements in global scope. In other words, put most of
56-
your code in a function. Your CAD script should ideally look like the following:
54+
For readability, it is best to split up your CAD code into functions that have clearly named
55+
inputs and perform a well-defined task. It is also best to avoid writing statements in global scope.
56+
In other words, put most of your code in a function. Your CAD script should ideally look like the following:
5757

5858
```julia
59+
# mycad.jl
5960
using DeviceLayout, DeviceLayout.PreferredUnits, FileIO
6061

6162
function subroutine1()

docs/src/examples/singletransmon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ mesh to disk as `single_transmon.msh2` in the Gmsh 2.2 mesh format, and
109109
`single_transmon.gds`. Finally, there's a `mesh_order` keyword that sets the element
110110
order for the generated mesh.
111111

112-
The schematic design is significantly simplied compared to that of the [quantum processor
112+
The schematic design is significantly simplified compared to that of the [quantum processor
113113
example](qpu17.md), but has the same general structure. The three components are
114114
added to the schematic graph and attached to each other before being placed by `plan` into a floorplan,
115115
which is then furnished with air bridges.

docs/src/geometry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Any `AbstractGeometry` subtype will have a bounding box and associated methods.
66
DeviceLayout.AbstractGeometry
77
coordinatetype
88
bounds(::DeviceLayout.AbstractGeometry)
9-
center
9+
center(::DeviceLayout.AbstractGeometry)
1010
lowerleft
1111
upperright
1212
footprint

docs/src/geometrylevel.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ dogbone = union2d([r, r2, r3]) # Boolean union of the three rectangles as a sing
2626
rounded_dogbone = Rounded(4μm)(dogbone) # Apply the Rounded style
2727
```
2828

29-
It's a bit hard to read, but the result is a `StyledEntity{T,U,S}` with three type parameters: the coordinate type `T = typeof(1.0μm}`, the underlying entity type `U = ClippedPolygon{T}`, and the style `S = Rounded{T}`—that is, it is a `GeometryEntity` that composes the result of a polygon clipping (Boolean) operation with a `GeometryEntityStyle` specifying rules for rounding that entity.
30-
31-
What's notable here is that `rounded_dogbone` only describes the vertices of the dogbone polygon and the rounding radius—in particular, it has not done any calculations to find a discretization of the rounded corners.
29+
The printed output above is a bit hard to read, and it's not necessary to understand it in detail to get started. The most important information here is that `rounded_dogbone` is a certain kind of `GeometryEntity` that only describes the vertices of the dogbone polygon and the rounding radius—in particular, we have not discretized the rounded corners to represent the result as a polygon. In more detail, `rounded_dogbone` is a `StyledEntity{T,U,S}` with three type parameters: the coordinate type `T = typeof(1.0μm}`, the underlying entity type `U = ClippedPolygon{T}`, and the style `S = Rounded{T}`—that is, it is a `GeometryEntity` that composes the result of a polygon clipping (Boolean) operation with a `GeometryEntityStyle` specifying rules for rounding that entity.
3230

3331
## Cells and Rendering
3432

docs/src/index.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ This documentation includes some examples of what you can do with DeviceLayout.j
2727

2828
## Installation
2929

30-
Julia can be downloaded [here](https://julialang.org/downloads/). We support Julia v1.10 or later.
30+
You can follow [these instructions](https://julialang.org/install/) to install Julia. We support Julia v1.10 or later.
3131

32-
From Julia, install DeviceLayout.jl using the built-in package manager:
32+
From Julia, install DeviceLayout.jl using the built-in package manager, [Pkg.jl](https://pkgdocs.julialang.org/v1/getting-started/):
3333

34-
```julia
35-
import Pkg
36-
Pkg.activate(".") # Activates an environment in the current directory
37-
Pkg.add("DeviceLayout")
34+
```r
35+
julia> ] # Pressing ] in the Julia REPL activates the Pkg REPL mode
36+
pkg> activate . # Activates an environment in the current directory
37+
pkg> add DeviceLayout # Adds DeviceLayout.jl to the environment
3838
```
3939

4040
We recommend [using an environment for each project](https://julialang.github.io/Pkg.jl/v1/environments/) rather than installing packages in the default environment.
@@ -125,15 +125,16 @@ its open files for changes, making it easy to use as a fast previewer alongside
125125
The recommended IDE for Julia is [Visual Studio Code](https://code.visualstudio.com/) with the [Julia for Visual Studio Code extension](https://www.julia-vscode.org/).
126126

127127
Since Julia has a just-in-time compiler, the first time code is executed may take much
128-
longer than any other times. This means that a lot of time will be wasted repeating
129-
compilations if you run DeviceLayout.jl in a script like you would in other languages. For
130-
readability, it is best to split up your CAD code into functions that have clearly named
131-
inputs and perform a well-defined task.
128+
longer than subsequent times in the same Julia session. This means that a lot of time will be wasted repeating
129+
compilations if you run your DeviceLayout.jl code by calling a script from the command line each time,
130+
like you might in other languages.
132131

133-
It is also best to avoid writing statements in global scope. In other words, put most of
134-
your code in a function. Your CAD script should ideally look like the following:
132+
For readability, it is best to split up your CAD code into functions that have clearly named
133+
inputs and perform a well-defined task. It is also best to avoid writing statements in global scope.
134+
In other words, put most of your code in a function. Your CAD script should ideally look like the following:
135135

136136
```julia
137+
# mycad.jl
137138
using DeviceLayout, DeviceLayout.PreferredUnits, FileIO
138139

139140
function subroutine1()

src/DeviceLayout.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export GDSMeta,
346346
abstract type AbstractPolygon{T} <: GeometryEntity{T} end
347347
348348
Anything you could call a polygon regardless of the underlying representation.
349-
Currently only `Rectangle` or `Polygon` are concrete subtypes, but one could
349+
Currently only `Rectangle`, `Polygon`, and `ClippedPolygon` are concrete subtypes, but one could
350350
imagine further subtypes to represent specific shapes that appear in highly
351351
optimized pattern formats. Examples include the OASIS format (which has 25
352352
implementations of trapezoids) or e-beam lithography pattern files like the Raith

src/entities.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ bounds(geo0::AbstractGeometry, geo1::AbstractGeometry, geo::AbstractGeometry...)
9191
center(geos)
9292
9393
Return the center of the bounding rectangle [`bounds(geo)`](@ref) or `bounds(geos)`.
94+
Note that this point doesn't have to be in `ent`.
9495
9596
Will not throw an `InexactError` even if `geo` has integer coordinates, but instead return
9697
floating point coordinates.

src/polygons.jl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -414,31 +414,10 @@ function DeviceLayout.transform(c::ClippedPolygon, f::Transformation)
414414
return ClippedPolygon(t)
415415
end
416416

417-
"""
418-
lowerleft(x::Polygon)
419-
420-
Return the lower-left-most corner of a rectangle bounding polygon `x`.
421-
Note that this point doesn't have to be in the polygon.
422-
"""
423417
DeviceLayout.lowerleft(x::Polygon) = lowerleft(x.p)
424-
425-
"""
426-
upperright(x::Polygon)
427-
428-
Return the upper-right-most corner of a rectangle bounding polygon `x`.
429-
Note that this point doesn't have to be in the polygon.
430-
"""
431418
DeviceLayout.upperright(x::Polygon) = upperright(x.p)
432-
433419
DeviceLayout.footprint(x::Polygon) = x
434420

435-
@doc """
436-
center(p::Polygon)
437-
438-
Return the center of a polygon's bounding box (`Point` object).
439-
Note that this point doesn't have to be in the polygon.
440-
""" center(p::Polygon)
441-
442421
function convert(::Type{Polygon{T}}, s::Rectangle) where {T}
443422
ll = convert(Point{T}, s.ll)
444423
ur = convert(Point{T}, s.ur)

src/references.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ coordinate system of `d` to the coordinate system of `c`.
257257
If the *same exact* `GeometryReference` (as in `===`, same address in
258258
memory) is included multiple times in the tree of references, then the resulting
259259
transform will be based on the first time it is encountered. The tree is
260-
traversed one level at a time to find the reference (optimized for shallow
261-
references).
260+
traversed using a depth-first search (but checking all references of a
261+
structure before looking inside each reference).
262262
263263
Example: You want to translate (2.0,3.0) in the coordinate system of the
264264
referenced coordinate system `d` to the coordinate system of `c`:

src/transform.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ rotation(f::Union{Translation, IdentityTransformation}; α0=0) = 0
185185
"""
186186
preserves_angles(f::Transformation)
187187
188-
Return `true` if `f`` is angle-preserving (has equal-magnitude eigenvalues) and `false` otherwise.
188+
Return `true` if `f` is angle-preserving (has equal-magnitude eigenvalues) and `false` otherwise.
189189
190190
Uses approximate equality to allow for floating point imprecision.
191191
"""

0 commit comments

Comments
 (0)