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

fix issue #48 #49

Merged
merged 6 commits into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone("https://github.com/milanflach/LIBSVM.jl.git"); Pkg.checkout("LIBSVM", "mutating_versions"); Pkg.build("LIBSVM")'
- julia -e 'Pkg.clone("https://github.com/milanflach/MultivariateAnomalies.jl")'
- julia -e 'Pkg.clone(pwd()); Pkg.build("CABLAB"); Pkg.build("NetCDF"); Pkg.test("CABLAB"; coverage=true)'
- julia -e 'Pkg.clone(pwd()); Pkg.build("CABLAB")'
- julia -e 'using Conda; Conda.add("libnetcdf"); Pkg.build("NetCDF"); Pkg.test("CABLAB"; coverage=true)'
after_success:
- julia -e 'Pkg.add("Documenter")'
- julia -e 'Pkg.clone("https://github.com/CAB-LAB/CABLABPlots.jl");Pkg.add("GR")'
- julia -e 'using Compose'
- julia -e 'cd(Pkg.dir("CABLAB")); include(joinpath("docs", "make.jl"))'

8 changes: 4 additions & 4 deletions src/DAT/DAT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ Apply a reduction function `f` on slices of the cube `cube`. The dimension(s) ar
either an Axis type or a tuple of axis types. Keyword arguments are passed to `mapCube` or, if unknown passed again to `f`.
It is assumed that `f` takes an array input and returns a single value.
"""
reduceCube{T<:CubeAxis}(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Type{T};kwargs...)=reduceCube(f,c,(dim,);kwargs...)
function reduceCube(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Tuple,no_ocean=any(i->isa(i,LonAxis) || isa(i,LatAxis),axes(c)) ? 0 : 1;kwargs...)
reduceCube{T<:CubeAxis}(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Type{T},addargs...;kwargs...)=reduceCube(f,c,(dim,),addargs...;kwargs...)
function reduceCube(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Tuple,addargs...;kwargs...)
if in(LatAxis,dim)
axlist=axes(c)
inAxes=map(i->getAxis(i,axlist),dim)
Expand All @@ -202,9 +202,9 @@ function reduceCube(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Tuple,no_o
wone=reshape(cosd(latAxis.values),ssmall)
ww=zeros(sfull).+wone
wv=Weights(reshape(ww,length(ww)))
return mapCube(f,c,wv,indims=dim,outdims=((),),inmissing=(:nullable,),outmissing=(:nullable,),inplace=false;kwargs...)
return mapCube(f,c,wv,addargs...;indims=dim,outdims=((),),inmissing=(:nullable,),outmissing=(:nullable,),inplace=false,kwargs...)
else
return mapCube(f,c,indims=dim,outdims=((),),inmissing=(:nullable,),outmissing=(:nullable,),inplace=false;kwargs...)
return mapCube(f,c,addargs...;indims=dim,outdims=((),),inmissing=(:nullable,),outmissing=(:nullable,),inplace=false,kwargs...)
end
end

Expand Down