Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CellReference origin is unitless #18

Closed
mtfang opened this issue Jul 17, 2017 · 3 comments
Closed

CellReference origin is unitless #18

mtfang opened this issue Jul 17, 2017 · 3 comments

Comments

@mtfang
Copy link
Contributor

mtfang commented Jul 17, 2017

Causes flatten! method to fail (dimension incompatibility error) when flattening CellReferences

@mtfang
Copy link
Contributor Author

mtfang commented Jul 17, 2017

Temporary workaround: Explicit definition of CellReference origin

CellReference(cell, Point(0μm, 0μm))

@ajkeller34
Copy link
Contributor

Working on a fix now. To reproduce the error:

julia> using Devices, Devices.PreferMicrons, FileIO

julia> c = Cell("main", nm)
Cell "main" with 0 els, 0 refs

julia> c2 = Cell("test", nm)
Cell "test" with 0 els, 0 refs

julia> render!(c2, Rectangle(1μm, 2μm))
Cell "test" with 1 els, 0 refs

julia> push!(c.refs, CellReference(c2))
1-element Array{Devices.Cells.CellRef,1}:
 Devices.Cells.CellReference{Float64,Devices.Cells.Cell{Quantity{Float64, Dimensions:{𝐋}, Units:{nm}},Devices.GDSMeta}}(Cell "test" with 1 els, 0 refs, (0.0,0.0), false, 1.0, 0.0)

julia> flatten!(c)
ERROR: DimensionError: 0.0 nm and 0.0 are not dimensionally compatible.
...

The error is slightly different if the referenced cell is empty:

julia> c = Cell("main", nm)
Cell "main" with 0 els, 0 refs

julia> c2 = Cell("test", nm)
Cell "test" with 0 els, 0 refs

julia> push!(c.refs, CellReference(c2))
1-element Array{Devices.Cells.CellRef,1}:
 Devices.Cells.CellReference{Float64,Devices.Cells.Cell{Quantity{Float64, Dimensions:{𝐋}, Units:{nm}},Devices.GDSMeta}}(Cell "test" with 0 els, 0 refs, (0.0,0.0), false, 1.0, 0.0)

julia> flatten!(c)
ERROR: MethodError: no method matching Devices.Cells.Cell(::String, ::Array{Devices.Cells.CellPolygon{_,Devices.GDSMeta} where _,1})
...

@ajkeller34
Copy link
Contributor

Fixed, tests added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants