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

Use of_eltype instead of convert lambda #95

Merged
merged 2 commits into from
Aug 9, 2021

Commits on Aug 9, 2021

  1. Use of_eltype instead of convert lambda

    As suggested by @timholy in Evizero#17, this commit changes
    `mappedarray(c->convert(T,c), img)` to `of_eltype(T, img)`. It results
    into `MappedArray` instead of `ReadonlyMappedArray`, and it is more
    descriptive too.
    
    This commit does not deal with Evizero#17, but I can confirm that the issue
    seems to be fixed already (which @johnnychen94 noticed before) and can
    be closed:
    
    ```julia
    julia> using Augmentor, Test
    
    julia> img = testpattern();
    
    julia> @inferred(augment(img, ConvertEltype(Gray))) |> summary # Gray{Any}
    "300×400 Array{Gray,2} with eltype Gray"
    
    julia> pl = SplitChannels() |> ConvertEltype(Gray)
    2-step Augmentor.ImmutablePipeline:
     1.) Split colorant into its color channels
     2.) Convert eltype to Gray
    
    julia> @inferred(augment(img, pl)) |> summary # Gray{N0f8}
    "4×300×400 Array{Gray{N0f8},3} with eltype Gray{FixedPointNumbers.N0f8}"
    ```
    barucden committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    57978fd View commit details
    Browse the repository at this point in the history
  2. Add inference tests

    barucden committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    adf9d3a View commit details
    Browse the repository at this point in the history