Skip to content

Commit

Permalink
Merge pull request #78 from invenia/gm/identity
Browse files Browse the repository at this point in the history
Add method for IdentityScaling
  • Loading branch information
glennmoy authored Apr 14, 2021
2 parents 55e3c1a + e9478f5 commit aa43348
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FeatureTransforms"
uuid = "8fd68953-04b8-4117-ac19-158bf6de9782"
authors = ["Invenia Technical Computing Corporation"]
version = "0.3.1"
version = "0.3.2"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
1 change: 1 addition & 0 deletions src/scaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ abstract type AbstractScaling <: Transform end
Represents the no-op scaling which simply returns the `data` it is applied on.
"""
struct IdentityScaling <: AbstractScaling end
IdentityScaling(args...) = IdentityScaling()

@inline _apply(x, ::IdentityScaling; kwargs...) = x

Expand Down
5 changes: 5 additions & 0 deletions test/scaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
scaling = IdentityScaling()
@test scaling isa Transform

@testset "Arguments do nothing" begin
@test IdentityScaling(123) == IdentityScaling()
@test IdentityScaling([1, 2, 3]) == IdentityScaling()
end

@testset "Vector" begin
x = [1., 2., 3.]
expected = [1., 2., 3.]
Expand Down

3 comments on commit aa43348

@glennmoy
Copy link
Member Author

@glennmoy glennmoy commented on aa43348 Apr 14, 2021

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@glennmoy
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/34309

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.2 -m "<description of version>" aa43348f547339ac62302c8e344e0dfba26480a6
git push origin v0.3.2

Please sign in to comment.