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 13, 2024
1 parent cf5f6a3 commit a18cca1
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 43 deletions.
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<section class="release" id="unreleased">

## Unreleased (2024-07-10)
## Unreleased (2024-07-13)

<section class="packages">

Expand Down Expand Up @@ -77,6 +77,28 @@

<!-- /.package -->

<section class="package" id="ndarray-base-buffer-ctors-unreleased">

#### [@stdlib/ndarray/base/buffer-ctors](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/buffer-ctors)

<details>

<section class="features">

##### Features

- [`0f0dbca`](https://github.com/stdlib-js/stdlib/commit/0f0dbcaa7eddb30c09c8cc394224cd4a409b90a6) - add boolean dtype support to `ndarray/base/buffer-ctors` [(#2571)](https://github.com/stdlib-js/stdlib/pull/2571)

</section>

<!-- /.features -->

</details>

</section>

<!-- /.package -->

<section class="package" id="ndarray-base-nullary-unreleased">

#### [@stdlib/ndarray/base/nullary](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/nullary)
Expand Down Expand Up @@ -374,6 +396,7 @@ A total of 3 people contributed to this release. Thank you to the following cont

<details>

- [`0f0dbca`](https://github.com/stdlib-js/stdlib/commit/0f0dbcaa7eddb30c09c8cc394224cd4a409b90a6) - **feat:** add boolean dtype support to `ndarray/base/buffer-ctors` [(#2571)](https://github.com/stdlib-js/stdlib/pull/2571) _(by Jaysukh Makvana, Athan Reines)_
- [`1cb0243`](https://github.com/stdlib-js/stdlib/commit/1cb0243d79c25ae193c058bb15ceeebad6cf3cfd) - **feat:** add boolean dtype support to `ndarray/next-dtype` [(#2553)](https://github.com/stdlib-js/stdlib/pull/2553) _(by Jaysukh Makvana)_
- [`131d649`](https://github.com/stdlib-js/stdlib/commit/131d649c6b22a6247121db1fd380658bf4e83b65) - **feat:** add boolean dtype support to `ndarray/mostly-safe-casts` [(#2554)](https://github.com/stdlib-js/stdlib/pull/2554) _(by Jaysukh Makvana, Athan Reines)_
- [`4e860d8`](https://github.com/stdlib-js/stdlib/commit/4e860d827216f445b5abc569a0d7d7d7e61d83f6) - **feat:** add boolean dtype support to `ndarray/same-kind-casts` [(#2555)](https://github.com/stdlib-js/stdlib/pull/2555) _(by Jaysukh Makvana)_
Expand Down
26 changes: 6 additions & 20 deletions base/buffer-ctors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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 @@ -42,30 +42,14 @@ var ctors = require( '@stdlib/ndarray/base/buffer-ctors' );

#### ctors( dtype )

Returns an ndarray data buffer constructor for a specified data type.
Returns an ndarray data buffer constructor for a specified [data type][@stdlib/ndarray/dtypes].

```javascript
var ctor = ctors( 'float64' );
// returns <Function>
```

The function returns constructors for the following data types:

- `binary`: binary.
- `complex64`: single-precision complex floating-point numbers.
- `complex128`: double-precision complex floating-point numbers.
- `float32`: single-precision floating-point numbers.
- `float64`: double-precision 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.

If provided an unknown or unsupported data type, the function returns `null`.
If provided an unknown or unsupported [data type][@stdlib/ndarray/dtypes], the function returns `null`.

```javascript
var ctor = ctors( 'float' );
Expand Down Expand Up @@ -97,9 +81,9 @@ var dtypes = require( '@stdlib/ndarray/dtypes' );
var ctors = require( '@stdlib/ndarray/base/buffer-ctors' );

var DTYPES = dtypes();

var ctor;
var i;

for ( i = 0; i < DTYPES.length; i++ ) {
ctor = ctors( DTYPES[ i ] );
console.log( ctor );
Expand Down Expand Up @@ -130,6 +114,8 @@ for ( i = 0; i < DTYPES.length; i++ ) {

<section class="links">

[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray/tree/main/dtypes

</section>

<!-- /.links -->
16 changes: 0 additions & 16 deletions base/buffer-ctors/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
{{alias}}( dtype )
Returns an ndarray data buffer constructor.

The function returns constructors for the following data types:

- binary: binary.
- complex64: single-precision complex floating-point numbers.
- complex128: double-precision complex floating-point numbers.
- float32: single-precision floating-point numbers.
- float64: double-precision 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.

Parameters
----------
dtype: string
Expand Down
2 changes: 1 addition & 1 deletion base/buffer-ctors/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ var dtypes = require( './../../../dtypes' );
var ctors = require( './../lib' );

var DTYPES = dtypes();

var ctor;
var i;

for ( i = 0; i < DTYPES.length; i++ ) {
ctor = ctors( DTYPES[ i ] );
console.log( ctor );
Expand Down
6 changes: 4 additions & 2 deletions base/buffer-ctors/lib/ctors.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 @@ -32,6 +32,7 @@ var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Complex64Array = require( '@stdlib/array/complex64' );
var Complex128Array = require( '@stdlib/array/complex128' );
var BooleanArray = require( '@stdlib/array/bool' );


// MAIN //
Expand All @@ -50,7 +51,8 @@ var ctors = {
'uint8': Uint8Array,
'uint8c': Uint8ClampedArray,
'complex64': Complex64Array,
'complex128': Complex128Array
'complex128': Complex128Array,
'bool': BooleanArray
};


Expand Down
9 changes: 6 additions & 3 deletions base/buffer-ctors/test/test.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 @@ -34,6 +34,7 @@ var Uint8Array = require( '@stdlib/array/uint8' );
var Uint8ClampedArray = require( '@stdlib/array/uint8c' );
var Complex64Array = require( '@stdlib/array/complex64' );
var Complex128Array = require( '@stdlib/array/complex128' );
var BooleanArray = require( '@stdlib/array/bool' );
var isFunction = require( '@stdlib/assert/is-function' );
var ctors = require( './../lib' );

Expand Down Expand Up @@ -65,7 +66,8 @@ tape( 'the function returns ndarray data buffer constructors', function test( t
'uint8',
'uint8c',
'complex64',
'complex128'
'complex128',
'bool'
];
expected = [
Buffer,
Expand All @@ -80,7 +82,8 @@ tape( 'the function returns ndarray data buffer constructors', function test( t
Uint8Array,
Uint8ClampedArray,
Complex64Array,
Complex128Array
Complex128Array,
BooleanArray
];
for ( i = 0; i < dtypes.length; i++ ) {
ctor = ctors( dtypes[ i ] );
Expand Down

0 comments on commit a18cca1

Please sign in to comment.