This file contains hidden or 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
import { Embedding, UMAP, Edge, Path } from "./types"; | |
/** | |
* Calculates the Euclidean distance between two UMAP points. | |
* @param umap1 - The first UMAP point | |
* @param umap2 - The second UMAP point | |
* @returns The Euclidean distance between the two points | |
*/ | |
function calculateDistance(umap1: UMAP, umap2: UMAP): number { | |
return Math.sqrt( |
This file contains hidden or 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
from typing import Protocol, TypeAlias, Callable | |
from dataclasses import dataclass | |
from enum import Enum | |
import random | |
import re | |
class CellContent(Enum): | |
EMPTY = " " | |
CROSS = "X" |