Skip to content

Conversation

@cgarling
Copy link
Member

@cgarling cgarling commented Oct 5, 2025

Implements caching of filters queried from SVO. Includes an update_filters() function that will redownload all cached filters from SVO, effectively refreshing the cache.

@lucasvalenzuela how does this look?

@codecov
Copy link

codecov bot commented Oct 5, 2025

Codecov Report

❌ Patch coverage is 68.88889% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.10%. Comparing base (21e9344) to head (32f8001).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/svo.jl 71.42% 12 Missing ⚠️
src/plots.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #33      +/-   ##
==========================================
- Coverage   80.60%   80.10%   -0.51%     
==========================================
  Files           6        6              
  Lines         366      397      +31     
==========================================
+ Hits          295      318      +23     
- Misses         71       79       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

src/svo.jl Outdated
errval = simple_value(children(info)[1])
if errval == "Filter not found:"
errval *= " $id"
filename = joinpath(filter_cache, replace(filtername, "/" => "_") * "_" * string(magsys) * ".txt")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would save these as .xml files instead

@lucasvalenzuela
Copy link
Contributor

lucasvalenzuela commented Oct 12, 2025

It works really well and looks good to me! I have added one comment in the review (xml vs. txt files) and also added a PR adding clear_filters to remove all filters in the cache: cgarling#7

One thing one could still add is a keyword argument to get_filter that forces the downloading of the file, and/or a keyword argument that prevents the caching of the downloaded file. And one could equivalently add an argument to clear_filters or a new clear_filter to remove one single specified filter. But maybe that is too much of an edge case.

@cgarling
Copy link
Member Author

Couple updates:

  • cached_filters returns a list of the filters currently in the cache
  • update_filter("2MASS/2MASS.J", :Vega) can be used to update one specific filter in the cache. Calling update_filter() updates all of them.
  • clear_filter("2MASS/2MASS.J", :Vega) can be used to delete one specific filter from the cache. Calling clear_filter() deletes all filters from the cache.

With these features complete I think we should be good to merge this and register the package. What do you think @lucasvalenzuela ?

@lucasvalenzuela
Copy link
Contributor

Everything works beautifully! For the docstrings I noticed you put in two method documentations in the same triple quotation marks block - does that actually work? I am used to seeing separate docstrings for each method.

Apart from that I think this is ready to go and be registered.

@cgarling
Copy link
Member Author

It does work but it's kind of a bad habit, I think it's better form to have multiple docstrings so I changed that now.

Thanks for all your help! I'll merge this and try and register the package when I get a chance. You think we should register at 1.0?

@cgarling cgarling merged commit e455120 into JuliaAstro:master Oct 29, 2025
8 of 12 checks passed
@lucasvalenzuela
Copy link
Contributor

I saw you already bumped it to 1.0 - in any case I don't have any preference on 1.0 or 0.1. Fantastic to see this getting this registered soon, thanks for all your work on this package!

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