Skip to content

Fix --folder path handling in gen-templates CLI - #190

Open
cyt720 wants to merge 1 commit into
SpikeInterface:mainfrom
cyt720:fix-cli-template-folder-path
Open

cyt720 wants to merge 1 commit into
SpikeInterface:mainfrom
cyt720:fix-cli-template-folder-path

Conversation

@cyt720

@cyt720 cyt720 commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Fix a "TypeError" in "gen-templates" when an explicit "--folder" is provided by converting the folder string to "pathlib.Path".

Problem

When --folder is explicitly provided, templates_folder remains a string. The command later constructs the output path using:

templates_folder / rot / fname

This raises:
TypeError: unsupported operand type(s) for /: 'str' and 'str'
The error occurs after template simulation and aggregation, immediately before saving the generated HDF5 file.

Reproduction

mearec gen-templates
--n 1
--probe Neuronexus-32
--seed 0
--folder /tmp/mearec-templates
--fname smoke_templates.h5

Testing

Verified on Python 3.12.3 and MEArec 1.11.0. The command now completes successfully and saves the generated HDF5 template file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant