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

BPG Configuration System Update #157

Closed pvnbhargava closed 5 years ago

pvnbhargava commented 5 years ago

Issue

The current structure for configuration was partially inherited from BAG, and generally follows this behavior:

Solution

Move configuration to a global data structure that can be read anywhere in BPG. Settings are initialized as soon as the user calls import BPG. Since Python only allows the __init__.py in BPG to be called once per interpreter, only one config dict instance will ever exist, alleviating any synchronization problems. With this change all configuration settings can be accessed BPG-wide simply by importing BPG.run_settings and reading from that dictionary.

Future Work

pvnbhargava commented 5 years ago

Fixed #109 with this update to the configuration system. This change, along with the expansion of the command line interface allows new users to setup and use the generic technology with minimal effort.