cihologramas / pyoptools

Python tools for optical design
GNU General Public License v3.0
136 stars 45 forks source link

New load-on-demand library implementation for optical components and materials #133

Closed rdgraham closed 1 year ago

rdgraham commented 1 year ago

I was getting tired of the long time that it takes to import pyoptools and the memory used -- mostly due to loading the whole material and component libraries on import. I have prepared this PR to help with that. It turned into a bit of a project. I have a new clean implementation of the optical component library and materials library.

Please see the list of changes below and docstrings for new usage details.

Changes:

By the way, I realize there are a lot of files in this commit on account of updating the libraries. The main things of interest though are the new library.py, new material.py, updated zemax_import and new generic optic factory in _comp_lib/optic_factory. Also the unittests under /tests. For review, it may be useful to restrict the diff to just python files with something like git difftool fastlib2 origin/master -- '***.py'

ramezquitao commented 1 year ago

@rdgraham thanks a lot for this contribution. This is something I was planning to do because the long start up times, but you beat me to it. I will check and accept the pull request during this week. Couple questions:

Thanks again for your contribution

rdgraham commented 1 year ago

Hi,