Non thermal models clean up and refactor - #295
Conversation
570de73 to
80c057e
Compare
There was a problem hiding this comment.
It much easier to see that gauss_legendre and gauss_legendre do almost the same thing the only difference is when the mapping to the real limits is done before gauss_legendre or after in gauss_legendre which mean the numerical error aren't folded in to the integration
2bd53b3 to
fbfc6da
Compare
* Increase edge case test coverage for later refactor * Update some copy / paste errors * Inclue in the dos * Use public scipy API * Modernise some of the iternals and extract constants.
fbfc6da to
af6b2c8
Compare
| from sunkit_spex.models.physical.integrate import fixed_quad_batch | ||
|
|
||
| const = const.Constants() | ||
| const = constants.Constants() |
There was a problem hiding this comment.
I like the idea of having our own specific constants (e.g., from hard-coded IDL sources and now just Astropy ones). One thought I had is that it would make sense in the future to add Astropy units to these. I realised this was useful in #293
| (high_e_cutoff << u.keV).value, | ||
| self.integrator, | ||
| ) | ||
| output[~np.isfinite(output)] = 0 |
There was a problem hiding this comment.
This can be addressed in another PR but I think I included this to avoid weird values in the output. In #291 I think I remove this which forced me to try and track down when things weren't quite right.

PR Description
Less code, more readable code, and some performance improvements
gauss_legendreport and thefixed_quad_batchare almost identical which should now be clearer the later is numerically better as the scaling operations are not compounded in the integration as they are done at the end - changed default tofixed_quad_batchAI Assistance Disclosure
AI tools were used for: