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 Aug 12, 2021
1 parent c9ba4bf commit 23e3ec0
Show file tree
Hide file tree
Showing 92 changed files with 332 additions and 115 deletions.
32 changes: 32 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ insert_final_newline = true
[*.js]
indent_style = tab

[*.js.txt]
indent_style = tab

# Set properties for JavaScript ES module files:
[*.mjs]
indent_style = tab

[*.mjs.txt]
indent_style = tab

# Set properties for JavaScript CommonJS files:
[*.cjs]
indent_style = tab

[*.cjs.txt]
indent_style = tab

# Set properties for TypeScript files:
[*.ts]
indent_style = tab
Expand Down Expand Up @@ -84,6 +101,11 @@ indent_style = tab
indent_style = tab
tab_width = 2

# Set properties for XML files:
[*.xml]
indent_style = tab
tab_width = 2

# Set properties for CSS files:
[*.css]
indent_style = tab
Expand All @@ -101,6 +123,11 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.md.txt]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

# Set properties for `usage.txt` files:
[usage.txt]
indent_style = space
Expand All @@ -121,6 +148,11 @@ indent_size = 2
indent_style = space
indent_size = 2

# Set properties for `manifest.json` files:
[manifest.json]
indent_style = space
indent_size = 2

# Set properties for `tslint.json` files:
[tslint.json]
indent_style = space
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
name: Publish Package

# Workflow triggers:
on: push
on:
push:
tags: v[0-9]+.[0-9]+.[0-9]+

# Workflow jobs:
jobs:
Expand All @@ -33,20 +35,20 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 15
- name: Increment version
- name: Replace all GitHub links to individual packages with npm links
run: |
git config --local user.email "[email protected]"
git config --local user.name "stdlib-bot"
npm version patch
find . -type f -name '*.md' -print0 | xargs -0 sed -Ei 's/@stdlib\/([^:]*)\]: https:\/\/github.com\/stdlib-js/@stdlib\/\1\]: https:\/\/www.npmjs.com\/package\/@stdlib/g'
- name: Replace all stdlib GitHub dependencies with the respective npm packages
run: |
find package.json -type f -print0 | xargs -0 sed -Ei 's/"github:stdlib-js[^"]*"/"^0.0.x"/g'
- name: Publish package to npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
- name: Push changes
- name: Discard any uncommitted changes
run: |
git push origin main
git push --tags
git reset --hard
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Files #
#########
.postinstall.json


# Directories #
###############
Expand Down Expand Up @@ -70,9 +70,6 @@ tmp/
*.tar
*.zip

# Make an exception for compressed distributable files:
!dist/*.gz

# Logs and databases #
######################
*.log
Expand Down
3 changes: 3 additions & 0 deletions array/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
],
"main": "./lib",
"directories": {
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"lib": "./lib",
"test": "./test"
},
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-allowed-data-type-cast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-buffer-length-compatible-shape/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-buffer-length-compatible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-column-major-contiguous/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-column-major/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-contiguous/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-row-major-contiguous/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-row-major/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-safe-data-type-cast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-same-kind-data-type-cast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/assert/is-single-segment-compatible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
1 change: 1 addition & 0 deletions base/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"main": "lib/index.js",
"directories": {
"doc": "./docs",
"example": "./examples",
"lib": "./lib",
"test": "./test"
Expand Down
2 changes: 2 additions & 0 deletions base/bind2vind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
4 changes: 2 additions & 2 deletions base/bind2vind/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int64_t stdlib_ndarray_bind2vind( int64_t ndims, int64_t *shape, int64_t *stride
idx -= k * s;
k += shape[ i ] - 1;
} else {
k = idx / s; // truncates
k = idx / s; // cppcheck-suppress zerodivcond // truncates
idx -= k * s;
}
ind += k * llabs( s );
Expand All @@ -115,7 +115,7 @@ int64_t stdlib_ndarray_bind2vind( int64_t ndims, int64_t *shape, int64_t *stride
idx -= k * s;
k += shape[ i ] - 1;
} else {
k = idx / s; // truncates
k = idx / s; // cppcheck-suppress zerodivcond // truncates
idx -= k * s;
}
ind += k * llabs( s );
Expand Down
3 changes: 2 additions & 1 deletion base/broadcast-shapes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ If successful, the function returns `0`; otherwise, the function returns `-1` (e
#include "stdlib/ndarray/base/broadcast_shapes.h"
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>
int main() {
int64_t N1 = 4;
Expand All @@ -362,7 +363,7 @@ int main() {
int64_t i;
printf( "shape = ( " );
for ( i = 0; i < N1; i++ ) {
printf( "%lli", out[ i ] );
printf( "%"PRId64"", out[ i ] );
if ( i < N1-1 ) {
printf( ", " );
}
Expand Down
3 changes: 2 additions & 1 deletion base/broadcast-shapes/examples/c/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "stdlib/ndarray/base/broadcast_shapes.h"
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>

int main() {
int64_t N1 = 4;
Expand All @@ -39,7 +40,7 @@ int main() {
int64_t i;
printf( "shape = ( " );
for ( i = 0; i < N1; i++ ) {
printf( "%lli", out[ i ] );
printf( "%"PRId64"", out[ i ] );
if ( i < N1-1 ) {
printf( ", " );
}
Expand Down
2 changes: 2 additions & 0 deletions base/bytes-per-element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/clamp-index/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
2 changes: 2 additions & 0 deletions base/dtype-char/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
18 changes: 9 additions & 9 deletions base/function-object/examples/c/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,26 @@ int main() {
obj->data = data;

printf( "name = %s\n", obj->name );
printf( "nin = %u\n", obj->nin );
printf( "nout = %u\n", obj->nout );
printf( "narrays = %u\n", obj->narrays );
printf( "nfunctions = %u\n", obj->nfunctions );
printf( "nin = %i\n", obj->nin );
printf( "nout = %i\n", obj->nout );
printf( "narrays = %i\n", obj->narrays );
printf( "nfunctions = %i\n", obj->nfunctions );

// Free allocated memory:
stdlib_ndarray_function_free( obj );

// Use the function interface to create an ndarray function object...
struct ndarrayFunctionObject *obj2 = stdlib_ndarray_function_allocate( "unary_ndarray_function_2", 1, 1, functions, 1, types, data );
if ( obj == NULL ) {
if ( obj2 == NULL ) {
fprintf( stderr, "Error allocating memory.\n" );
exit( 1 );
}

printf( "name = %s\n", obj2->name );
printf( "nin = %u\n", obj2->nin );
printf( "nout = %u\n", obj2->nout );
printf( "narrays = %u\n", obj2->narrays );
printf( "nfunctions = %u\n", obj2->nfunctions );
printf( "nin = %i\n", obj2->nin );
printf( "nout = %i\n", obj2->nout );
printf( "narrays = %i\n", obj2->narrays );
printf( "nfunctions = %i\n", obj2->nfunctions );

// Free allocated memory:
stdlib_ndarray_function_free( obj );
Expand Down
1 change: 1 addition & 0 deletions base/function-object/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"fcn",
"c",
"n-api",
"node-api",
"napi"
],
"__stdlib__": {}
Expand Down
2 changes: 2 additions & 0 deletions base/ind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"benchmark": "./benchmark",
"doc": "./docs",
"example": "./examples",
"include": "./include",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"types": "./docs/types",
Expand Down
Loading

0 comments on commit 23e3ec0

Please sign in to comment.