Skip to content

Commit b999805

Browse files
Merge branch 'develop' of https://github.com/Neerajpathak07/stdlib into test-dnansumors
2 parents 1c415a1 + 7fd112c commit b999805

File tree

145 files changed

+9649
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+9649
-49
lines changed

.github/workflows/scripts/generate_pr_commit_message

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ github_api() {
117117
curl -s "${headers[@]}" "$GITHUB_API_URL$endpoint"
118118
;;
119119
POST)
120-
# For POST requests, always set the Content-Type header>
120+
# For POST requests, always set the Content-Type header:
121121
headers+=("-H" "Content-Type: application/json")
122122

123123
# If data is provided, include it in the request:
@@ -156,13 +156,22 @@ main() {
156156
pr_commits=$(github_api "GET" "/repos/$REPO_OWNER/$REPO_NAME/pulls/$pr_number/commits")
157157

158158
# Extract co-authors from commit messages:
159+
co_authors=$(echo "$pr_commits" | jq -r '.[].commit.message' | grep -Eio 'Co-authored-by:.*' | sort -u)
159160
processed_co_authors=""
160161
while IFS= read -r co_author_line; do
162+
# Skip empty lines:
163+
if [ -z "$co_author_line" ]; then
164+
continue
165+
fi
161166
name_email=$(echo "$co_author_line" | sed -E 's/Co-authored-by:[[:space:]]*(.*)/\1/')
162167
name=$(echo "$name_email" | sed -E 's/^(.*)<.*>$/\1/' | xargs)
163168
email=$(echo "$name_email" | sed -E 's/^.*<(.*)>$/\1/' | xargs)
164169
resolved_author=$(resolve_name_email "$name" "$email")
165170

171+
# Skip if the resolved author matches the resolved PR author:
172+
if [ "$resolved_author" == "$pr_author_resolved" ]; then
173+
continue
174+
fi
166175
processed_co_authors+="Co-authored-by: $resolved_author"$'\n'
167176
done <<< "$co_authors"
168177

@@ -195,11 +204,13 @@ main() {
195204
# Remove any empty lines and duplicates:
196205
commit_authors=$(echo "$commit_authors" | sort -u | sed '/^$/d')
197206

198-
# Prefix with 'Co-authored-by: ':
199-
commit_authors_formatted=$(echo "$commit_authors" | sed 's/^/Co-authored-by: /' | sort -u)
207+
# Prefix with 'Co-authored-by: ' if not empty:
208+
if [ -n "$commit_authors" ]; then
209+
commit_authors=$(echo "$commit_authors" | sed 's/^/Co-authored-by: /' | sort -u)
210+
fi
200211

201-
# Combine co-authors and commit authors:
202-
all_co_authors=$(echo -e "$co_authors\n$commit_authors_formatted" | sort -u | sed '/^$/d')
212+
# Combine co-authors and commit authors, removing empty lines:
213+
all_co_authors=$(echo -e "$processed_co_authors\n$commit_authors" | sed '/^\s*$/d' | sort -u)
203214

204215
# Extract 'Signed-off-by' lines from commits:
205216
signed_off_bys=$(echo "$pr_commits" | jq -r '.[].commit.message' | grep -Eio 'Signed-off-by:.*' | sort -u)

.github/workflows/windows_test_npm_install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ jobs:
242242
# Install Windows build tools for compiling Node.js native add-ons.
243243
- name: 'Install Windows build tools'
244244
# Pin action to full length commit SHA
245-
uses: crazy-max/ghaction-chocolatey@0e015857dd851f84fcb7fb53380eb5c4c8202333 # v3.0.0
245+
uses: crazy-max/ghaction-chocolatey@2ae99523e93879734d432250f87e2c45c379cd60 # v3.2.0
246246
with:
247247
args: install -y visualstudio2019buildtools visualstudio2019-workload-vctools
248248
timeout-minutes: 10

lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/test/test.dnansumkbn.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
162162
t.end();
163163
});
164164

165+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
166+
var x;
167+
var v;
168+
169+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
170+
171+
v = dnansumkbn( x.length, x, 0 );
172+
t.strictEqual( v, 0.0, 'returns expected value' );
173+
174+
t.end();
175+
});
176+
165177
tape( 'the function supports view offsets', function test( t ) {
166178
var x0;
167179
var x1;

lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/test/test.dnansumkbn.native.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
253253
t.end();
254254
});
255255

256+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
257+
var x;
258+
var v;
259+
260+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
261+
262+
v = dnansumkbn( x.length, x, 0 );
263+
t.strictEqual( v, 0.0, 'returns expected value' );
264+
265+
t.end();
266+
});
267+
256268
tape( 'the function supports view offsets', opts, function test( t ) {
257269
var x0;
258270
var x1;

lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/test/test.ndarray.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
162162
t.end();
163163
});
164164

