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

Refactor apply methods to use Traits #80

Merged
merged 7 commits into from
Apr 16, 2021
Merged

Refactor apply methods to use Traits #80

merged 7 commits into from
Apr 16, 2021

Conversation

glennmoy
Copy link
Member

@glennmoy glennmoy commented Apr 16, 2021

Second step in #75

replaces #77

Note I haven't changed the LinearCombination tests to prevent this being a breaking change. Instead I added a deprecation warning if dims=: is passed in.

test/one_hot_encoding.jl Show resolved Hide resolved
test/linear_combination.jl Show resolved Hide resolved
src/apply.jl Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 16, 2021

Codecov Report

Merging #80 (da21841) into main (d74ecbc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #80   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files          11       11           
  Lines         122      123    +1     
=======================================
+ Hits          121      122    +1     
  Misses          1        1           
Impacted Files Coverage Δ
src/apply.jl 100.00% <100.00%> (ø)
src/linear_combination.jl 100.00% <100.00%> (ø)
src/utils.jl 85.71% <100.00%> (ø)

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 d74ecbc...da21841. Read the comment docs.

test/linear_combination.jl Outdated Show resolved Hide resolved
Base automatically changed from gm/addtraits to main April 16, 2021 11:17
@@ -60,7 +60,7 @@
@testset "dims = :" begin
M = [1 1; 2 2; 3 5]
lc = LinearCombination([1, -1, 1])
@test_throws ArgumentError FeatureTransforms.apply(M, lc; dims=:)
@test_deprecated FeatureTransforms.apply(M, lc; dims=:)
Copy link
Member Author

Choose a reason for hiding this comment

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

We have removed the default dims=1 for LinearCombination but added a deprecation warning so it's non-breaking for now.

src/apply.jl Show resolved Hide resolved
src/apply.jl Show resolved Hide resolved
src/apply.jl Outdated Show resolved Hide resolved
src/apply.jl Outdated Show resolved Hide resolved
src/apply.jl Outdated Show resolved Hide resolved
src/linear_combination.jl Outdated Show resolved Hide resolved
src/linear_combination.jl Show resolved Hide resolved
@glennmoy glennmoy enabled auto-merge (squash) April 16, 2021 16:37
Copy link
Contributor

@bencottier bencottier left a comment

Choose a reason for hiding this comment

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

Looks good to me, I think the Tables.matrix solution is better than the previous one - simpler and more readable.

@glennmoy glennmoy merged commit e95ea9c into main Apr 16, 2021
@glennmoy glennmoy deleted the gm/refactor branch April 16, 2021 17:00
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