diff --git a/.github/workflows/build-and-release-linux.yml b/.github/workflows/build-and-release-linux.yml index b924117..54e9cbf 100644 --- a/.github/workflows/build-and-release-linux.yml +++ b/.github/workflows/build-and-release-linux.yml @@ -38,12 +38,7 @@ jobs: - name: Install dependencies run: npm install - - name: Build + - name: Build and deploy on Linux(Debian) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run build:linux - - - name: Deploy Linux - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run publish -- --publish=always + run: npm run build:linux --publish=always diff --git a/.github/workflows/build-and-release-mac.yml b/.github/workflows/build-and-release-mac.yml index ea5a2f3..0f6417d 100644 --- a/.github/workflows/build-and-release-mac.yml +++ b/.github/workflows/build-and-release-mac.yml @@ -43,12 +43,7 @@ jobs: p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }} - - name: Build Mac + - name: Build and deploy on MacOS env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run build:mac - - - name: Deploy Mac - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run publish -- --publish=always \ No newline at end of file + run: npm run build:mac -- --publish=always diff --git a/.github/workflows/build-and-release-win.yml b/.github/workflows/build-and-release-win.yml index 29fa425..15d65b9 100644 --- a/.github/workflows/build-and-release-win.yml +++ b/.github/workflows/build-and-release-win.yml @@ -41,9 +41,4 @@ jobs: - name: Build and deploy on Windows env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run build:win - - - name: Deploy Windows - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run publish -- --publish=always + run: npm run build:win -- --publish=always diff --git a/.github/workflows/test-build-linux.yml b/.github/workflows/test-build-linux.yml index 05f2ab5..3f27188 100644 --- a/.github/workflows/test-build-linux.yml +++ b/.github/workflows/test-build-linux.yml @@ -33,4 +33,4 @@ jobs: run: npm install - name: Build - run: npm run build:linux + run: npm run build:linux -- --publish=never diff --git a/.github/workflows/test-build-mac.yml b/.github/workflows/test-build-mac.yml index b7a0e8f..7739a23 100644 --- a/.github/workflows/test-build-mac.yml +++ b/.github/workflows/test-build-mac.yml @@ -33,4 +33,4 @@ jobs: run: npm install - name: Build and deploy on Mac - run: npm run build:mac \ No newline at end of file + run: npm run build:mac -- --publish=never \ No newline at end of file diff --git a/.github/workflows/test-build-win.yml b/.github/workflows/test-build-win.yml index b54a1a9..911a722 100644 --- a/.github/workflows/test-build-win.yml +++ b/.github/workflows/test-build-win.yml @@ -33,4 +33,4 @@ jobs: run: npm install - name: Build and deploy on Windows - run: npm run build:win + run: npm run build:win -- --publish=never diff --git a/README.md b/README.md index 9e004fd..1843e6c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,13 @@ A desktop application for the Variational Animal Motion Encoding (VAME) project. VAME Desktop has been designed to run each step of a VAME project **only once**. This is to ensure that the project is reproducible and that the data is not accidentally overwritten. ## Installation + +### Download builded versions: + +You can find the builed versions of VAME Desktop on the [release page](https://github.com/catalystneuro/vame-desktop/releases). + +## Development mode + ### Python You will need to have [miniconda](https://docs.conda.io/en/latest/miniconda.html) installed on your machine OR [pyenv](https://github.com/pyenv/pyenv). diff --git a/main.spec b/main.spec index d3aac15..cfb7eb2 100644 --- a/main.spec +++ b/main.spec @@ -9,7 +9,7 @@ datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] a = Analysis( - ['src/services/main.py'], + ['src/services/vameApi/main.py'], pathex=[], binaries=binaries, datas=datas, diff --git a/package-lock.json b/package-lock.json index a6953c9..31e3fc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vame-desktop", - "version": "0.2.0", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vame-desktop", - "version": "0.2.0", + "version": "0.3.0", "hasInstallScript": true, "license": "GPL-3.0-only", "dependencies": { diff --git a/package.json b/package.json index 94b990d..2d420d6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vame-desktop", "main": "./out/main/index.js", - "version": "0.2.0", + "version": "0.3.0", "description": "An open-source machine learning tool for behavioral segmentation and analyses.", "license": "GPL-3.0-only", "author": "Catalyst Neuro , Nathan Vieira , Garrett Flynn ", diff --git a/requirements.txt b/requirements.txt index 68538fd..ae02b9f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ flask-restx==1.3.0 numpy==1.26.4 pyinstaller==6.8.0 pyinstaller-hooks-contrib==2024.6 -vame-py==0.3.1 +vame-py==0.4.0 diff --git a/src/main/index.ts b/src/main/index.ts index 5e6f798..859c3a5 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -48,7 +48,7 @@ app.whenReady().then(() => { folderHandler() if (is.dev) { - backend = runChildProcess("python", [join(__dirname, "..", "..", "src", "services", "main.py")]) + backend = runChildProcess("python", [join(__dirname, "..", "..", "src", "services", "vameApi", "main.py")]) backend?.stdout.on("data", (data) => { if (data?.toString().includes("Flask server started at")) { @@ -89,10 +89,6 @@ app.on("window-all-closed", () => { app.on("before-quit", (event) => { if (backend && backend.exitCode === null) { event.preventDefault(); // Prevent the default behavior of quitting immediately - backend.once("exit", (code) => { - console.log(`[electron]: Process exited with code ${code}`) - app.exit(code ?? 0); // Quit the app after the child process exits - }); backend.kill("SIGTERM"); // Send SIGTERM to the child process } else if (backend && backend.exitCode !== null) { console.log(`[electron]: Process exited with code ${backend.exitCode}`) diff --git a/src/main/process/runChildProcess.ts b/src/main/process/runChildProcess.ts index 8611731..31bdead 100644 --- a/src/main/process/runChildProcess.ts +++ b/src/main/process/runChildProcess.ts @@ -1,3 +1,4 @@ +import { app } from "electron"; export function runChildProcess(exec: string, path?: string[]) { let stdoutChunks = [], stderrChunks = []; @@ -9,9 +10,10 @@ export function runChildProcess(exec: string, path?: string[]) { } }); - child.on('exit', (code) => + child.on('exit', (code) => { console.log(`[${exec}]: Process exited with code ${code}`) - ); + app.exit(code ?? -1) + }); child.stdout.on('data', (data) => { console.log(`[${exec}]:`, data.toString()); diff --git a/src/renderer/src/@types/index.d.ts b/src/renderer/src/@types/index.d.ts index eee6aff..b3b8151 100644 --- a/src/renderer/src/@types/index.d.ts +++ b/src/renderer/src/@types/index.d.ts @@ -137,11 +137,20 @@ declare global { assets: { images: { evaluation: string[]; - visualization: Record; + visualization: { + hmm: Record, + kmeans: Record + }; }; videos: { - community: Record; - motif: Record; + community: { + hmm: Record, + kmeans: Record + }; + motif: { + hmm: Record, + kmeans: Record + }; }; }; created_at: string; @@ -227,6 +236,7 @@ declare global { export type EnumProperty = DefaultPropertyAttrs & { type: "string"; enum: string[]; + multiple?: boolean; default?: string; }; diff --git a/src/renderer/src/components/DynamicForm/DynamicInput.tsx b/src/renderer/src/components/DynamicForm/DynamicInput.tsx index f964b22..8421c1a 100644 --- a/src/renderer/src/components/DynamicForm/DynamicInput.tsx +++ b/src/renderer/src/components/DynamicForm/DynamicInput.tsx @@ -41,9 +41,11 @@ const DynamicInput: React.FC = ({ // Handle select fields if (type === "enum") { + const enumProperty = property as EnumProperty return (