Skip to content

Commit

Permalink
Update DAT.jl
Browse files Browse the repository at this point in the history
Now this feature is non-breaking previous code.
  • Loading branch information
dpabon authored Sep 25, 2023
1 parent 01123f2 commit ca40fa8
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/DAT/DAT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ Map a given function `fun` over slices of the data cube `cube`.
Use InDims to discribe the input dimensions and OutDims to describe the output dimensions of the function.
### Keyword arguments
* `max_cache=YAXDefaults.max_cache` Float64 maximum size of blocks that are read into memory in bits e.g. ```max_cache=5.0e8```. Or String. e.g. ```max_cache="10MB" or ```max_cache=1GB``` defaults to approx 10Mb.
* `indims::InDims` List of input cube descriptors of type [`InDims`](@ref) for each input data cube.
* `outdims::OutDims` List of output cube descriptors of type [`OutDims`](@ref) for each output cube.
* `max_cache=YAXDefaults.max_cache` maximum size of blocks that are read into memory, defaults to approx 10Mb
* `indims::InDims` List of input cube descriptors of type [`InDims`](@ref) for each input data cube
* `outdims::OutDims` List of output cube descriptors of type [`OutDims`](@ref) for each output cube
* `inplace` does the function write to an output array inplace or return a single value> defaults to `true`
* `ispar` boolean to determine if parallelisation should be applied, defaults to `true` if workers are available.
* `showprog` boolean indicating if a ProgressMeter shall be shown
Expand Down Expand Up @@ -434,18 +434,6 @@ function mapCube(
do_gc = true,
kwargs...,
)
if typeof(max_cache) == String
if last(max_cache, 2) == "MB"
max_cache = parse(Float64, max_cache[begin:end-2]) / (10^-6)

elseif last(max_cache, 2) == "GB"

max_cache = parse(Float64, max_cache[begin:end-2]) / (10^-9)

else
error("only MB or GB values are accepted for max_cache")
end
end

#Translate slices
if any(i -> isa(i, YAXSlice), cdata)
Expand Down

0 comments on commit ca40fa8

Please sign in to comment.