Closed grzegorzbor closed 1 month ago
Regarding the 2 failing tests for agnpy-fit, they are not related to this PR. It seems there is some issue with the new version of gammapy 1.2, released on February 29. I ran these tests locally and they work fine with gammapy 1.1, but fail with gammapy 1.2. So i expect the master branch to also fail after 29th of Feb.
then I think the simplest solution for the moment would be to fix in the environment file gammapy version to ~1.1. Actually @cosimoNigro why gammapy is installed via pip and not directly?
Hi @cosimoNigro I updated the dependencies of the project to the combination of the versions that seem to work fine. Also aligned the environment.yml and setup.py files to have the same dependency specification. Now all tests pass. Unfortunately the build is failing now on the next step, codecoverage, because the call to the codecov API returns an error "Rate limit reached. Please upload with the Codecov repository upload token to resolve issue". I tried a couple of times and it always ends with the same error, so it doesn't seem to be temporary. According to the codecov documentation https://docs.codecov.com/docs/quick-start you need to create an account on codecov, then generate a token, and then update the CI Test workflow definition with the token. For open source projects it should be free of charge.
Thanks for the work @grzegorzbor and thanks @jsitarek for the review.
Everything looks good to me. I will take care of the codecov
issue.
The ParticleDistribution.evaluate_time() function added. It's a basic method that accepts the energy losses function as the parameter, and evaluates it for the requested time period (with optional subperiods). For now just the first, basic version. It can be later extended to be smarter - for example automatically use shorter time ranges for the energies where higher losses occur. For now only synchrotron losses implemented, other will be added later. We can later add the higher level function that would take the flags which radiative processes should be used, instead of accepting generic energy loss function as the parameter.