165+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ) {
166+
var x;
167+
var v;
168+
169+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
170+
171+
v = dnansumkbn( x.length, x, 0, 0 );
172+
t.strictEqual( v, 0.0, 'returns expected value' );
173+
174+
t.end();
175+
});
176+
165177
tape( 'the function supports an `offset` parameter', function test( t ) {
166178
var x;
167179
var v;

lib/node_modules/@stdlib/blas/ext/base/dnansumkbn/test/test.ndarray.native.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the s
171171
t.end();
172172
});
173173

174+
tape( 'if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', opts, function test( t ) {
175+
var x;
176+
var v;
177+
178+
x = new Float64Array( [ NaN, -2.0, -4.0, 5.0, 3.0 ] );
179+
180+
v = dnansumkbn( x.length, x, 0, 0 );
181+
t.strictEqual( v, 0.0, 'returns expected value' );
182+
183+
t.end();
184+
});
185+
174186
tape( 'the function supports an `offset` parameter', opts, function test( t ) {
175187
var x;
176188
var v;
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2024 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# FLOAT32_LN2
22+
23+
> [Natural logarithm][@stdlib/math/base/special/lnf] of `2` as a single-precision floating-point number.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var FLOAT32_LN2 = require( '@stdlib/constants/float32/ln-two' );
31+
```
32+
33+
#### FLOAT32_LN2
34+
35+
[Natural logarithm][@stdlib/math/base/special/lnf] of `2` as a single-precision floating-point number.
36+
37+
```javascript
38+
var bool = ( FLOAT32_LN2 === 0.6931471824645996 );
39+
// returns true
40+
```
41+
42+
</section>
43+
44+
<!-- /.usage -->
45+
46+
<section class="examples">
47+
48+
## Examples
49+
50+
<!-- eslint no-undef: "error" -->
51+
52+
```javascript
53+
var FLOAT32_LN2 = require( '@stdlib/constants/float32/ln-two' );
54+
55+
console.log( FLOAT32_LN2 );
56+
// => 0.6931471824645996
57+
```
58+
59+
</section>
60+
61+
<!-- /.examples -->
62+
63+
<!-- C interface documentation. -->
64+
65+
* * *
66+
67+
<section class="c">
68+
69+
## C APIs
70+
71+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
72+
73+
<section class="intro">
74+
75+
</section>
76+
77+
<!-- /.intro -->
78+
79+
<!-- C usage documentation. -->
80+
81+
<section class="usage">
82+
83+
### Usage
84+
85+
```c
86+
#include "stdlib/constants/float32/ln_two.h"
87+
```
88+
89+
#### STDLIB_CONSTANT_FLOAT32_LN2
90+
91+
Macro for the [natural logarithm][@stdlib/math/base/special/lnf] of `2` as a single-precision floating-point number.
92+
93+
</section>
94+
95+
<!-- /.usage -->
96+
97+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
98+
99+
<section class="notes">
100+
101+
</section>
102+
103+
<!-- /.notes -->
104+
105+
<!-- C API usage examples. -->
106+
107+
<section class="examples">
108+
109+
</section>
110+
111+
<!-- /.examples -->
112+
113+
</section>
114+
115+
<!-- /.c -->
116+
117+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
118+
119+
<section class="related">
120+
121+
</section>
122+
123+
<!-- /.related -->
124+
125+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
126+
127+
<section class="links">
128+
129+
[@stdlib/math/base/special/lnf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/lnf
130+
131+
<!-- <related-links> -->
132+
133+
<!-- </related-links> -->
134+
135+
</section>
136+
137+
<!-- /.links -->
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
{{alias}}
3+
Natural logarithm of `2` as a single-precision floating-point number.
4+
5+
Examples
6+
--------
7+
> {{alias}}
8+
0.6931471824645996
9+
10+
See Also
11+
--------
12+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 4.1
20+
21+
/**
22+
* Natural logarithm of `2` as a single-precision floating-point number.
23+
*
24+
* @example
25+
* var val = FLOAT32_LN2;
26+
* // returns 0.6931471824645996
27+
*/
28+
declare const FLOAT32_LN2: number;
29+
30+
31+
// EXPORTS //
32+
33+
export = FLOAT32_LN2;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2024 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import FLOAT32_LN2 = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The export is a number...
25+
{
26+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
27+
FLOAT32_LN2; // $ExpectType number
28+
}

0 commit comments

Comments
 (0)