From 4d0c674ee3c7dc5a36570385223fe9b17c6d650a Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 17 Jul 2024 13:32:39 +0200 Subject: [PATCH] Update code snippet --- src/components/CodeSnippet.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/CodeSnippet.js b/src/components/CodeSnippet.js index 7035c47..c6f4a93 100644 --- a/src/components/CodeSnippet.js +++ b/src/components/CodeSnippet.js @@ -6,9 +6,11 @@ import { vs } from 'react-syntax-highlighter/dist/esm/styles/prism'; function CodeSnippet({ selectedTemplates }) { const generatePythonCode = (selectedTemplates) => { const selectedUnitIndicesString = JSON.stringify([...selectedTemplates], null, 2); - return `from spikeinterface.generation import get_templates_from_database, generate_hybrid_recording + return `from spikeinterface.generation import fetch_templates_database_info, query_templates_from_database, generate_hybrid_recording selected_unit_indices = ${selectedUnitIndicesString} -templates = get_templates_from_database(selected_unit_indices) + +templates_info = fetch_templates_database_info() +templates = query_templates_from_database(templates_info.loc[selected_unit_indices]) # recording is an existing spikeinterface.BaseRecording recording_hybrid = get_templates_from_database(recording, templates=templates)`;