Skip to content

Commit bdd86aa

Browse files
committed
Update artifacts
1 parent b01fcff commit bdd86aa

File tree

4 files changed

+64
-82
lines changed

4 files changed

+64
-82
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[141,148,95.2703,26,29,89.6552,1,1,100,141,148,95.2703,"ddb1a00ff5b203ea6102ea338ed990a24673ee7c","2025-09-07 14:52:25 +0530"]
1+
[137,142,96.4789,18,20,90,1,1,100,137,142,96.4789,"2144ea7696e9ba1c9ff3cdec1124cc5538d1aa3c","2025-09-07 18:45:03 -0700"]

ndarray/base/binary-input-casting-dtype/index.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ <h1><a href="../../../../index.html">All files</a> ndarray/base/binary-input-cas
2323
<div class='clearfix'>
2424

2525
<div class='fl pad1y space-right2'>
26-
<span class="strong">95.27% </span>
26+
<span class="strong">96.47% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>141/148</span>
28+
<span class='fraction'>137/142</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
33-
<span class="strong">89.65% </span>
33+
<span class="strong">90% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>26/29</span>
35+
<span class='fraction'>18/20</span>
3636
</div>
3737

3838

@@ -44,9 +44,9 @@ <h1><a href="../../../../index.html">All files</a> ndarray/base/binary-input-cas
4444

4545

4646
<div class='fl pad1y space-right2'>
47-
<span class="strong">95.27% </span>
47+
<span class="strong">96.47% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>141/148</span>
49+
<span class='fraction'>137/142</span>
5050
</div>
5151

5252

@@ -95,17 +95,17 @@ <h1><a href="../../../../index.html">All files</a> ndarray/base/binary-input-cas
9595

9696
<tr>
9797
<td class="file high" data-value="main.js"><a href="main.js.html">main.js</a></td>
98-
<td data-value="93.51" class="pic high">
99-
<div class="chart"><div class="cover-fill" style="width: 93%"></div><div class="cover-empty" style="width: 7%"></div></div>
98+
<td data-value="95.09" class="pic high">
99+
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
100100
</td>
101-
<td data-value="93.51" class="pct high">93.51%</td>
102-
<td data-value="108" class="abs high">101/108</td>
103-
<td data-value="89.28" class="pct high">89.28%</td>
104-
<td data-value="28" class="abs high">25/28</td>
101+
<td data-value="95.09" class="pct high">95.09%</td>
102+
<td data-value="102" class="abs high">97/102</td>
103+
<td data-value="89.47" class="pct high">89.47%</td>
104+
<td data-value="19" class="abs high">17/19</td>
105105
<td data-value="100" class="pct high">100%</td>
106106
<td data-value="1" class="abs high">1/1</td>
107-
<td data-value="93.51" class="pct high">93.51%</td>
108-
<td data-value="108" class="abs high">101/108</td>
107+
<td data-value="95.09" class="pct high">95.09%</td>
108+
<td data-value="102" class="abs high">97/102</td>
109109
</tr>
110110

111111
</tbody>
@@ -116,7 +116,7 @@ <h1><a href="../../../../index.html">All files</a> ndarray/base/binary-input-cas
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-07T09:23:41.732Z
119+
at 2025-09-08T01:47:35.146Z
120120
</div>
121121
<script src="../../../../prettify.js"></script>
122122
<script>

