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

Cache QueryATNF object #103

Merged
merged 2 commits into from
May 11, 2022
Merged

Cache QueryATNF object #103

merged 2 commits into from
May 11, 2022

Conversation

mattpitkin
Copy link
Owner

Currently, if caching (the default) using the QueryATNF object, it actually only caches the downloaded ATNF catalogue tarball. When generating new queries using QueryATNF, even using this cached file can take a few to tens of second to load (due partly to having to recalculate all the derived parameters. This PR instead caches and re-loaded the QueryATNF object itself, which is considerably quicker.

The default location of the cache objects has also been changed to be in a ~/.psrqpy directory.

This supersedes #102.

David-McKenna and others added 2 commits May 10, 2022 15:16
  if caching the database, rather than just caching the ATNF catalogue
  tarball, this caches the actual QueryATNF object. This greatly speeds
  up reuse.
@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #103 (57e699d) into master (59a1b5a) will decrease coverage by 0.22%.
The diff coverage is 55.55%.

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
- Coverage   75.32%   75.10%   -0.23%     
==========================================
  Files           7        7              
  Lines        3157     3177      +20     
  Branches      548      555       +7     
==========================================
+ Hits         2378     2386       +8     
- Misses        562      571       +9     
- Partials      217      220       +3     
Impacted Files Coverage Δ
psrqpy/tests/query_test.py 98.50% <ø> (-0.01%) ⬇️
psrqpy/utils.py 59.20% <50.00%> (ø)
psrqpy/search.py 75.96% <55.88%> (-0.47%) ⬇️

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 59a1b5a...57e699d. Read the comment docs.

@mattpitkin mattpitkin merged commit 62ad02a into master May 11, 2022
@mattpitkin mattpitkin deleted the David-McKenna-cachedPulsarLookup branch May 11, 2022 11:25
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.

2 participants