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

Support name for julia 1.6 #34

Closed
wants to merge 1 commit into from

Conversation

longemen3000
Copy link

the definition of OnlineStatsBase.name uses a replace with multiple pairs. that feature was added on 1.7 (revealed while testing https://github.com/JuliaFolds2/Transducers.jl/actions/runs/5363257764/jobs/9730697545)

@codecov
Copy link

codecov bot commented Jun 24, 2023

Codecov Report

Merging #34 (8b75feb) into master (f29d15e) will decrease coverage by 0.70%.
The diff coverage is 40.00%.

@@            Coverage Diff             @@
##           master      #34      +/-   ##
==========================================
- Coverage   94.54%   93.84%   -0.70%     
==========================================
  Files           4        4              
  Lines         403      406       +3     
==========================================
  Hits          381      381              
- Misses         22       25       +3     
Impacted Files Coverage Δ
src/OnlineStatsBase.jl 93.44% <40.00%> (-4.84%) ⬇️

@joshday
Copy link
Owner

joshday commented Jun 24, 2023

I do have a distaste for version-specific code, so I just threw this in master:

function name(T::Type, withmodule = false, withparams = true)
s = string(T)
s = withmodule ? replace(s, r"([a-zA-Z]*\.)" => "") : s
return withparams ? replace(s, r"\{(.*)" => "") : s
end

It simultaneously makes the code more clear and fixes the error on the Julia LTS release.

Thanks for bringing it to my attention and sorry for stealing the commit credit from you!

@joshday joshday closed this Jun 24, 2023
@joshday
Copy link
Owner

joshday commented Jun 24, 2023

Of course I reversed the conditionals...now fixed.

@longemen3000
Copy link
Author

Hahah, no prob 😉

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.

None yet

2 participants