Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jul 1, 2024
1 parent 734d0f0 commit d8c0e00
Show file tree
Hide file tree
Showing 19 changed files with 484 additions and 63 deletions.
29 changes: 23 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,27 @@
*.mov binary

# Override what is considered "vendored" by GitHub's linguist:
/deps/** linguist-vendored=false
/lib/node_modules/** linguist-vendored=false linguist-generated=false
test/fixtures/** linguist-vendored=false
tools/** linguist-vendored=false
/lib/node_modules/** -linguist-vendored -linguist-generated

# Override what is considered "documentation" by GitHub's linguist:
examples/** linguist-documentation=false
# Configure directories which should *not* be included in GitHub language statistics:
/deps/** linguist-vendored
/dist/** linguist-generated
/workshops/** linguist-vendored

benchmark/** linguist-vendored
docs/* linguist-documentation
etc/** linguist-vendored
examples/** linguist-documentation
scripts/** linguist-vendored
test/** linguist-vendored
tools/** linguist-vendored

# Configure files which should *not* be included in GitHub language statistics:
Makefile linguist-vendored
*.mk linguist-vendored
*.jl linguist-vendored
*.py linguist-vendored
*.R linguist-vendored

# Configure files which should be included in GitHub language statistics:
docs/types/*.d.ts -linguist-documentation
3 changes: 0 additions & 3 deletions .github/workflows/productionize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

Expand Down Expand Up @@ -518,7 +517,6 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

Expand Down Expand Up @@ -698,7 +696,6 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ jobs:
# Replace branch in README.md link definitions for badges with the new version:
find . -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/branch([=:])[^ ]+/branch\1v${NEW_VERSION}/g"
# Rewrite CHANGELOG.md to replace "Unreleased" with the new version:
sed -Ei "s/Unreleased/${NEW_VERSION}/g" CHANGELOG.md
sed -Ei "s/unreleased/v${NEW_VERSION}/g" CHANGELOG.md
# Create a new commit and tag:
git add package.json README.md
git commit -m "Release v${NEW_VERSION}"
Expand Down Expand Up @@ -218,7 +222,6 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,5 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()
3 changes: 0 additions & 3 deletions .github/workflows/test_bundles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

Expand Down Expand Up @@ -139,7 +138,6 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

Expand Down Expand Up @@ -184,6 +182,5 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()
1 change: 0 additions & 1 deletion .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,5 @@ jobs:
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#npm-ci'
if: failure()
118 changes: 117 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,120 @@

> Package changelog.
See [GitHub Releases](https://github.com/stdlib-js/array-convert/releases) for the changelog.
<section class="release" id="unreleased">

## Unreleased (2024-07-01)

<section class="features">

### Features

- [`adb47ab`](https://github.com/stdlib-js/stdlib/commit/adb47abbac01e5bcc673f1ddd6815cb8ff22d8e3) - add boolean dtype support to `array/convert` [(#2488)](https://github.com/stdlib-js/stdlib/pull/2488)

</section>

<!-- /.features -->

<section class="commits">

### Commits

<details>

- [`adb47ab`](https://github.com/stdlib-js/stdlib/commit/adb47abbac01e5bcc673f1ddd6815cb8ff22d8e3) - **feat:** add boolean dtype support to `array/convert` [(#2488)](https://github.com/stdlib-js/stdlib/pull/2488) _(by Jaysukh Makvana, Athan Reines)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:

- Athan Reines
- Jaysukh Makvana

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

<section class="release" id="v0.2.1">

## 0.2.1 (2024-02-25)

<section class="features">

### Features

- [`819d2e4`](https://github.com/stdlib-js/stdlib/commit/819d2e407146d4dcc17f8bab53b591b3d573f8a1) - add data type maps and replace use of overloads [(#1317)](https://github.com/stdlib-js/stdlib/pull/1317)
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017) - update minimum TypeScript version

</section>

<!-- /.features -->

<section class="bug-fixes">

### Bug Fixes

- [`14bacb3`](https://github.com/stdlib-js/stdlib/commit/14bacb3cbfced427bcbadae7cbc649a62bb62b69) - update import path for `Collection` type definition

</section>

<!-- /.bug-fixes -->

<section class="breaking-changes">

### BREAKING CHANGES

- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017): update minimum TypeScript version
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017): update minimum TypeScript version to 4.1

- To migrate, users should upgrade their TypeScript version to at least version 4.1.

</section>

<!-- /.breaking-changes -->

<section class="commits">

### Commits

<details>

- [`819d2e4`](https://github.com/stdlib-js/stdlib/commit/819d2e407146d4dcc17f8bab53b591b3d573f8a1) - **feat:** add data type maps and replace use of overloads [(#1317)](https://github.com/stdlib-js/stdlib/pull/1317) _(by Philipp Burckhardt, Athan Reines)_
- [`449e0e3`](https://github.com/stdlib-js/stdlib/commit/449e0e34da99537dfab672767e94e4491e02bb45) - **docs:** rename alias _(by Athan Reines)_
- [`e29732d`](https://github.com/stdlib-js/stdlib/commit/e29732dee616e2d94e91f87f78afd8aceb806017) - **feat:** update minimum TypeScript version _(by Philipp Burckhardt)_
- [`14bacb3`](https://github.com/stdlib-js/stdlib/commit/14bacb3cbfced427bcbadae7cbc649a62bb62b69) - **fix:** update import path for `Collection` type definition _(by Athan Reines)_

</details>

</section>

<!-- /.commits -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:

- Athan Reines
- Philipp Burckhardt

</section>

<!-- /.contributors -->

</section>

<!-- /.release -->

11 changes: 10 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Adarsh Palaskar <[email protected]>
Aditya Sapra <[email protected]>
AgPriyanshu18 <[email protected]>
Aleksandr <[email protected]>
Ali Salesi <[email protected]>
Aman Bhansali <[email protected]>
Amit Jimiwal <[email protected]>
Expand All @@ -18,13 +19,15 @@ Chinmay Joshi <[email protected]>
Christopher Dambamuromo <[email protected]>
Dan Rose <[email protected]>
Daniel Killenberger <[email protected]>
Daniel Yu <[email protected]>
Dominik Moritz <[email protected]>
Dorrin Sotoudeh <[email protected]>
EuniceSim142 <[email protected]>
Frank Kovacs <[email protected]>
Golden Kumar <[email protected]>
Gunj Joshi <[email protected]>
Harshita Kalani <[email protected]>
Hridyanshu <[email protected]>
Jaimin Godhani <[email protected]>
James Gelok <[email protected]>
Jaysukh Makvana <[email protected]>
Expand Down Expand Up @@ -60,6 +63,7 @@ Pushpendra Chandravanshi <[email protected]>
Raunak Kumar Gupta <[email protected]>
Rejoan Sardar <[email protected]>
Ricky Reusser <[email protected]>
Ridam Garg <[email protected]>
Robert Gislason <[email protected]>
Roman Stetsyk <[email protected]>
Rutam <[email protected]>
Expand All @@ -69,8 +73,11 @@ Seyyed Parsa Neshaei <[email protected]>
Shashank Shekhar Singh <[email protected]>
Shivam <[email protected]>
Shraddheya Shendre <[email protected]>
Shubh Mehta <[email protected]>
Shubham Mishra <[email protected]>
Snehil Shah <[email protected]>
Sivam Das <[email protected]>
Snehil Shah <[email protected]>
Soumajit Chatterjee <[email protected]>
Spandan Barve <[email protected]>
Stephannie Jiménez Gacha <[email protected]>
Suraj kumar <[email protected]>
Expand All @@ -79,8 +86,10 @@ Tudor Pagu <[email protected]>
Utkarsh <http://[email protected]>
Utkarsh Raj <[email protected]>
Varad Gupta <[email protected]>
Xiaochuan Ye <[email protected]>
Yernar Yergaziyev <[email protected]>
naveen <[email protected]>
nishant-s7 <[email protected]>
orimiles5 <[email protected]>
rainn <[email protected]>
rei2hu <[email protected]>
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ limitations under the License.

[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->

> Convert an array to an array of a different data type.
> Convert an array to an array of a different [data type][@stdlib/array/dtypes].
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

Expand Down Expand Up @@ -75,29 +75,14 @@ var convert = require( '@stdlib/array-convert' );

#### convert( arr, dtype )

Converts an array to an array of a different data type.
Converts an array to an array of a different [data type][@stdlib/array/dtypes].

```javascript
var arr = [ 1.0, 2.0, 3.0 ];
var out = convert( arr, 'float32' );
// returns <Float32Array>[ 1.0, 2.0, 3.0 ]
```

The function supports the following data types:

- `float32`: single-precision floating-point numbers.
- `float64`: double-precision floating-point numbers.
- `complex64`: single-precision complex floating-point numbers.
- `complex128`: double-precision complex floating-point numbers.
- `generic`: values of any type.
- `int16`: signed 16-bit integers.
- `int32`: signed 32-bit integers.
- `int8`: signed 8-bit integers.
- `uint16`: unsigned 16-bit integers.
- `uint32`: unsigned 32-bit integers.
- `uint8`: unsigned 8-bit integers.
- `uint8c`: unsigned clamped 8-bit integers.

</section>

<!-- /.usage -->
Expand Down Expand Up @@ -237,6 +222,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].

[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-convert/main/LICENSE

[@stdlib/array/dtypes]: https://github.com/stdlib-js/array-dtypes

<!-- <related-links> -->

[@stdlib/array/convert-same]: https://github.com/stdlib-js/array-convert-same
Expand Down
27 changes: 26 additions & 1 deletion benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -103,6 +103,31 @@ bench( pkg+':dtype=float32', function benchmark( b ) {
b.end();
});

bench( pkg+':dtype=bool', function benchmark( b ) {
var arr;
var out;
var i;

arr = [];
for ( i = 0; i < 10; i++ ) {
arr.push( i );
}
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr[ 0 ] += 1;
out = convertArray( arr, 'bool' );
if ( out.length !== arr.length ) {
b.fail( 'should have expected length' );
}
}
b.toc();
if ( !isCollection( out ) ) {
b.fail( 'should return an array-like object' );
}
b.pass( 'benchmark finished' );
b.end();
});

bench( pkg+':dtype=complex128', function benchmark( b ) {
var arr;
var out;
Expand Down
Loading

0 comments on commit d8c0e00

Please sign in to comment.