CONFIG

CONFIG#

You have 2 ways of configuring gdsfactory:

  1. Use .env files with CONFIG variables

gdsfactory can store settings in a .env file in the current directory or any parent directories.

You can create a .env file in this directory, restart the notebook and see what CONFIG values you are getting.

difftest_ignore_cell_name_differences=True
difftest_ignore_sliver_differences=False
difftest_ignore_label_differences=False
layer_error_path=[1000, 0]
max_cellname_length=99
  1. You can import CONF in the beginning of your script and then overwrite any settings.

import gdsfactory as gf

gf.CONF
Settings(n_threads=4, logfilter=LogFilter(level=<LogLevel.INFO: 'INFO'>, regex=None), display_type='image', meta_format='v2', console=<console width=115 ColorSystem.TRUECOLOR>, allow_width_mismatch=False, allow_layer_mismatch=False, allow_type_mismatch=False, cell_layout_cache=False, cell_overwrite_existing=False, connect_use_angle=True, connect_use_mirror=False, check_instances=<CHECK_INSTANCES.RAISE: 'error'>, max_cellname_length=32, debug_names=False, write_cell_properties=True, write_context_info=True, write_file_properties=True, difftest_ignore_label_differences=False, difftest_ignore_sliver_differences=False, difftest_ignore_cell_name_differences=True, bend_radius_error_type=<ErrorType.ERROR: 1>, layer_error_path=(1000, 0), pdk='generic')
gf.CONF.max_cellname_length = 9  # making the cell name ridiculously short
c1 = gf.Component("Example_long_name_123456789")
print(c1.name)
Example_long_name_123456789

As you can see the cell names are truncated when writing them to GDS.

gdspath = c1.write_gds()
c2 = gf.import_gds(gdspath)
print(c2.name)
Example_l