BerkeleyPhotonicsGenerator / BPG

The Berkeley Photonics Generator (BPG) is a Python framework that enables the generation and simulation of photonics layout
BSD 3-Clause "New" or "Revised" License
35 stars 9 forks source link

Adding ability to filter out annoying BPG log messages. #172

Closed sbuchbinder closed 4 years ago

sbuchbinder commented 4 years ago

Add a key to bpg_config inside of bag_config.yaml called 'duplicate_filter_exclude'. The value of this key is a list of regex-ed strings (so .* is allowed, etc)

ie:

bpg_config:
  photonic_tech_config_path: "..."
  duplicate_filter_exclude:
    - "round bounding boxes currently overestimate the size"
    - "Attempted to generate a waveguide with near-zero length.*"
sbuchbinder commented 4 years ago

I wasnt sure if this was the best way to do it...

Wanted it to be project / install configurable.

Feel free to rename the variable I chose

pvnbhargava commented 4 years ago

Hmm I'm a little confused about the intent here. Do you want to add a filter to prevent all records from being repeated, and then have a list of things that should be excluded from the filter? Or do you want to only filter out repeated records provided in the list? Just from looking at the code it seems like the filter passes all records unless it matches a regex in the list.

In the future, I think we should create error/warning codes so that things are slightly easier to reference, but for now this is fine.