Home Forums Nazca Disable naming warnings

This topic contains 3 replies, has 2 voices, and was last updated by  ale35 3 weeks, 6 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6026

    ale35
    Member

    Hello,

    I would like to know whether it is possible to disable all the warnings about duplicate cells renaming.
    I understand a way would be to create individual names, but assuming I am fine with the automatic renaming, can I just disable the warnings?

    Thank you

    #6028

    Ronald
    Keymaster

    Dear ale35,

    The best way to get rid of warnings is to solve the underlying reason or, second best, redirecting them to a log file so they do not scroll over the screen but are awaiting review on disk. For the latter see logging.

    To resolve the cell rename warning avoid recreating a cell more than once, i.e. do not do the following:

    import nazca as nd
    
    def createA():
        with nd.Cell('test') as C:
            pass
        return C
    
    createA()
    createA() # causes a renaming warning
    createA() # causes a renaming warning

    but instead do

    import nazca as nd
    
    def createA():
        with nd.Cell('test') as C:
            pass
        return C
    
    A = createA()
    A.put()
    A.put()
    A.put()

    Another way to resolve these warnings is to use the @hashme decorator. It checks on cell name reuse and returns the existing cell rather then recreating it under a new name:

    import nazca as nd
    
    @nd.bb_util.hashme('test')
    def createA():
        with nd.Cell() as C:
            pass
        return C
    
    createA()
    createA() # no more renaming warning
    createA() # no more renaming warning

    Ronald

    #6029

    ale35
    Member

    Thank you Ronald,

    using the hashme decorator solved the warning issue indeed. However, now I get some messages like:

    “ERROR: bb_util.py: Reusing a basename across functions: ‘wg’ ”

    Am I not using this correctly?

     

     

    #6030

    ale35
    Member

    Dear Ronald,

    adding to my previous post, I would like to ask your advice on a parallel hashing issue which might be connected.

    I am currently generating a set of parametrized cells using a function. Here I create an interconnect object using my parameters and then I draw some geometries using it. I have noticed that even if all the parameters are the same, calling the Interconnect() command always generates a new object. This means that even if I generate identical cells, they will still be separate.

    Is there a way to check whether a specific interconnect object already exists?

    An example code:

    @nd.bbu.hashme(‘wg’)
    def wgs(WG_width):

    with nd.Cell(name = inspect.currentframe().f_code.co_name) as wg:

    ic = Interconnect(width = WG_width, layer = xx)
    ic.taper(…).put()

    return wg

    Here if I call wgs() multiple times passing the same WG_width, I will end up with multiple identical cells, each with a different (but identical) interconnect object.

     

    Thank you once again for your help.

     

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.