Skip to content

Commit 92ab164

Browse files
committed
Merge branch 'master' of github.com:das-developers/das2C
2 parents e4e5075 + 4d762e0 commit 92ab164

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

das2/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ const byte* DasAry_getIn(
595595
if((nDim > pThis->nRank)||(nDim < 0)){
596596
das_error(DASERR_ARRAY, "Rank %d array '%s' does not have an index "
597597
"number %d ", pThis->nRank, pThis->sId, pThis->nRank, nDim);
598-
return 0;
598+
return NULL;
599599
}
600600

601601
/* Get index info item at this partial index, or the item pointer for

das2/array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ DAS_API void dec_DasAry(DasAry* pThis);
472472
* @memberof DasAry
473473
*/
474474
DAS_API byte* DasAry_disownElements(
475-
DasAry* pThis, size_t* pLen, size_t* pOffest
475+
DasAry* pThis, size_t* pLen, size_t* pOffset
476476
);
477477

478478
/** Does this array own it's own memory?

das2/variable.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,12 @@ DasAry* _DasVarAry_strideSubset(
720720
}
721721
size_t uRemain = 0;
722722
const byte* pBaseRead = DasAry_getIn(
723-
pThis->pAry, pThis->base.vt, nVarRank, base_idx, &uRemain
723+
pThis->pAry, pThis->base.vt, DasAry_rank(pThis->pAry), base_idx, &uRemain
724724
);
725+
if(pBaseRead == NULL){
726+
*pContinue = false;
727+
return NULL;
728+
}
725729

726730
/* make a variable stride from the array stride, note that the var_stride
727731
* may be degenerate and have offset changes of 0 */

das2/variable.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Developer notes for DasVar_copy()
1+
# Developer notes for DasVar_subset() and _DasVar_strideSubset()
22

33
DasAry is unique in that it allows all array dimensions to be completly ragged.
44
This is rare. Most major binary array implementations such as those in NumPy,
@@ -7,14 +7,14 @@ This is reasonable as the majority of real world datasets can be accessed
77
via strided indexing. And those that can't are often fill-padded to so that
88
strided indexing applies.
99

10-
Since strided arrays are common, the `DasVar_copy()` function switches over
10+
Since strided arrays are common, the `DasVar_subset()` function switches over
1111
to strided copies when the extraction region satisfies the strided condition.
1212
This allows for copy out in a loop that skips the slow top-down access function
13-
`DasAry_getAt()`. In addition, of the requested subsection is actually a continous
14-
range of memory with no repeats, then a simple memcpy() is used to speed up the
15-
process further.
13+
`DasAry_getAt()`. In addition, of the requested subsection is actually a
14+
continous range of memory with no repeats, then a simple memcpy() is used to
15+
speed up the process further.
1616

17-
To understand the internal implementation of DasVar_copy() a bit more, some
17+
To understand the internal implementation of DasVar_subset() a bit more, some
1818
background is useful.
1919

2020
## Strided Arrays
@@ -53,7 +53,7 @@ are added to read all values:
5353
## Slicing alters iteration bounds
5454

5555
To slice an array we hold one (or more) of the indices constant and then
56-
iterate over the rest. The equation is not changed, only the ineration
56+
iterate over the rest. The equation is not changed, only the iteration
5757
indicies for one or more items. For example to get a slice at j = 2
5858
then:
5959

0 commit comments

Comments
 (0)