Skip to content

Commit 0977819

Browse files
committed
Update artifacts
1 parent d449df4 commit 0977819

File tree

4 files changed

+85
-52
lines changed

4 files changed

+85
-52
lines changed

ndarray/base/pop/coverage.ndjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[151,151,100,4,4,100,1,1,100,151,151,100,"c0e5699e76e09dcac53b4bd78780d0190e365a75","2025-09-21 19:14:44 +0500"]
1+
[162,162,100,7,7,100,1,1,100,162,162,100,"7de1f33a4d2c56ac6546f8e40a088b8744056ffd","2025-09-22 00:58:48 -0700"]

ndarray/base/pop/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ <h1><a href="../../../../index.html">All files</a> ndarray/base/pop/lib</h1>
2525
<div class='fl pad1y space-right2'>
2626
<span class="strong">100% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>151/151</span>
28+
<span class='fraction'>162/162</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
3333
<span class="strong">100% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>4/4</span>
35+
<span class='fraction'>7/7</span>
3636
</div>
3737

3838

@@ -46,7 +46,7 @@ <h1><a href="../../../../index.html">All files</a> ndarray/base/pop/lib</h1>
4646
<div class='fl pad1y space-right2'>
4747
<span class="strong">100% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>151/151</span>
49+
<span class='fraction'>162/162</span>
5050
</div>
5151

5252

@@ -99,13 +99,13 @@ <h1><a href="../../../../index.html">All files</a> ndarray/base/pop/lib</h1>
9999
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
100100
</td>
101101
<td data-value="100" class="pct high">100%</td>
102-
<td data-value="92" class="abs high">92/92</td>
102+
<td data-value="103" class="abs high">103/103</td>
103103
<td data-value="100" class="pct high">100%</td>
104-
<td data-value="3" class="abs high">3/3</td>
104+
<td data-value="6" class="abs high">6/6</td>
105105
<td data-value="100" class="pct high">100%</td>
106106
<td data-value="1" class="abs high">1/1</td>
107107
<td data-value="100" class="pct high">100%</td>
108-
<td data-value="92" class="abs high">92/92</td>
108+
<td data-value="103" class="abs high">103/103</td>
109109
</tr>
110110

111111
</tbody>
@@ -116,7 +116,7 @@ <h1><a href="../../../../index.html">All files</a> ndarray/base/pop/lib</h1>
116116
<div class='footer quiet pad2 space-top1 center small'>
117117
Code coverage generated by
118118
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119-
at 2025-09-21T14:15:47.552Z
119+
at 2025-09-22T08:02:32.356Z
120120
</div>
121121
<script src="../../../../prettify.js"></script>
122122
<script>