ndarray/base/binary-input-casting-dtype/index.js.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
164164
'use strict';
165165
&nbsp;
166166
/**
167-
* Resolve the input ndarray casting data type for a binary function.
167+
* Resolve the casting data type for an input ndarray provided to a binary function.
168168
*
169169
* @module @stdlib/ndarray/base/binary-input-casting-dtype
170170
*
@@ -190,7 +190,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
190190
<div class='footer quiet pad2 space-top1 center small'>
191191
Code coverage generated by
192192
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
193-
at 2025-09-07T09:23:41.732Z
193+
at 2025-09-08T01:47:35.146Z
194194
</div>
195195
<script src="../../../../prettify.js"></script>
196196
<script>

ndarray/base/binary-input-casting-dtype/main.js.html

Lines changed: 46 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
2323
<div class='clearfix'>
2424

2525
<div class='fl pad1y space-right2'>
26-
<span class="strong">93.51% </span>
26+
<span class="strong">95.09% </span>
2727
<span class="quiet">Statements</span>
28-
<span class='fraction'>101/108</span>
28+
<span class='fraction'>97/102</span>
2929
</div>
3030

3131

3232
<div class='fl pad1y space-right2'>
33-
<span class="strong">89.28% </span>
33+
<span class="strong">89.47% </span>
3434
<span class="quiet">Branches</span>
35-
<span class='fraction'>25/28</span>
35+
<span class='fraction'>17/19</span>
3636
</div>
3737

3838

@@ -44,9 +44,9 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
4444

4545

4646
<div class='fl pad1y space-right2'>
47-
<span class="strong">93.51% </span>
47+
<span class="strong">95.09% </span>
4848
<span class="quiet">Lines</span>
49-
<span class='fraction'>101/108</span>
49+
<span class='fraction'>97/102</span>
5050
</div>
5151

5252

@@ -165,13 +165,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
165165
<a name='L100'></a><a href='#L100'>100</a>
166166
<a name='L101'></a><a href='#L101'>101</a>
167167
<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>
170-
<a name='L105'></a><a href='#L105'>105</a>
171-
<a name='L106'></a><a href='#L106'>106</a>
172-
<a name='L107'></a><a href='#L107'>107</a>
173-
<a name='L108'></a><a href='#L108'>108</a>
174-
<a name='L109'></a><a href='#L109'>109</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
168+
<a name='L103'></a><a href='#L103'>103</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
175169
<span class="cline-any cline-yes">1x</span>
176170
<span class="cline-any cline-yes">1x</span>
177171
<span class="cline-any cline-yes">1x</span>
@@ -228,52 +222,46 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
228222
<span class="cline-any cline-yes">1x</span>
229223
<span class="cline-any cline-yes">1x</span>
230224
<span class="cline-any cline-yes">1x</span>
231-
<span class="cline-any cline-yes">53x</span>
232-
<span class="cline-any cline-yes">53x</span>
233-
<span class="cline-any cline-yes">53x</span>
234-
<span class="cline-any cline-yes">12x</span>
235-
<span class="cline-any cline-yes">7x</span>
236-
<span class="cline-any cline-yes">7x</span>
225+
<span class="cline-any cline-yes">1x</span>
226+
<span class="cline-any cline-yes">48x</span>
227+
<span class="cline-any cline-yes">48x</span>
228+
<span class="cline-any cline-yes">48x</span>
237229
<span class="cline-any cline-yes">5x</span>
238230
<span class="cline-any cline-yes">5x</span>
239-
<span class="cline-any cline-yes">53x</span>
240231
<span class="cline-any cline-yes">5x</span>
232+
<span class="cline-any cline-yes">48x</span>
241233
<span class="cline-any cline-yes">5x</span>
242-
<span class="cline-any cline-yes">53x</span>
243-
<span class="cline-any cline-yes">10x</span>
234+
<span class="cline-any cline-yes">5x</span>
235+
<span class="cline-any cline-yes">48x</span>
244236
<span class="cline-any cline-yes">10x</span>
245-
<span class="cline-any cline-yes">4x</span>
246-
<span class="cline-any cline-yes">4x</span>
247-
<span class="cline-any cline-yes">6x</span>
248237
<span class="cline-any cline-yes">10x</span>
249-
<span class="cline-any cline-yes">1x</span>
250-
<span class="cline-any cline-yes">1x</span>
251238
<span class="cline-any cline-yes">5x</span>
252239
<span class="cline-any cline-yes">5x</span>
253-
<span class="cline-any cline-yes">53x</span>
254240
<span class="cline-any cline-yes">5x</span>
255-
<span class="cline-any cline-yes">4x</span>
256-
<span class="cline-any cline-yes">4x</span>
257-
<span class="cline-any cline-yes">1x</span>
258241
<span class="cline-any cline-yes">5x</span>
242+
<span class="cline-any cline-yes">48x</span>
243+
<span class="cline-any cline-yes">7x</span>
244+
<span class="cline-any cline-yes">7x</span>
245+
<span class="cline-any cline-yes">7x</span>
246+
<span class="cline-any cline-yes">7x</span>
247+
<span class="cline-any cline-yes">6x</span>
248+
<span class="cline-any cline-yes">6x</span>
249+
<span class="cline-any cline-yes">1x</span>
250+
<span class="cline-any cline-yes">7x</span>
259251
<span class="cline-any cline-no">&nbsp;</span>
260252
<span class="cline-any cline-no">&nbsp;</span>
261-
<span class="cline-any cline-no">&nbsp;</span>
262-
<span class="cline-any cline-no">&nbsp;</span>
263-
<span class="cline-any cline-yes">5x</span>
264-
<span class="cline-any cline-yes">1x</span>
265253
<span class="cline-any cline-yes">1x</span>
266254
<span class="cline-any cline-yes">1x</span>
267255
<span class="cline-any cline-yes">1x</span>
268256
<span class="cline-any cline-no">&nbsp;</span>
269257
<span class="cline-any cline-no">&nbsp;</span>
270258
<span class="cline-any cline-no">&nbsp;</span>
271259
<span class="cline-any cline-yes">21x</span>
272-
<span class="cline-any cline-yes">53x</span>
260+
<span class="cline-any cline-yes">48x</span>
273261
<span class="cline-any cline-yes">7x</span>
274262
<span class="cline-any cline-yes">7x</span>
275263
<span class="cline-any cline-yes">14x</span>
276-
<span class="cline-any cline-yes">53x</span>
264+
<span class="cline-any cline-yes">48x</span>
277265
<span class="cline-any cline-yes">1x</span>
278266
<span class="cline-any cline-yes">1x</span>
279267
<span class="cline-any cline-yes">1x</span>
@@ -297,7 +285,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
297285
* limitations under the License.
298286
*/
299287
&nbsp;
300-
/* eslint-disable id-length, function-paren-newline */
288+
/* eslint-disable id-length, max-len */
301289
&nbsp;
302290
'use strict';
303291
&nbsp;
@@ -307,8 +295,9 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
307295
var isSignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-signed-integer-data-type' );
308296
var isUnsignedIntegerDataType = require( '@stdlib/ndarray/base/assert/is-unsigned-integer-data-type' );
309297
var isDataType = require( '@stdlib/ndarray/base/assert/is-data-type' );
310-
var promotionRules = require( '@stdlib/ndarray/promotion-rules' );
298+
var promoteDataTypes = require( '@stdlib/ndarray/base/promote-dtypes' );
311299
var defaults = require( '@stdlib/ndarray/defaults' );
300+
var join = require( '@stdlib/array/base/join' );
312301
var format = require( '@stdlib/string/format' );
313302
&nbsp;
314303
&nbsp;
@@ -322,10 +311,10 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
322311
// MAIN //
323312
&nbsp;
324313
/**
325-
* Resolves the input ndarray casting data type for a binary function.
314+
* Resolves the casting data type for an input ndarray provided to a binary function.
326315
*
327-
* @param {string} idtype1 - first input ndarray data type
328-
* @param {string} idtype2 - second input ndarray data type
316+
* @param {string} idtype1 - input ndarray data type
317+
* @param {string} idtype2 - additional input ndarray data type
329318
* @param {string} odtype - output ndarray data type
330319
* @param {string} policy - input ndarray data type casting policy
331320
* @throws {TypeError} fourth argument must be a recognized data type policy
@@ -339,39 +328,32 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
339328
function resolve( idtype1, idtype2, odtype, policy ) {
340329
var dt;
341330
if ( policy === 'none' ) {
342-
if (idtype1 !== idtype2) {
343-
throw new Error( format( 'Inputs must match under "none" policy. Got %s and %s.', idtype1, idtype2 ) );
344-
}
331+
// When the policy is 'none', casting behavior is implementation-defined, so we just return the input ndarray data type as is...
345332
return idtype1;
346333
}
347334
if ( policy === 'output' ) {
348335
return odtype;
349336
}
350337
if ( policy === 'promoted' ) {
351-
dt = promotionRules( idtype1, idtype2 );
352-
if ( dt === -1 ) {
353-
throw new Error( format( 'invalid operation. Unable to promote the first input and second input data types. First input data type: %s. Second input data type: %s.', idtype1, idtype2 ) );
354-
}
355-
dt = promotionRules( dt, odtype );
356-
if ( dt === -1 ) {
357-
throw new Error( format( 'invalid operation. Unable to promote the input and output data types. Input data type: %s. Output data type: %s.', dt, odtype ) );
338+
dt = promoteDataTypes( [ idtype1, idtype2, odtype ] );
339+
if ( dt === null ) {
340+
throw new Error( format( 'invalid operation. Unable to promote the input and output data types. Input data types: [%s]. Output data type: %s.', join( [ idtype1, idtype2 ], ', ' ), odtype ) );
358341
}
359342
return dt;
360343
}
361344
if ( policy === 'accumulation' ) {
362-
if ( isFloatingPointDataType( idtype1 ) || isFloatingPointDataType( idtype2 ) || idtype1 === 'generic' || idtype2 === 'generic' ) { // NOTE: we may want to revisit this in the future for float16/complex32, where the value range is much more limited
363-
return promotionRules(idtype1, idtype2);
345+
// When the accumulation policy is 'accumulation', we consider the input ndarray data type in isolation, irrespective of the output data type or the data types of additional input ndarrays...
346+
&nbsp;
347+
// If an input data type is floating-point, allow accumulation in that data type as overflow/underflow is handled naturally as a built-in feature of that data type...
348+
if ( isFloatingPointDataType( idtype1 ) || idtype1 === 'generic' ) { // NOTE: we may want to revisit this in the future for float16/complex32, where the value range is much more limited
349+
return idtype1;
364350
}
365-
// Unless the input data type value range is larger than the default un/signed integer data type, accumulate in the default un/signed integer data type, as accumulating in smaller range integer data types (e.g., `int8`) are at high risk for overflow, especially for ndarrays containing many elements...
366-
if ( isUnsignedIntegerDataType( idtype1 ) <span class="branch-0 cbranch-no" title="branch not covered" >&amp;&amp; isUnsignedIntegerDataType( idtype2 ) </span>) <span class="branch-0 cbranch-no" title="branch not covered" >{ // eslint-disable-line max-len</span>
367-
<span class="cstat-no" title="statement not covered" > return promotionRules(</span>
368-
<span class="cstat-no" title="statement not covered" > promotionRules(idtype1, idtype2), DEFAULT_UNSIGNED_INTEGER_DTYPE</span>
369-
<span class="cstat-no" title="statement not covered" > );</span>
351+
// Unless an input data type value range is larger than the default un/signed integer data type, accumulate in the default un/signed integer data type, as accumulating in smaller range integer data types (e.g., `int8`) are at high risk for overflow, especially for ndarrays containing many elements...
352+
if ( isUnsignedIntegerDataType( idtype1 ) ) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
353+
<span class="cstat-no" title="statement not covered" > return promoteDataTypes( [ idtype1, DEFAULT_UNSIGNED_INTEGER_DTYPE ] );</span>
370354
<span class="cstat-no" title="statement not covered" > }</span>
371-
if ( isSignedIntegerDataType( idtype1 ) &amp;&amp; isSignedIntegerDataType( idtype2 ) ) { // eslint-disable-line max-len
372-
return promotionRules(
373-
promotionRules(idtype1, idtype2), DEFAULT_SIGNED_INTEGER_DTYPE
374-
);
355+
if ( isSignedIntegerDataType( idtype1 ) ) {
356+
return promoteDataTypes( [ idtype1, DEFAULT_SIGNED_INTEGER_DTYPE ] );
375357
}
376358
<span class="cstat-no" title="statement not covered" ><span class="branch-0 cbranch-no" title="branch not covered" > // For all other input data types, accumulate in the default real-valued floating-point data type...</span></span>
377359
<span class="cstat-no" title="statement not covered" > return DEFAULT_REAL_FLOATING_POINT_DTYPE;</span>
@@ -394,7 +376,7 @@ <h1><a href="../../../../index.html">All files</a> / <a href="index.html">ndarra
394376
<div class='footer quiet pad2 space-top1 center small'>
395377
Code coverage generated by
396378
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
397-
at 2025-09-07T09:23:41.732Z
379+
at 2025-09-08T01:47:35.146Z
398380
</div>
399381
<script src="../../../../prettify.js"></script>
400382
<script>

0 commit comments

Comments
 (0)