@@ -604,7 +604,7 @@ function h5read(filename, name::ByteString)
604
604
dat
605
605
end
606
606
607
- function h5read (filename, name:: ByteString , indices:: (Union(RangeIndex ,Colon) ...))
607
+ function h5read (filename, name:: ByteString , indices:: (Union(Range{Int},Int ,Colon) ...))
608
608
local dat
609
609
fid = h5open (filename, " r" )
610
610
try
@@ -1536,7 +1536,7 @@ write{T<:BitsKindOrByteString}(parent::Union(HDF5File, HDF5Group), name::ByteStr
1536
1536
write {T<:BitsKindOrByteString} (parent:: HDF5Dataset , name:: ByteString , data:: Union(T, Array{T}) , plists... ) = a_write (parent, name, data, plists... )
1537
1537
1538
1538
# Reading arrays using getindex: data = dset[:,:,10]
1539
- function getindex (dset:: HDF5Dataset , indices:: RangeIndex ... )
1539
+ function getindex (dset:: HDF5Dataset , indices:: Union(Range{Int},Int) ...)
1540
1540
local T
1541
1541
dtype = datatype (dset)
1542
1542
try
@@ -1546,7 +1546,7 @@ function getindex(dset::HDF5Dataset, indices::RangeIndex...)
1546
1546
end
1547
1547
_getindex (dset,T, indices... )
1548
1548
end
1549
- function _getindex (dset:: HDF5Dataset , T:: Type , indices:: RangeIndex ... )
1549
+ function _getindex (dset:: HDF5Dataset , T:: Type , indices:: Union(Range{Int},Int) ...)
1550
1550
if ! (T<: HDF5BitsKind )
1551
1551
error (" Dataset indexing (hyperslab) is available only for bits types" )
1552
1552
end
@@ -1565,11 +1565,11 @@ function _getindex(dset::HDF5Dataset, T::Type, indices::RangeIndex...)
1565
1565
end
1566
1566
1567
1567
# Write to a subset of a dataset using array slices: dataset[:,:,10] = array
1568
- function setindex! (dset:: HDF5Dataset , X:: Array , indices:: RangeIndex ... )
1568
+ function setindex! (dset:: HDF5Dataset , X:: Array , indices:: Union(Range{Int},Int) ...)
1569
1569
T = hdf5_to_julia (dset)
1570
1570
_setindex! (dset, T, X, indices... )
1571
1571
end
1572
- function _setindex! (dset:: HDF5Dataset ,T:: Type , X:: Array , indices:: RangeIndex ... )
1572
+ function _setindex! (dset:: HDF5Dataset ,T:: Type , X:: Array , indices:: Union(Range{Int},Int) ...)
1573
1573
if ! (T<: Array )
1574
1574
error (" Dataset indexing (hyperslab) is available only for arrays" )
1575
1575
end
@@ -1596,7 +1596,7 @@ function _setindex!(dset::HDF5Dataset,T::Type, X::Array, indices::RangeIndex...)
1596
1596
end
1597
1597
X
1598
1598
end
1599
- function setindex! (dset:: HDF5Dataset , X:: AbstractArray , indices:: RangeIndex ... )
1599
+ function setindex! (dset:: HDF5Dataset , X:: AbstractArray , indices:: Union(Range{Int},Int) ...)
1600
1600
T = hdf5_to_julia (dset)
1601
1601
if ! (T<: Array )
1602
1602
error (" Hyperslab interface is available only for arrays" )
@@ -1605,7 +1605,7 @@ function setindex!(dset::HDF5Dataset, X::AbstractArray, indices::RangeIndex...)
1605
1605
setindex! (dset, Y, indices... )
1606
1606
end
1607
1607
1608
- function setindex! (dset:: HDF5Dataset , x:: Number , indices:: RangeIndex ... )
1608
+ function setindex! (dset:: HDF5Dataset , x:: Number , indices:: Union(Range{Int},Int) ...)
1609
1609
T = hdf5_to_julia (dset)
1610
1610
if ! (T<: Array )
1611
1611
error (" Hyperslab interface is available only for arrays" )
@@ -1614,10 +1614,10 @@ function setindex!(dset::HDF5Dataset, x::Number, indices::RangeIndex...)
1614
1614
setindex! (dset, X, indices... )
1615
1615
end
1616
1616
1617
- getindex (dset:: HDF5Dataset , I:: Union(RangeIndex, Colon) ...) = getindex (dset, ntuple (length (I), i-> isa (I[i], Colon) ? (1 : size (dset,i)) : I[i])... )
1618
- setindex! (dset:: HDF5Dataset , x, I:: Union(RangeIndex, Colon) ...) = setindex! (dset, x, ntuple (length (I), i-> isa (I[i], Colon) ? (1 : size (dset,i)) : I[i])... )
1617
+ getindex (dset:: HDF5Dataset , I:: Union(Range{Int},Int, Colon) ...) = getindex (dset, ntuple (length (I), i-> isa (I[i], Colon) ? (1 : size (dset,i)) : I[i])... )
1618
+ setindex! (dset:: HDF5Dataset , x, I:: Union(Range{Int},Int, Colon) ...) = setindex! (dset, x, ntuple (length (I), i-> isa (I[i], Colon) ? (1 : size (dset,i)) : I[i])... )
1619
1619
1620
- function hyperslab (dset:: HDF5Dataset , indices:: RangeIndex ... )
1620
+ function hyperslab (dset:: HDF5Dataset , indices:: Union(Range{Int},Int) ...)
1621
1621
local dsel_id
1622
1622
dspace = dataspace (dset)
1623
1623
try
0 commit comments