Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: persist pickles for TOAs loaded during a test run #1336

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

aarchiba
Copy link
Contributor

Currently many of our tests load TOAs from files in tests/datafile/. Some of these files are quite large. PINT has a facility for making re-loading of tim files much faster: saving a pickle in which clock corrections and similar data have already been computed. This PR is intended to make the test suite use this facility, where appropriate, by creating these pickles in a temporary directory that persists for the duration of a test run.

This PR also add the ability to easily specify a directory in which pickles should be kept, named according to the name of the .tim files they are made from. This may be useful in other contexts.

This PR needs to convert many old unittest-style test cases so that they can use pytest fixtures. Minor test cleanups may also happen.

@aarchiba
Copy link
Contributor Author

This PR is inevitably going to conflict with #1305 so perhaps best not to do too much until that is merged.

@codecov
Copy link

codecov bot commented Jul 12, 2022

Codecov Report

Merging #1336 (5553eba) into master (24e144a) will decrease coverage by 0.04%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##           master    #1336      +/-   ##
==========================================
- Coverage   61.31%   61.27%   -0.05%     
==========================================
  Files          89       90       +1     
  Lines       20218    20366     +148     
  Branches     3619     3653      +34     
==========================================
+ Hits        12397    12479      +82     
- Misses       7046     7103      +57     
- Partials      775      784       +9     
Impacted Files Coverage Δ
src/pint/polycos.py 77.19% <ø> (+0.32%) ⬆️
src/pint/models/binary_dd.py 75.86% <33.33%> (ø)
src/pint/models/noise_model.py 86.85% <100.00%> (+0.10%) ⬆️
src/pint/pint_matrix.py 67.62% <100.00%> (-0.53%) ⬇️
src/pint/toa.py 83.25% <100.00%> (+0.25%) ⬆️
src/pint/models/timing_model.py 81.63% <0.00%> (-1.77%) ⬇️
src/pint/models/parameter.py 81.48% <0.00%> (-0.25%) ⬇️
src/pint/scripts/compare_parfiles.py 0.00% <0.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24e144a...5553eba. Read the comment docs.

@aarchiba
Copy link
Contributor Author

Key TODO item: compare full-test-suite runtime with pickle_dir working properly versus returning None. Should be faster, or at least not slower, but best to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant