Skip to content

Commit

Permalink
Renamed the status object.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Jul 20, 2023
1 parent b12fc9e commit 821034b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions js/runTsne.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BuildNeighborSearchIndexResults, findNearestNeighbors } from "./findNea
* Wrapper around the t-SNE status object on the Wasm heap, typically created by {@linkcode initializeTsne}.
* @hideconstructor
*/
export class InitializeTsneResults {
export class TsneStatus {
#id;
#status;
#coordinates;
Expand All @@ -20,12 +20,12 @@ export class InitializeTsneResults {
}

/**
* @return {InitializeTsneResults} A deep copy of this object.
* @return {TsneStatus} A deep copy of this object.
*/
clone() {
return gc.call(
module => this.#status.deepcopy(),
InitializeTsneResults,
TsneStatus,
this.#coordinates.clone()
);
}
Expand Down Expand Up @@ -108,7 +108,7 @@ export function perplexityToNeighbors(perplexity) {
* @param {?number} [options.numberOfThreads=null] - Number of threads to use.
* If `null`, defaults to {@linkcode maximumThreads}.
*
* @return {InitializeTsneResults} Object containing the initial status of the t-SNE algorithm.
* @return {TsneStatus} Object containing the initial status of the t-SNE algorithm.
*/
export function initializeTsne(x, { perplexity = 30, checkMismatch = true, numberOfThreads = null } = {}) {
var my_neighbors;
Expand Down Expand Up @@ -138,7 +138,7 @@ export function initializeTsne(x, { perplexity = 30, checkMismatch = true, numbe
wasm.call(module => module.randomize_tsne_start(neighbors.numberOfCells(), raw_coords.offset, 42));
output = gc.call(
module => module.initialize_tsne(neighbors.results, perplexity, nthreads),
InitializeTsneResults,
TsneStatus,
raw_coords
);

Expand Down
12 changes: 6 additions & 6 deletions js/runUmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BuildNeighborSearchIndexResults, findNearestNeighbors } from "./findNea
* Wrapper around the UMAP status object on the Wasm heap, typically created by {@linkcode initializeUmap}.
* @hideconstructor
*/
export class InitializeUmapResults {
export class UmapStatus {
#id;
#status;
#coordinates;
Expand All @@ -20,13 +20,13 @@ export class InitializeUmapResults {
}

/**
* @return {InitializeUmapResults} A deep copy of this object.
* @return {UmapStatus} A deep copy of this object.
*/
clone() {
let coord_copy = this.#coordinates.clone();
return gc.call(
module => this.#status.deepcopy(coord_copy.offset),
InitializeUmapResults,
UmapStatus,
coord_copy
);
}
Expand All @@ -40,7 +40,7 @@ export class InitializeUmapResults {

/**
* @return {number} Number of epochs processed so far.
* This changes with repeated invocations of {@linkcode runUmap}, up to the maximum in {@linkcode InitializeUmapResults#totalEpochs totalEpochs}.
* This changes with repeated invocations of {@linkcode runUmap}, up to the maximum in {@linkcode UmapStatus#totalEpochs totalEpochs}.
*/
currentEpoch() {
return this.#status.epoch();
Expand Down Expand Up @@ -109,7 +109,7 @@ export class InitializeUmapResults {
* @param {?number} [options.numberOfThreads=null] - Number of threads to use.
* If `null`, defaults to {@linkcode maximumThreads}.
*
* @return {InitializeUmapResults} Object containing the initial status of the UMAP algorithm.
* @return {UmapStatus} Object containing the initial status of the UMAP algorithm.
*/
export function initializeUmap(x, { neighbors = 15, epochs = 500, minDist = 0.01, numberOfThreads = null } = {}) {
var my_neighbors;
Expand All @@ -130,7 +130,7 @@ export function initializeUmap(x, { neighbors = 15, epochs = 500, minDist = 0.01
raw_coords = utils.createFloat64WasmArray(2 * nnres.numberOfCells());
output = gc.call(
module => module.initialize_umap(nnres.results, epochs, minDist, raw_coords.offset, nthreads),
InitializeUmapResults,
UmapStatus,
raw_coords
);

Expand Down

0 comments on commit 821034b

Please sign in to comment.