-
Notifications
You must be signed in to change notification settings - Fork 61
Glass Expert #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glass Expert #211
Conversation
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## master #211 +/- ##
=========================================
Coverage ? 95.52%
=========================================
Files ? 162
Lines ? 9013
Branches ? 0
=========================================
Hits ? 8610
Misses ? 403
Partials ? 0
🚀 New features to boost your workflow:
|
…land into glass_expert
Wow, this is an incredible contribution! Really well thought out, clearly implemented, and significantly expands the optimization capabilities. The approach to discrete material optimization is well-structured, and it fits neatly into the existing optimization framework. The two-pass strategy, wide then local, is a very practical way to handle glass selection, and I like that it leaves room for user control. The code is modular, readable, and the example notebook helps clarify how to use it. Everything looks good on my end and tests pass, so I’ll go ahead and merge. Thanks! I'd also like to expand the documentation a bit, e.g., adding this to the learning guide, example gallery, and maybe some references through the readthedocs docs, but that's not urgent. I can help with that as a follow-up. Looking forward to more like this! Best, |
Documentation for Glass Expert expanded in #213. |
Hi @harrison, all,
It's been some time since my last contribution — it's nice to see that Optiland is continuously growing.
I've been working on an optimization feature called
GlassExpert
, which adds support for the optimization of categorical glass variables.It explores a user-defined list of glasses and iteratively tests alternatives to find better combinations.
This is a powerful tool used by CodeV and Zemax as selling points, and I believe Optiland could benefit from this functionality as well.
The main challenge was to integrate discrete choices (glass materials) into the existing continuous optimization framework.
To do this, I implemented a greedy search strategy that cycles through all glass surfaces marked as variables,
evaluates options in (n_d, V_d) space, and keeps any substitution that reduces the objective function.
Key components:
GlassExpert
: the main optimizer class, subclassingOptimizerGeneric
get_neighbour_glasses
: finds the closest glasses in material space (n_d, V_d)downsample_glass_map
: uses K-Means to reduce the search pool while preserving diversityplot_glass_map
: for debugging and visualization of the current selection.Please run
Tutorial_7e_GlasseExpert.ipynb
to get started.The code is modular, and I've added comments and docstrings to explain each part.
It should integrate well with existing workflows and allow users to experiment with glass substitutions in a controlled way.
Looking forward to your feedback, and happy to adjust anything you find unclear or unpolished.
Thanks again for the great work on this project.