Home Forums Nazca Caching non-parametric cells Reply To: Caching non-parametric cells

#5535
Ronald
Keymaster

Dear Dima,

There are two ways around the renaming.
(Note the renaming by default guarantees that cells are always unique.)

1) Nazca can recognize if cells (parametric or not) have been called before by applying the hashme decorator:

import nazca as nd

@nd.bb_util.hashme('cellname')
def sh_to_dp():
    with nd.Cell(hashme=True) as C:
        nd.strt(length=10).put(0)
    return C

for i in range(10):
    sh_to_dp().put(0, 10*i)

nd.export_gds()

2) Assign the cell in the first call to a variable name and avoid the extra function calls all together:

C = sh_to_dp()
for i in range(10):
    C.put(0, 10*i)

Ronald