Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openchemistry/utils

Package Overview
Dependencies
Maintainers
3
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openchemistry/utils - npm Package Compare versions

Comparing version 0.3.3 to 0.4.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

<a name="0.4.0"></a>
# [0.4.0](https://github.com/OpenChemistry/oc-web-components/compare/@openchemistry/utils@0.3.3...@openchemistry/utils@0.4.0) (2018-08-10)
### Features
* **utils:** Add a function similar to numpy.linspace ([e70627e](https://github.com/OpenChemistry/oc-web-components/commit/e70627e))
<a name="0.3.3"></a>

@@ -8,0 +19,0 @@ ## [0.3.3](https://github.com/OpenChemistry/oc-web-components/compare/@openchemistry/utils@0.3.2...@openchemistry/utils@0.3.3) (2018-08-01)

1

dist/arrays.d.ts
export declare function rowMaj2colMaj3d(scalars: number[], dims: [number, number, number]): Float32Array;
export declare function makeBins(scalars: number[], nBins?: number, range?: number[] | undefined): number[];
export declare function linearSpace(start: number, stop: number, num: number, endPoint?: boolean): number[];

@@ -33,1 +33,13 @@ export function rowMaj2colMaj3d(scalars, dims) {

}
export function linearSpace(start, stop, num, endPoint) {
if (endPoint === void 0) { endPoint = true; }
// Function similar to numpy.linspace
var arr = [];
var delta = stop - start;
var denom = endPoint ? num - 1 : num;
for (var i = 0; i < num; ++i) {
var val = start + delta * (i / denom);
arr.push(val);
}
return arr;
}

2

package.json
{
"name": "@openchemistry/utils",
"version": "0.3.3",
"version": "0.4.0",
"description": "Utilities to validate and convert cjson chemical data",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -13,4 +13,4 @@ export function rowMaj2colMaj3d(scalars: number[], dims: [number, number, number]) : Float32Array {

export function makeBins(scalars: number[], nBins = 50, range: number[] | undefined = undefined) {
let h = [];
export function makeBins(scalars: number[], nBins = 50, range: number[] | undefined = undefined) : number[] {
let h: number[] = [];
for (let i = 0; i <= nBins; ++i) {

@@ -35,2 +35,14 @@ h.push(0);

return h;
}
}
export function linearSpace(start: number, stop: number, num: number, endPoint: boolean = true) : number[] {
// Function similar to numpy.linspace
let arr: number[] = [];
let delta = stop - start;
let denom = endPoint ? num - 1 : num;
for (let i = 0; i < num; ++i) {
let val = start + delta * (i / denom);
arr.push(val);
}
return arr;
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc