-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: migrate to TypeScript (#26)
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
- Loading branch information
1 parent
bea14eb
commit 9bf14de
Showing
39 changed files
with
875 additions
and
747 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
extends: cheminfo | ||
parserOptions: | ||
sourceType: module | ||
extends: cheminfo-typescript |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Deploy TypeDoc on GitHub pages | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
NODE_VERSION: 16.x | ||
ENTRY_FILE: 'src/index.ts' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build documentation | ||
uses: zakodium/typedoc-action@v2 | ||
with: | ||
entry: ${{ env.ENTRY_FILE }} | ||
- name: Deploy to GitHub pages | ||
uses: JamesIves/github-pages-deploy-action@releases/v4 | ||
with: | ||
token: ${{ secrets.BOT_TOKEN }} | ||
branch: gh-pages | ||
folder: docs | ||
clean: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ dist/ | |
.vscode | ||
docs | ||
lib | ||
lib-esm | ||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"arrowParens": "always", | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { readFileSync as rfs } from 'node:fs'; | ||
import { join } from 'node:path'; | ||
|
||
import { NetCDFReader } from '../src/index'; | ||
|
||
const data = rfs(join(__dirname, '../src/__tests__/files/agilent_hplc.cdf')); | ||
|
||
let reader = new NetCDFReader(data); | ||
|
||
let selectedVariable = reader.variables[4]; | ||
|
||
reader.getDataVariable(selectedVariable); | ||
|
||
for (let variable of reader.variables) { | ||
console.log(variable.name, reader.getDataVariable(variable)); | ||
} | ||
|
||
let ordinates = reader.getDataVariable(reader.variables[5]); | ||
console.log(Math.max(...(ordinates as number[]))); | ||
console.log(Math.min(...(ordinates as number[]))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
preset: 'ts-jest/presets/js-with-ts', | ||
testEnvironment: 'node', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { readFileSync } from 'fs'; | ||
|
||
import { NetCDFReader } from '../parser'; | ||
|
||
const pathFiles = `${__dirname}/files/`; | ||
|
||
test('attributeExists', () => { | ||
const data = readFileSync(`${pathFiles}P071.CDF`); | ||
|
||
let reader = new NetCDFReader(data); | ||
expect(reader.attributeExists('operator_name')).toBe(true); | ||
expect(reader.attributeExists('operator_nameXX')).toBe(false); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { readFileSync } from 'fs'; | ||
|
||
import { NetCDFReader } from '../parser'; | ||
|
||
const pathFiles = `${__dirname}/files/`; | ||
|
||
test('dataVariableExists', () => { | ||
const data = readFileSync(`${pathFiles}P071.CDF`); | ||
|
||
let reader = new NetCDFReader(data); | ||
expect(reader.dataVariableExists('instrument_name')).toBe(true); | ||
expect(reader.dataVariableExists('instrument_nameXX')).toBe(false); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { readFileSync } from 'fs'; | ||
|
||
import { NetCDFReader } from '../parser'; | ||
|
||
const pathFiles = `${__dirname}/files/`; | ||
|
||
test('getAttribute', () => { | ||
const data = readFileSync(`${pathFiles}P071.CDF`); | ||
|
||
let reader = new NetCDFReader(data); | ||
expect(reader.getAttribute('operator_name')).toBe('SC'); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { readFileSync } from 'fs'; | ||
|
||
import { NetCDFReader } from '../parser'; | ||
|
||
const pathFiles = `${__dirname}/files/`; | ||
|
||
test('getDataVariableAsString', () => { | ||
const data = readFileSync(`${pathFiles}P071.CDF`); | ||
|
||
let reader = new NetCDFReader(data); | ||
expect(reader.getDataVariableAsString('instrument_name')).toBe( | ||
'Gas Chromatograph', | ||
); | ||
}); |
Oops, something went wrong.