88adc08259
data_to_ports max_depth default to 0
...
Makes it more compatible with LazyLibrary -- with recursive approach, we
have to load all the subcells to run ports2data, but those subcells may
or may not exist (e.g. partial library, or maybe we've removed some
duplicates-to-be prior to merging with a different lib)
2023-10-15 16:18:33 -07:00
4ab718d578
pass along library for bounds
2023-10-15 16:18:33 -07:00
f834aaee47
fix precache
2023-10-15 16:18:33 -07:00
27d87a988d
redo library merging
2023-10-15 16:18:33 -07:00
6f97f7e6db
pass along tools
2023-10-15 16:18:33 -07:00
d0f76d150f
Make default quiet for underscores
2023-10-15 16:18:33 -07:00
5ffcadb362
always apply postprocess
2023-10-15 16:18:33 -07:00
2ccef554db
misc fixes
2023-10-15 16:18:33 -07:00
d349aa3366
Revert "allow ports2data to take a tree"
...
This reverts commit 44f823c736
.
LazyLibrary can't take Trees anymore, so no need for it.
2023-10-15 16:18:33 -07:00
680da46f5c
LazyLibrary should not contain Tree
s
...
altering itself during iteration is not a good idea
2023-10-15 16:18:33 -07:00
59a986546c
missing import
2023-10-15 16:18:33 -07:00
19ac45a4f4
fix type for __contains__
2023-10-15 16:18:33 -07:00
db7a98bb0f
allow ports2data to take a tree
2023-10-15 16:18:33 -07:00
8687badac5
misc fixes
2023-10-15 16:18:33 -07:00
4a6584a60a
Only allow 1-sized Libraries
2023-10-15 16:18:33 -07:00
4a94259249
Allow lshift to operate on any library. If only one name, return it, else None
2023-10-15 16:18:33 -07:00
7cc732248e
add missing functions to tree
2023-10-15 16:18:33 -07:00
98728521fd
add Pather.mk()
2023-10-15 16:18:33 -07:00
460222ce6e
add name arg
2023-10-15 16:18:33 -07:00
f1a380b170
pather reorganization/clenaup
2023-10-15 16:18:33 -07:00
38585e5a9e
add lshift operator to MutableLibrary
2023-10-15 16:18:33 -07:00
2449486a28
set default for library to None
2023-10-15 16:18:33 -07:00
4fc2e67b62
Turn Builder into a subset of Pather
2023-10-15 16:18:32 -07:00
039320d180
fix add_tree operator
2023-10-15 16:18:32 -07:00
853c20e8df
Allow LazyLibrary to store Trees as well?
2023-10-15 16:18:32 -07:00
f642c226c7
Use lshift for tree combination
2023-10-15 16:18:32 -07:00
103eb4f1f8
stringy type
2023-10-15 16:18:32 -07:00
abc721cf67
ergonomics
2023-10-15 16:18:32 -07:00
d8e789f179
Add Tree as a possible way to allow construction of whole subtrees at once
2023-10-15 16:18:32 -07:00
234557dc93
Add move_references() and auto-move references during add()-with-rename
...
Also remove enable_cache, since we now rely on the cache.
2023-10-15 16:18:32 -07:00
439d5914e0
implement auto-renaming during merge, and change _merge() to support it
2023-10-15 16:18:32 -07:00
ac9776628a
remove some trailing undescores
2023-10-15 16:18:32 -07:00
ab8fd9b351
add NamedPattern
2023-10-15 16:18:32 -07:00
1a9116cdbe
add .create()
2023-10-15 16:18:32 -07:00
7a8a3ef3c7
note in comments
2023-10-15 16:18:32 -07:00
f8b5cec340
Add recurse arg to get_bounds
2023-10-15 16:18:32 -07:00
1598582865
remove log messages
2023-10-15 16:18:32 -07:00
42ee4db989
Return WrapLibrary from read() and readfile()
2023-10-15 16:18:32 -07:00
a35bf9770a
Default to adding ports at the origin
2023-10-15 16:18:32 -07:00
5c48a28661
some cleanup
2023-10-15 16:18:32 -07:00
a8da0fc429
add FlatBuilder
2023-10-15 16:18:32 -07:00
cb87543e0c
import ports2data at top level
2023-10-15 16:18:32 -07:00
e5029ae21d
add library .rename(...)
2023-10-15 16:18:32 -07:00
0172b7488e
missing comma
2023-10-15 16:18:32 -07:00
d44374bf1f
writefile should write to a temporary file first
2023-10-15 16:18:32 -07:00
5fcd31a719
add name_and_set
2023-10-15 16:18:32 -07:00
2940316c48
add missing comments
2023-10-15 16:18:32 -07:00
c0e4ee1b6b
Allow library __setitem__ to take in either Pattern or Callable
...
No longer need it to be Generic!
2023-10-15 16:18:32 -07:00
963918d1d9
various fixes and cleanup
...
mainly involving ports_to_data and data_to_ports
2023-10-15 16:18:32 -07:00
16567c8a66
move builder.port_utils into utils.ports2data
...
and rename functions
2023-10-15 16:18:32 -07:00
5452bc5608
more fixes and improvements
2023-10-15 16:18:32 -07:00
d9fe295f4f
get things working with a LazyLibrary hack while we think about cycles
2023-10-15 16:18:32 -07:00
f4537a0feb
Lots of progress on tutorials
2023-10-15 16:18:32 -07:00
c31d7dfa2c
Add note about reproducibility for DXF
2023-10-15 16:18:32 -07:00
61b381cfaa
remove dead code
2023-10-15 16:18:32 -07:00
cca7cbaae1
formatting
2023-10-15 16:18:32 -07:00
b75c8de0c4
lots of fixes to get test_rep running
2023-10-15 16:18:32 -07:00
92f7fce6ff
improve gzipped file reproducibility
...
Mostly avoid writing the old filename and modification time to the gzip
header
2023-10-15 16:18:32 -07:00
ea87418bf5
clarify comment
2023-10-15 16:18:32 -07:00
e812c69bfb
get rid of Mapping stuff on PortsList
2023-10-15 16:18:32 -07:00
71db073a54
add todos
2023-10-15 16:18:32 -07:00
a6cb276468
add AbstractView
2023-10-15 16:18:32 -07:00
090e86644a
Move Abstract into its own file
2023-10-15 16:18:32 -07:00
a1073eca6b
handle library=None
2023-10-15 16:18:32 -07:00
0368cf7a00
library can generate abstracts
2023-10-15 16:18:32 -07:00
e288c3f5e0
B becomes BB for searchability
2023-10-15 16:18:32 -07:00
3b8866732b
PortsRef -> Abstract
2023-10-15 16:18:32 -07:00
6b01b43559
flake8-aided fixes
2023-10-15 16:18:32 -07:00
db9b39dbc0
fix more type issues
2023-10-15 16:18:32 -07:00
557c6c98dc
more wip -- most central stuff is first pass done
2023-10-15 16:18:32 -07:00
6549faddbb
wip -- more fixes
2023-10-15 16:18:32 -07:00
9efb6f0eeb
wip
2023-10-15 16:18:32 -07:00
d9ae8dd6e3
wip
2023-10-15 16:18:32 -07:00
f7902fa517
busL -> mpath
2023-10-15 16:18:32 -07:00
2635c6c20c
some type updates
2023-10-15 16:18:32 -07:00
c7f3e7ee52
Remove support for dose
...
Since there isn't GDS/OASIS level support for dose, this can be mostly
handled by using arbitrary layers/dtypes directly. Dose scaling isn't
handled as nicely that way, but it corresponds more directly to what
gets written to file.
2023-10-15 16:18:32 -07:00
f7a2edfe23
fix some type-related issues
2023-10-15 16:18:32 -07:00
a0ca53f57a
get rid of "identifier"
2023-10-15 16:18:32 -07:00
7ca017d993
wip again
2023-10-15 16:18:32 -07:00
db9a6269a1
delete duplicate utils submodule
2023-10-15 16:18:32 -07:00
6f696bfc71
partial work on device libraries
2023-10-15 16:18:32 -07:00
f7b8f2db0c
various fixes
2023-10-15 16:18:32 -07:00
e3511ed852
remove duplicatre __delitem__
2023-10-15 16:18:32 -07:00
a4f89e6f48
improve docs
2023-10-15 16:18:32 -07:00
5f35e8c8e3
indirect type spec for Pattern
2023-10-15 16:18:32 -07:00
52f0b4aa93
Add lib types
2023-10-15 16:18:32 -07:00
c95b2f4c0d
bifurcate Device into DeviceRef
2023-10-15 16:18:32 -07:00
e932687210
make error message prettier
2023-10-15 16:18:32 -07:00
7aaf73cb37
WIP: make libraries and names first-class!
2023-10-15 16:18:32 -07:00
f834ec6be5
Avoid generating a container if only a single port is passed
2023-10-15 16:18:32 -07:00
885b259fb7
allow bounds to be passed as args
2023-10-15 16:18:32 -07:00
3f986957ac
allow passing a single Tool to be used as the default
2023-10-15 16:18:32 -07:00
1c3c032434
Add functionality for building paths (single use wires/waveguides/etc)
2023-10-15 16:18:32 -07:00
afcbd315ae
Fix extra vertex added during OASIS loading
2023-01-24 14:14:10 -08:00
8edb7b0956
round().astype() -> rint(...)
2023-01-11 18:29:28 -08:00
5b5cbe94d3
Move from setuputils and setup.py to hatch and pyproject.toml
2023-01-11 17:37:36 -08:00
a713967911
Add an alternate constructor for axis-aligned 2D grids
2023-01-04 22:56:17 -08:00
51b7021bdc
bump version to 2.7
2022-06-08 21:14:41 -07:00
b188589b60
Fix / simplify some cases where the arc is a sector
2022-06-08 21:12:39 -07:00
eb9682b1b8
Avoid calling new.unlock() in __deepcopy__()
...
since the new object's properties aren't necessarily deepcopied yet...
2022-06-08 21:12:39 -07:00
48b28351ed
speed up GDS writing
...
by preallocating xy array and directly rounding to target dtype
2022-06-08 21:12:39 -07:00
bfabd351c4
fix circular import
2022-06-08 21:12:39 -07:00
4cc824526b
fix deepcopy for locked shapes
2022-04-17 19:04:18 -07:00
e48183ee0b
dose==1 is the identity situation
2022-04-07 17:47:30 -07:00
6886360f6d
fix getting displacements in Arbitrary repetition
2022-04-01 17:35:21 -07:00
b5ddb5749c
fix calculation of displacements
2022-04-01 17:35:12 -07:00
67d312162a
speed up as_pattern()
...
mainly used by `flatten()`
2022-04-01 17:33:24 -07:00
97db83a1d5
add utils.vertices.poly_contains_points
2022-04-01 17:30:25 -07:00
fd0b2ba4cd
no longer ignore numpy types
2022-04-01 17:30:13 -07:00
9f1c7aea01
add _displacements to __slots__
2022-04-01 17:30:07 -07:00
3640de27c7
Fix OASIS loading when strings are stored by-reference
2022-04-01 17:30:00 -07:00
ed9b0df057
fix scaling for objects with repetitions
2022-03-16 23:54:26 -07:00
a4aa50d814
fix another instance where numpy prohibits using not bounds
2022-02-28 23:43:16 -08:00
2b8195ad3e
move dev2pat and pat2dev into masque.builder.port_utils
2022-02-28 23:38:55 -08:00
36f6edac21
fix wrong var name
2022-02-28 23:38:34 -08:00
210f5c21bc
wrap_device can be used on DeviceLibrary
2022-02-28 23:38:17 -08:00
bfee560693
simplify type hints
2022-02-28 23:37:48 -08:00
f4c2357737
fix type hint
2022-02-28 23:03:42 -08:00
20be409341
fix numpy complaining about .any() / .all()
2022-02-28 23:03:23 -08:00
d8b60da827
use_ours & use_theirs should be passed verbatim to the underlying library
2022-02-28 23:03:01 -08:00
3b0ef1e08d
always couple LibDeviceLibrary keys to the underlying Library
...
See comment for why this is necessary
2022-02-28 23:02:36 -08:00
7603a7a1c8
fix typevar naming
2022-02-28 23:00:53 -08:00
0c1954c9d1
fix missing imports
2022-02-28 23:00:31 -08:00
30025ba081
fixup dxf read
2022-02-28 22:59:45 -08:00
5ef34794ff
keep ordering stable for same-y ports
2022-02-28 22:59:30 -08:00
c8b4075fcc
Avoid circular import
2022-02-27 21:26:51 -08:00
40b98b2511
add missing colon
2022-02-27 21:26:23 -08:00
0471addd65
add get_bounds_nonempty
2022-02-27 21:23:03 -08:00
780d1ca97f
export LibDeviceLibrary
2022-02-27 21:23:03 -08:00
fc7a6c6f4a
fix some unused code
2022-02-27 21:23:03 -08:00
81430fe632
add LibDeviceLibrary
2022-02-27 21:23:03 -08:00
6a1208bc33
add some helper functions to libraries
2022-02-27 21:23:03 -08:00
f36350ebee
Add some warnings around cache invalidation when mutating items
2022-02-27 21:23:03 -08:00
2e5d51b0af
resolve name conflicts rather than just giving up
...
this lets us merge libraries without having to mutate `other`, which
brings a bunch of problems around cache invalidation
2022-02-27 21:23:03 -08:00
566ba99f9c
set_const doesn't need to take in a separate key, can just use the pattern's name
...
might as well make the convenience function convenient
2022-02-27 21:23:03 -08:00
86315fc32b
improve DeviceLibrary docstring
2022-02-27 21:23:03 -08:00
f178e94d82
remove old overloads
2022-02-27 21:23:03 -08:00
7612a2660c
add DeviceLibraryError
2022-02-27 21:23:03 -08:00
7aa850a239
add todo note
2022-02-23 16:03:26 -08:00
9a9a05d1d7
add guillotine_bssf_sas
2022-02-23 16:03:26 -08:00
c2994b74bd
add utils.pack2d.pack_patterns
2022-02-23 16:03:26 -08:00
a9e3bf8b2a
return a set of rejected indices
2022-02-23 16:03:24 -08:00
fc1a0f5a5a
break apart utils into submodules, and add utils.pack2d
2022-02-23 16:01:51 -08:00
a4fe3d9e2e
Use ArrayLike and NDArray wherever possible. Some type fixes and some related corner cases
2022-02-23 15:47:38 -08:00
89f327ba37
reformat some multiline arg lists and add missing 'None' return types
2022-02-23 15:16:25 -08:00
47e8cab73c
fix format string now that ptypes are str-typed
2021-06-24 23:25:15 -07:00
a92ab9425b
typo in 4788fa3c
2021-06-23 22:42:39 -07:00
576077c461
add docstring for Pattern.rename()
2021-06-23 22:39:24 -07:00
4788fa3ca5
add Device.rename()
2021-06-23 22:39:12 -07:00
dbee0027b2
fix wrap_repated_shapes for labels
2021-06-23 22:39:02 -07:00