Socket
Socket
Sign inDemoInstall

@stdlib/ndarray-defaults

Package Overview
Dependencies
1
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/ndarray-defaults


Version published
Weekly downloads
679
increased by34.19%
Maintainers
4
Install size
262 kB
Created
Weekly downloads
 

Changelog

Source

0.2.1 (2024-02-21)

<section class="features">

Features

</section> <!-- /.features --> <section class="breaking-changes">

BREAKING CHANGES

  • 7ae5741: update minimum TypeScript version

  • 7ae5741: update minimum TypeScript version to 4.1

    • To migrate, users should upgrade their TypeScript version to at least version 4.1.
  • d45a05b: rename integral to integer

  • d45a05b: rename integral to integer

    • To migrate, users should update their code to use integer rather than integral to refer to the policy/kind which includes both signed and unsigned integer dtypes.
</section> <!-- /.breaking-changes --> <section class="commits">

Commits

<details>
  • 7ae5741 - feat: update minimum TypeScript version (by Philipp Burckhardt)
  • d45a05b - feat: rename integral to integer (by Athan Reines)
  • bd1017d - feat: add numeric and real dtype defaults (by Athan Reines)
  • 9363dc3 - feat: add get method for retrieving a single default setting (by Athan Reines)
  • 35de20d - feat: add ndarray/defaults (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 -->

Readme

Source
About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

defaults

NPM version Build Status Coverage Status

Default ndarray settings.

Installation

npm install @stdlib/ndarray-defaults

Usage

var defaults = require( '@stdlib/ndarray-defaults' );
defaults()

Returns default ndarray settings.

var out = defaults();
// returns {...}

The returned object has the following properties:

  • dtypes: default data types.

    • default: default data type.
    • numeric: default numeric data type.
    • real: default real-valued data type.
    • floating_point: default floating-point data type.
    • real_floating_point: default real-valued floating-point data type.
    • complex_floating_point: default complex-valued floating-point data type.
    • integer: default integer data type.
    • signed_integer: default signed integer data type.
    • unsigned_integer: default unsigned integer data type.
  • order: default memory layout.

  • casting: default casting mode.

  • index_mode: default index mode.

defaults.get( name )

Returns the setting value for a provided setting name.

var v = defaults.get( 'order' );
// returns <string>

v = defaults.get( 'dtypes.floating_point' );
// returns <string>

The setting name corresponds to a flattened object path. For example, the setting name 'dtypes.default' maps to the nested path o.dtypes.default as found in the object returned by defaults().

Examples

var array = require( '@stdlib/ndarray-array' );
var defaults = require( '@stdlib/ndarray-defaults' );

var o = defaults();

var buf = [ [ 1, 2 ], [ 3, 4 ] ];
var opts = {
    'order': o.order,
    'casting': 'unsafe',
    'mode': o.index_mode
};

opts.dtype = o.dtypes.default;
var x = array( buf, opts );
console.log( x.dtype );

opts.dtype = o.dtypes.floating_point;
x = array( buf, opts );
console.log( x.dtype );

opts.dtype = o.dtypes.real_floating_point;
x = array( buf, opts );
console.log( x.dtype );

opts.dtype = o.dtypes.integer;
x = array( buf, opts );
console.log( x.dtype );

opts.dtype = o.dtypes.signed_integer;
x = array( buf, opts );
console.log( x.dtype );

opts.dtype = o.dtypes.unsigned_integer;
x = array( buf, opts );
console.log( x.dtype );

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright © 2016-2024. The Stdlib Authors.

Keywords

FAQs

Last updated on 21 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc