PHOTOX / promdens

Promoted Density Approach for sampling initial conditions for trajectory-based nonadiabatic photodynamics.
https://github.com/PHOTOX/promdens
MIT License
0 stars 0 forks source link

Move `calc_envelope` to LaserPulse and add tests #19

Closed danielhollas closed 1 month ago

danielhollas commented 1 month ago

Moved calc_envelope method to LaserPulse class. Also moved the tmin and tmin attributes and their computation into LaserPulse.

danielhollas commented 1 month ago

I am having numerical issues with the new tests but apart from that this is ready for review @JanosJiri

danielhollas commented 1 month ago

The tests are now passing, I've used pytest.approx for inexact comparisons. It's not a fully satisfying solution since it doesn't integrate as well with the inline-snapshot library. I'll keep mulling it over but it should not block this PR.

JanosJiri commented 1 month ago

The tests are now passing, I've used pytest.approx for inexact comparisons. It's not a fully satisfying solution since it doesn't integrate as well with the inline-snapshot library. I'll keep mulling it over but it should not block this PR.

I quite like it. What I had a problem with when doing the tests was the absolute comparison and threshold for absolute differences. This allows us to compare relative differences, which might be very handy.