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

Implement helper function to process artificial star tests #37

Merged
merged 14 commits into from
Jun 14, 2024

Conversation

cgarling
Copy link
Owner

Been copy-pasting some code around for a while that calculates binned statistics on artificial star tests. This PR implements the process_ASTs method that accomplishes this.

I wanted to support DataFrames.DataFrame and TypedTables.Table but couldn't figure out a single implementation that would work on both. They iterate differently and I couldn't figure out a common mechanism to share the code.

I decided to have separate implementations using package extensions. There is no default implementation for this method so it requires users to load one of the above packages before using it. I don't like how much code reuse there is between the two versions but right now I don't have a solution.

As this uses package extensions, the method requires Julia 1.9 or greater. I could look at some backporting methods like
https://github.com/cjdoris/PackageExtensionCompat.jl
but right now I don't care and am just not running the method's tests on older Julia versions.

cgarling added 12 commits June 12, 2024 22:35
Been copy-pasting similar code around, figured it was worth making it nice and adding it to the package
Probably need to be broken out into extensions as I cant really figure out how to get this one function to work on both dataframes.jl and typedtables.jl. Just write it twice I guess...
Use package extensions to support both dataframes and typedtables. This works, but ugly code duplication. Figured out a different way to support both interfaces that I will use in main branch. This was useful to figure out how package extensions work though.
Stylistically preferred when you don't intend to extend `x`.
@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 96.96970% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.17%. Comparing base (a93aecf) to head (2dd8f45).

Files Patch % Lines
ext/DataFramesExt.jl 96.96% 1 Missing ⚠️
ext/TypedTablesExt.jl 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
+ Coverage   77.19%   78.17%   +0.98%     
==========================================
  Files          17       19       +2     
  Lines        1298     1361      +63     
==========================================
+ Hits         1002     1064      +62     
- Misses        296      297       +1     

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

cgarling added 2 commits June 13, 2024 21:32
I think it is more correct to make the error and bias `NaN` when the completeness in the bin is 0. Clarified this in tests and wrote a covering case.
@cgarling cgarling merged commit 7f89d8a into main Jun 14, 2024
6 checks passed
@cgarling cgarling deleted the ast_util_ext branch June 14, 2024 03:32
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