Skip to content
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

Prevents refractive index dispersions from being summed #113

Merged
merged 5 commits into from
Jan 30, 2023

Conversation

domna
Copy link
Member

@domna domna commented Jan 27, 2023

Fixes #110

Also keeps the DispersionSum flat, i.e. adds the dispersions to the internal DispersionSum list instead of creating DispersionSum(DispersionSum(Dispersion, Dispersion), Dispersion.

I think with this fix we could also release 0.15.1 to provide python 3.11 support and also to fix this bug in the published package.

@domna domna requested a review from MarJMue January 27, 2023 16:43
@domna
Copy link
Member Author

domna commented Jan 27, 2023

@MarJMue If you can come up with a better name than UnsummableDispersion I'm open. It sounds really weird to me but I could not think of something better 😅

@domna
Copy link
Member Author

domna commented Jan 27, 2023

NonAdditiveDispersion? Sounds a bit weird, too...

Maybe it's weird because it is negating it. We could also switch and add additivity by an subclass with AdditiveDispersion, feels also a bit cleaner to me.

Edit: See #114

@domna
Copy link
Member Author

domna commented Jan 28, 2023

I found a better way. I will implement it as IndexDispersion instead of UnsummableDispersion. In IndexDispersion only the refractive_index will be set and the dielectric_function will be calculated by a parent class method. This way we may also implement adding for n-based dispersions.

@domna domna marked this pull request as draft January 28, 2023 09:05
@domna domna marked this pull request as ready for review January 28, 2023 15:29
Copy link
Collaborator

@MarJMue MarJMue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the implementation is good as is. And we can easily expand if needed. 👍

@domna domna merged commit e8a0789 into master Jan 30, 2023
@domna domna deleted the adds-unsummable-dispersion branch January 30, 2023 10:09
@MarJMue MarJMue mentioned this pull request Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conceptual problem of summing dispersions and refractive index
2 participants