Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some profiling fun:
I tried to figure out why the tests/integration/test_calibrate_mesmer.py test are slowish. One main culprit is
_fit_auto_regression_np
and statsmodels: we need to set up theAutoreg
model for each grid point individually, which checks the input every time, especially setting up theDeterministicProcess
is slow. We can instantiate this once and pass it. This speeds up the tests by about 25% (from 12s to 8s or so). However, this does not seem to be recommended and is brittle (it copies implementation details). So I do not recommend to merge this PR (still would be nice to speed up this unnecessary slow repeated stuff...).The code diff to profile is given below (and then visualize using snakeviz):
The visualization can be done with snakeviz