-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CLI to convert and import inferred spikes in CSV format
- Loading branch information
1 parent
fa05d03
commit 5f8d410
Showing
11 changed files
with
524 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""Convert CLI.""" | ||
|
||
import logging | ||
from pathlib import Path | ||
|
||
import click | ||
|
||
from blueetl.converters.convert_spikes import main | ||
from blueetl.utils import setup_logging | ||
|
||
|
||
@click.command() | ||
@click.argument("input-file", type=click.Path(exists=True, path_type=Path)) | ||
@click.argument("output-dir", type=click.Path(exists=False, path_type=Path)) | ||
@click.option( | ||
"--node-population", | ||
help="Name of the node population to create.", | ||
default="synthetic", | ||
show_default=True, | ||
) | ||
@click.option("-v", "--verbose", count=True, help="-v for INFO, -vv for DEBUG") | ||
def convert_spikes(input_file, output_dir, node_population, verbose): | ||
"""Convert spikes in CSV format. | ||
Read a CSV file containing the spikes, and write synthetic files to be used with BlueETL. | ||
The input file should contain: | ||
\b | ||
- headers: node_ids timestamps (or: ids times) | ||
- values: space separated | ||
""" | ||
loglevel = (logging.WARNING, logging.INFO, logging.DEBUG)[min(verbose, 2)] | ||
setup_logging(loglevel=loglevel, force=True) | ||
main( | ||
input_file=input_file, | ||
output_dir=output_dir, | ||
node_population=node_population, | ||
) | ||
click.secho("Conversion successful.", fg="green") |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Conversion utilities.""" |
Oops, something went wrong.