-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
227 additions
and
19 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
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
97 changes: 97 additions & 0 deletions
97
apps/client-e2e/src/tests/notebooks/verify-quiet-notebook-setting.ts
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,97 @@ | ||
import { GetExtensionPath, IDL_COMMANDS, Sleep } from '@idl/shared'; | ||
import { GetWorkspaceConfig, IIDLWorkspaceConfig } from '@idl/vscode/config'; | ||
import { IDL_EXTENSION_CONFIG_KEYS } from '@idl/vscode/extension-config'; | ||
import expect from 'expect'; | ||
import * as vscode from 'vscode'; | ||
|
||
import { RunnerFunction } from '../runner.interface'; | ||
import { ICompareCellOutputs } from './helpers/compare-cells.interface'; | ||
import { | ||
DEFAULT_RUNNER_TIMEOUT, | ||
RunNotebookAndCompareCells, | ||
} from './helpers/run-notebook-and-compare-cells'; | ||
|
||
/** | ||
* Types of outputs from cells that we expect to have | ||
*/ | ||
export const QUIET_OUTPUT: ICompareCellOutputs[] = [ | ||
{ | ||
idx: 0, | ||
success: true, | ||
mimeTypes: [], | ||
}, | ||
]; | ||
|
||
/** | ||
* Types of outputs from cells that we expect to have | ||
*/ | ||
export const NOT_QUIET_OUTPUT: ICompareCellOutputs[] = [ | ||
{ | ||
idx: 0, | ||
success: true, | ||
mimeTypes: ['text/plain'], | ||
}, | ||
]; | ||
|
||
/** | ||
* Function that runs basic tests for ENVI message listeners | ||
*/ | ||
export const VerifyQuietNotebookSetting: RunnerFunction = async (init) => { | ||
// get the current workspace config | ||
const config = GetWorkspaceConfig(); | ||
|
||
// make sure we are quiet | ||
(config as IIDLWorkspaceConfig).update( | ||
IDL_EXTENSION_CONFIG_KEYS.notebooksQuietMode, | ||
true, | ||
true | ||
); | ||
|
||
// run in quiet mode | ||
await RunNotebookAndCompareCells( | ||
GetExtensionPath('idl/test/client-e2e/notebooks/quiet-preference.idlnb'), | ||
QUIET_OUTPUT, | ||
init.notebooks.controller, | ||
DEFAULT_RUNNER_TIMEOUT | ||
); | ||
|
||
// turn off | ||
(config as IIDLWorkspaceConfig).update( | ||
IDL_EXTENSION_CONFIG_KEYS.notebooksQuietMode, | ||
false, | ||
true | ||
); | ||
|
||
// reset | ||
await vscode.commands.executeCommand(IDL_COMMANDS.NOTEBOOKS.RESET); | ||
|
||
// short pause | ||
await Sleep(100); | ||
|
||
// make sure stopped | ||
expect(init.notebooks.controller.isStarted()).toBeTruthy(); | ||
|
||
// run in quiet mode | ||
await RunNotebookAndCompareCells( | ||
GetExtensionPath('idl/test/client-e2e/notebooks/quiet-preference.idlnb'), | ||
NOT_QUIET_OUTPUT, | ||
init.notebooks.controller, | ||
DEFAULT_RUNNER_TIMEOUT | ||
); | ||
|
||
// turn on again | ||
(config as IIDLWorkspaceConfig).update( | ||
IDL_EXTENSION_CONFIG_KEYS.notebooksQuietMode, | ||
true, | ||
true | ||
); | ||
|
||
// stop execution | ||
await vscode.commands.executeCommand(IDL_COMMANDS.NOTEBOOKS.STOP); | ||
|
||
// short pause | ||
await Sleep(100); | ||
|
||
// make sure stopped | ||
expect(init.notebooks.controller.isStarted()).toBeFalsy(); | ||
}; |
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
Binary file not shown.
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,13 @@ | ||
{ | ||
"version": "2.0.0", | ||
"cells": [ | ||
{ | ||
"type": "code", | ||
"content": [ | ||
"message, 'Info', /info" | ||
], | ||
"metadata": {}, | ||
"outputs": [] | ||
} | ||
] | ||
} |
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,12 +1,56 @@ | ||
compile_opt idl2 | ||
|
||
case !true of | ||
!true: begin | ||
|
||
end | ||
else: begin | ||
; do nothing | ||
end | ||
endswitch | ||
;+ | ||
; :Description: | ||
; LatLon_Distance | ||
; Computes the distance of a rhumb line connecting two points on a sphere or spheroid | ||
; | ||
; The distance between the 2 points, [km] by default | ||
; | ||
; :Returns: any | ||
; | ||
; :Arguments: | ||
; lon1: in, required, any | ||
; Longitude and latitude of the 1st point, p0 | ||
; lat1: in, required, any | ||
; Longitude and latitude of the 1st point, p0 | ||
; lon2: in, required, any | ||
; Longitude and latitude of the 2nd point, p1 | ||
; lat2: in, required, any | ||
; Longitude and latitude of the 2nd point, p1 | ||
; method: in, required, any | ||
; The method to be used, options are: | ||
; 1 - Haversine (sphere) - selected by default | ||
; 2 - Vincenty (spheroid) | ||
; | ||
; :Keywords: | ||
; meters: bidirectional, required, any | ||
; Set this keyword to return the distance in meters | ||
; radians: bidirectional, required, any | ||
; Set this keyword if inputs are specified in radians (the default is degrees) | ||
; radius: bidirectional, required, any | ||
; Set this keyword to a value specifying the radius of the sphere to be used, in [km] | ||
; the default value is the Authalic radius (equal area hyothetical perfect sphere) = 6371.0072 | ||
; semimajor_axis: bidirectional, required, any | ||
; Set this keyword to the length of the semimajor axis of the reference ellipsoid, in [m] | ||
; the default value is the WGS-84 6378137 | ||
; semiminor_axis: bidirectional, required, any | ||
; Set this keyword to the length of the semiminor axis of the reference ellipsoid, in [m] | ||
; the default value is the WGS-84 6356752.314245 | ||
; | ||
; :References: | ||
; Haversine formula ( great-circle distance between two points on a sphere ) | ||
; https://en.wikipedia.org/wiki/Haversine_formula | ||
; Vincenty formula ( distance between two points on the surface of a spheroid ) | ||
; https://en.wikipedia.org/wiki/Vincenty%27s_formulae | ||
; https://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf | ||
; | ||
; :Revisions: | ||
; Thu Jul 29, 2021 - Introduce the Vincenty equation (computation of distances over an spheroid) | ||
; Sun Apr 23, 2023 - Fix the Vincenty calculation at latitudes close to zero | ||
; Wed May 10, 2023 - Allow arrays in the Vincenty method | ||
; | ||
;- | ||
function idltasktest, lon1, lat1, lon2, lat2, method, meters = meters, radians = radians, radius = radius, semimajor_axis = semimajor_axis, semiminor_axis = semiminor_axis | ||
compile_opt idl2 | ||
|
||
return, 1 | ||
end |
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,4 +1,4 @@ | ||
/** | ||
* Version of the extension | ||
*/ | ||
export const VERSION = '4.1.0'; | ||
export const VERSION = '4.1.1'; |
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.