Skip to content

Commit

Permalink
Rename package to Transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn Moynihan committed Jan 28, 2021
1 parent 9c18ab6 commit 9c8eda3
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
using Documenter: doctest
using Transform
doctest(Transform)
using Transforms
doctest(Transforms)
include("docs/make.jl")'
after_success: skip
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "Transform"
name = "Transforms"
uuid = "8fd68953-04b8-4117-ac19-158bf6de9782"
authors = ["Invenia Technical Computing Corporation"]
version = "0.1.0"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Transform
# Transforms

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://invenia.github.io/Transform.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://invenia.github.io/Transform.jl/dev)
[![Build Status](https://travis-ci.com/invenia/Transform.jl.svg?branch=master)](https://travis-ci.com/invenia/Transform.jl)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://invenia.github.io/Transforms.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://invenia.github.io/Transforms.jl/dev)
[![Build Status](https://travis-ci.com/invenia/Transforms.jl.svg?branch=master)](https://travis-ci.com/invenia/Transforms.jl)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
2 changes: 1 addition & 1 deletion docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[Transform]]
[[Transforms]]
path = ".."
uuid = "8fd68953-04b8-4117-ac19-158bf6de9782"
version = "0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Transform = "8fd68953-04b8-4117-ac19-158bf6de9782"
Transforms = "8fd68953-04b8-4117-ac19-158bf6de9782"
12 changes: 6 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Transform
using Transforms
using Documenter

makedocs(;
modules=[Transform],
modules=[Transforms],
authors="Invenia Technical Computing Corporation",
repo="https://github.com/invenia/Transform.jl/blob/{commit}{path}#L{line}",
sitename="Transform.jl",
repo="https://github.com/invenia/Transforms.jl/blob/{commit}{path}#L{line}",
sitename="Transforms.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://invenia.github.io/Transform.jl",
canonical="https://invenia.github.io/Transforms.jl",
assets=String[],
),
pages=[
Expand All @@ -19,5 +19,5 @@ makedocs(;
)

deploydocs(;
repo="github.com/invenia/Transform.jl",
repo="github.com/invenia/Transforms.jl",
)
6 changes: 3 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
```@meta
CurrentModule = Transform
CurrentModule = Transforms
```

# Transform
# Transforms

```@index
```

```@autodocs
Modules = [Transform]
Modules = [Transforms]
```
4 changes: 2 additions & 2 deletions src/Transform.jl → src/Transforms.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Transform
module Transforms

using Tables

export Transformation, Power
export Transform, Power
export transform, transform!

include("utils.jl")
Expand Down
4 changes: 2 additions & 2 deletions src/power.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
Power(exponent) <: Transformation
Power(exponent) <: Transform
Raise the data by the given `exponent`.
"""
struct Power <: Transformation
struct Power <: Transform
exponent::Real
end

Expand Down
34 changes: 17 additions & 17 deletions src/transformers.jl
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@

"""
Transformation
Transform
Abstract supertype for all transformations.
Abstract supertype for all Transforms.
"""
abstract type Transformation end
abstract type Transform end

# Make Transforms callable types
(t::Transformation)(x; kwargs...) = transform(x, t; kwargs...)
(t::Transform)(x; kwargs...) = transform(x, t; kwargs...)

"""
transform!(data::T, transformation::Transformation; kwargs...) -> T
transform!(data::T, Transform::Transform; kwargs...) -> T
Apply the`transformation` mutating the input `data`.
Apply the`Transform` mutating the input `data`.
Where possible, this should be extended for new data types `T`.
"""
function transform! end

"""
transform(data::T, transformation::Transformation; kwargs...) -> T
transform(data::T, Transform::Transform; kwargs...) -> T
Non-mutating version of [`transform!`](@ref), which it delegates to by default.
Does not need to be extended unless a mutating transformation is not possible.
Does not need to be extended unless a mutating Transform is not possible.
"""
function transform end

"""
transform!(A::AbstractArray{T}, ::Transformation; dims=:, kwargs...) where T <: Real
transform!(A::AbstractArray{T}, ::Transform; dims=:, kwargs...) where T <: Real
Applies the transformation to each element of `A`.
Optionally specify the `dims` to apply the transformation along certain dimensions.
Applies the Transform to each element of `A`.
Optionally specify the `dims` to apply the Transform along certain dimensions.
"""
function transform!(
A::AbstractArray{T}, t::Transformation; dims=:, kwargs...
A::AbstractArray{T}, t::Transform; dims=:, kwargs...
) where T <: Real
dims == Colon() && return _transform!(A, t; kwargs...)

Expand All @@ -43,15 +43,15 @@ function transform!(
return A
end

transform(x, t::Transformation; kwargs...) = transform!(_try_copy(x), t; kwargs...)
transform(x, t::Transform; kwargs...) = transform!(_try_copy(x), t; kwargs...)

"""
transform!(table::T, ::Transformation; cols=nothing)::T where T
transform!(table::T, ::Transform; cols=nothing)::T where T
Applies the transformation to each of the specified columns in the `table`.
If no `cols` are specified, then the transformation is applied to all columns.
Applies the Transform to each of the specified columns in the `table`.
If no `cols` are specified, then the Transform is applied to all columns.
"""
function transform!(table::T, t::Transformation; cols=nothing)::T where T
function transform!(table::T, t::Transform; cols=nothing)::T where T
# TODO: We could probably handle iterators of tables here
Tables.istable(table) || throw(MethodError(transform!, (table, t)))

Expand Down
2 changes: 1 addition & 1 deletion test/power.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@testset "power" begin

p = Power(3)
@test p isa Transformation
@test p isa Transform

# TODO: all of these should be part of some test utils
@testset "Vector" begin
Expand Down
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using AxisArrays
using AxisKeys
using DataFrames: DataFrame
using Transform
using Transform: _try_copy
using Transforms
using Transforms: _try_copy
using Test

@testset "Transform.jl" begin
@testset "Transforms.jl" begin
include("power.jl")
end

0 comments on commit 9c8eda3

Please sign in to comment.