ndarray/base/pop/index.js.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
202202
'use strict';
203203
&nbsp;
204204
/**
205-
* Return an array containing a truncated view of an input ndarray and a complementary view of the last element(s) along a specified dimension.
205+
* Return an array containing a truncated view of an input ndarray and a view of the last element(s) along a specified dimension.
206206
*
207207
* @module @stdlib/ndarray/base/pop
208208
*
@@ -222,7 +222,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
222222
* var arr = ndarray2array( x );
223223
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
224224
*
225-
* var y = pop( x, 0, false, false );
225+
* var y = pop( x, 0, false );
226226
* // returns [ &lt;ndarray&gt;, &lt;ndarray&gt; ]
227227
*
228228
* arr = ndarray2array( y[ 0 ] );
@@ -247,7 +247,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
247247
<div class='footer quiet pad2 space-top1 center small'>
248248
Code coverage generated by
249249
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
250-
at 2025-09-21T14:15:47.552Z
250+
at 2025-09-22T08:02:32.356Z
251251
</div>
252252
<script src="../../../../prettify.js"></script>
253253
<script>

ndarray/base/pop/main.js.html

Lines changed: 74 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
2525
<div class='fl pad1y space-right2'>
2626
<span class="strong">100% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>92/92</span>
28+
<span class='fraction'>103/103</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
3333
<span class="strong">100% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>3/3</span>
35+
<span class='fraction'>6/6</span>
3636
</div>
3737

3838

@@ -46,7 +46,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
4646
<div class='fl pad1y space-right2'>
4747
<span class="strong">100% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>92/92</span>
49+
<span class='fraction'>103/103</span>
5050
</div>
5151

5252

@@ -155,7 +155,18 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
155155
<a name='L90'></a><a href='#L90'>90</a>
156156
<a name='L91'></a><a href='#L91'>91</a>
157157
<a name='L92'></a><a href='#L92'>92</a>
158-
<a name='L93'></a><a href='#L93'>93</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
158+
<a name='L93'></a><a href='#L93'>93</a>
159+
<a name='L94'></a><a href='#L94'>94</a>
160+
<a name='L95'></a><a href='#L95'>95</a>
161+
<a name='L96'></a><a href='#L96'>96</a>
162+
<a name='L97'></a><a href='#L97'>97</a>
163+
<a name='L98'></a><a href='#L98'>98</a>
164+
<a name='L99'></a><a href='#L99'>99</a>
165+
<a name='L100'></a><a href='#L100'>100</a>
166+
<a name='L101'></a><a href='#L101'>101</a>
167+
<a name='L102'></a><a href='#L102'>102</a>
168+
<a name='L103'></a><a href='#L103'>103</a>
169+
<a name='L104'></a><a href='#L104'>104</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
159170
<span class="cline-any cline-yes">1x</span>
160171
<span class="cline-any cline-yes">1x</span>
161172
<span class="cline-any cline-yes">1x</span>
@@ -219,29 +230,40 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
219230
<span class="cline-any cline-yes">1x</span>
220231
<span class="cline-any cline-yes">1x</span>
221232
<span class="cline-any cline-yes">1x</span>
222-
<span class="cline-any cline-yes">6x</span>
223-
<span class="cline-any cline-yes">6x</span>
224-
<span class="cline-any cline-yes">6x</span>
225-
<span class="cline-any cline-yes">6x</span>
226-
<span class="cline-any cline-yes">6x</span>
227-
<span class="cline-any cline-yes">6x</span>
228-
<span class="cline-any cline-yes">6x</span>
229-
<span class="cline-any cline-yes">6x</span>
230-
<span class="cline-any cline-yes">6x</span>
231-
<span class="cline-any cline-yes">6x</span>
232-
<span class="cline-any cline-yes">6x</span>
233-
<span class="cline-any cline-yes">6x</span>
234-
<span class="cline-any cline-yes">6x</span>
235-
<span class="cline-any cline-yes">6x</span>
236-
<span class="cline-any cline-yes">6x</span>
233+
<span class="cline-any cline-yes">1x</span>
234+
<span class="cline-any cline-yes">1x</span>
235+
<span class="cline-any cline-yes">21x</span>
236+
<span class="cline-any cline-yes">21x</span>
237+
<span class="cline-any cline-yes">21x</span>
238+
<span class="cline-any cline-yes">21x</span>
239+
<span class="cline-any cline-yes">21x</span>
240+
<span class="cline-any cline-yes">21x</span>
241+
<span class="cline-any cline-yes">21x</span>
242+
<span class="cline-any cline-yes">21x</span>
243+
<span class="cline-any cline-yes">21x</span>
244+
<span class="cline-any cline-yes">21x</span>
245+
<span class="cline-any cline-yes">21x</span>
246+
<span class="cline-any cline-yes">21x</span>
247+
<span class="cline-any cline-yes">21x</span>
248+
<span class="cline-any cline-yes">1x</span>
249+
<span class="cline-any cline-yes">1x</span>
250+
<span class="cline-any cline-yes">20x</span>
251+
<span class="cline-any cline-yes">20x</span>
252+
<span class="cline-any cline-yes">21x</span>
253+
<span class="cline-any cline-yes">8x</span>
254+
<span class="cline-any cline-yes">8x</span>
255+
<span class="cline-any cline-yes">12x</span>
256+
<span class="cline-any cline-yes">12x</span>
257+
<span class="cline-any cline-yes">12x</span>
258+
<span class="cline-any cline-yes">12x</span>
259+
<span class="cline-any cline-yes">12x</span>
237260
<span class="cline-any cline-yes">12x</span>
238261
<span class="cline-any cline-yes">12x</span>
239-
<span class="cline-any cline-yes">6x</span>
240-
<span class="cline-any cline-yes">6x</span>
241-
<span class="cline-any cline-yes">6x</span>
242-
<span class="cline-any cline-yes">6x</span>
243-
<span class="cline-any cline-yes">6x</span>
244-
<span class="cline-any cline-yes">6x</span>
262+
<span class="cline-any cline-yes">12x</span>
263+
<span class="cline-any cline-yes">12x</span>
264+
<span class="cline-any cline-yes">12x</span>
265+
<span class="cline-any cline-yes">12x</span>
266+
<span class="cline-any cline-yes">21x</span>
245267
<span class="cline-any cline-yes">1x</span>
246268
<span class="cline-any cline-yes">1x</span>
247269
<span class="cline-any cline-yes">1x</span>
@@ -269,23 +291,25 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
269291
&nbsp;
270292
// MODULES //
271293
&nbsp;
272-
var ndims = require( '@stdlib/ndarray/base/ndims' );
273294
var normalizeIndex = require( '@stdlib/ndarray/base/normalize-index' );
274295
var getShape = require( '@stdlib/ndarray/base/shape' );
275296
var sliceFrom = require( '@stdlib/ndarray/base/slice-from' );
276297
var sliceTo = require( '@stdlib/ndarray/base/slice-to' );
298+
var nulls = require( '@stdlib/array/base/nulls' );
299+
var format = require( '@stdlib/string/format' );
277300
&nbsp;
278301
&nbsp;
279302
// MAIN //
280303
&nbsp;
281304
/**
282-
* Returns an array containing a truncated view of an input ndarray and a complementary view of the last element(s) along a specified dimension.
305+
* Returns an array containing a truncated view of an input ndarray and a view of the last element(s) along a specified dimension.
283306
*
284307
* @param {ndarray} x - input array
285308
* @param {integer} dim - dimension along which to perform the operation
286-
* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking
287309
* @param {boolean} writable - boolean indicating whether returned arrays should be writable
288-
* @returns {Array} a list of ndarrays
310+
* @throws {TypeError} first argument must be an ndarray having one or more dimensions
311+
* @throws {RangeError} dimension index exceeds the number of dimensions
312+
* @returns {Array&lt;ndarray&gt;} a list of ndarrays
289313
*
290314
* @example
291315
* var ndarray = require( '@stdlib/ndarray/ctor' );
@@ -302,7 +326,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
302326
* var arr = ndarray2array( x );
303327
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
304328
*
305-
* var y = pop( x, 0, false, false );
329+
* var y = pop( x, 0, false );
306330
* // returns [ &lt;ndarray&gt;, &lt;ndarray&gt; ]
307331
*
308332
* arr = ndarray2array( y[ 0 ] );
@@ -311,27 +335,36 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
311335
* arr = ndarray2array( y[ 1 ] );
312336
* // returns [ [ 5.0, 6.0 ] ]
313337
*/
314-
function pop( x, dim, strict, writable ) {
338+
function pop( x, dim, writable ) {
315339
var v0;
316340
var v1;
317341
var sh;
318342
var N;
319343
var s;
320-
var i;
321344
&nbsp;
322345
// Retrieve array meta data:
323346
sh = getShape( x );
324-
N = ndims( x );
347+
N = sh.length;
325348
&nbsp;
326-
// Resolve view slice:
327-
s = [];
328-
for ( i = 0; i &lt; N; i++ ) {
329-
s[ i ] = null;
349+
// Check whether we were provided a zero-dimensional array...
350+
if ( N === 0 ) {
351+
throw new TypeError( format( 'invalid argument. First argument must be an ndarray having one or more dimensions. Number of dimensions: %d.', N ) );
330352
}
331-
dim = normalizeIndex( dim, N -1 );
353+
// Normalize the dimension index:
354+
dim = normalizeIndex( dim, N-1 );
355+
if ( dim === -1 ) {
356+
throw new RangeError( format( 'invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.', N, dim ) );
357+
}
358+
// Define a list of slice arguments:
359+
s = nulls( N );
332360
s[ dim ] = sh[ dim ] - 1;
333-
v1 = sliceFrom( x, s, strict, writable );
334-
v0 = sliceTo( x, s, strict, writable );
361+
&nbsp;
362+
// Create a truncated view:
363+
v0 = sliceTo( x, s, true, writable );
364+
&nbsp;
365+
// Create a view of the last element(s):
366+
v1 = sliceFrom( x, s, true, writable );
367+
&nbsp;
335368
return [ v0, v1 ];
336369
}
337370
&nbsp;
@@ -346,7 +379,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
346379
<div class='footer quiet pad2 space-top1 center small'>
347380
Code coverage generated by
348381
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
349-
at 2025-09-21T14:15:47.552Z
382+
at 2025-09-22T08:02:32.356Z
350383
</div>
351384
<script src="../../../../prettify.js"></script>
352385
<script>

0 commit comments

Comments
 (0)