flaresimulations / synthesizer

Synthesizer - a code for creating synthetic astrophysical observables
https://flaresimulations.github.io/synthesizer/
GNU General Public License v3.0
17 stars 8 forks source link

`Sed.__mul__` and `Sed.__rmul__` are a bit opaque. #566

Closed WillJRoper closed 2 months ago

WillJRoper commented 5 months ago

While typing sed.py I ran into an issue with mypy and __rmul__ which I'm yet to resolve but it got me thinking.

All the dunder multiplication functions do is scale lnu by a number (which I have also modified to do fnu if present but that's beside the point). This is a very simplified version of multiplication overloading and IMO would be better served by a method called scale which implies the intent of the operation. The multiplication syntax is nice but somewhat hides the intention.

What does everyone think?

christopherlovell commented 5 months ago

Go for it