From d5537da41648268bf96a552117489bcd58bedd09 Mon Sep 17 00:00:00 2001 From: etiennedemontalivet Date: Tue, 26 Mar 2024 09:11:13 +0100 Subject: [PATCH] doc: fix code blocks --- README.rst | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/README.rst b/README.rst index ec44c23..8b94126 100644 --- a/README.rst +++ b/README.rst @@ -25,15 +25,15 @@ Main features: Install ------- -.. code:: bash +.. code-block:: bash - $ pip install micromed-io + \$ pip install micromed-io Convert a Micromed (*.trc*) file to MNE (*.fif*) format ------------------------------------------------------- -.. code:: python +.. code-block:: python from micromed_io.to_mne import create_mne_from_micromed_recording mne_raw = create_mne_from_micromed_recording("path/to/file.TRC") @@ -53,18 +53,18 @@ See details in next sections Emulate Online Micromed TCP from *.trc* file -------------------------------------------- -.. code:: bash +.. code-block:: bash - $ mmio_emulate_trc --file=../data/sample.TRC --address=localhost --port=5123 + \$ mmio_emulate_trc --file=../data/sample.TRC --address=localhost --port=5123 Emulate the online data stream of Micromed to test your real-time platform. See all the arguments and adapt them: -.. code:: bash +.. code-block:: bash - $ mmio_emulate_trc --help # to see all arguments + \$ mmio_emulate_trc --help # to see all arguments .. note:: @@ -75,9 +75,9 @@ platform. See all the arguments and adapt them: Read TCP and push to LSL Stream ------------------------------- -.. code:: bash +.. code-block:: bash - $ mmio_tcp_to_lsl --address=localhost --port=5123 + \$ mmio_tcp_to_lsl --address=localhost --port=5123 While receiving online data throug tcp, this command forward the data to 3 LSL stream outlets: @@ -91,22 +91,22 @@ While receiving online data throug tcp, this command forward the data to You can easily change the LSL parameters: -.. code:: bash +.. code-block:: bash - $ mmio_tcp_to_lsl --help # to see all arguments + \$ mmio_tcp_to_lsl --help # to see all arguments Read TRC file ------------- -.. code:: python +.. code-block:: python from micromed_io.trc import MicromedTRC mmtrc = MicromedTRC("sample.TRC") Then you have access to the *trc* data: -.. code:: python +.. code-block:: python mmtrc.get_header() mmtrc.get_markers() @@ -125,9 +125,9 @@ Download ``tcp_to_lsl.py`` from the `github repo `__ in *scripts/* -.. code:: bash +.. code-block:: bash - $ python tcp_to_lsl.py --address=localhost --port=5123 + \$ python tcp_to_lsl.py --address=localhost --port=5123 .. @@ -145,7 +145,7 @@ shows you how to use it (see the ``PROCESS HERE`` comment). It uses a **buffer** that mimics the **sliding window** and triggers each time it is filled. -.. code:: python +.. code-block:: python from micromed_io.buffer import MicromedBuffer micromed_buffer = MicromedBuffer(epoch_duration=5, epoch_overlap=2.5) @@ -153,9 +153,9 @@ is filled. To run the example, you can download and run the ``tcp_to_epoch.py`` script in ``extern/`` folder: -.. code:: bash +.. code-block:: bash - $ python tcp_to_epoch.py --epoch-size=5 --overlap=2.5 + \$ python tcp_to_epoch.py --epoch-size=5 --overlap=2.5 .. note:: @@ -164,16 +164,16 @@ folder: Rename TRC files with recording datetime ---------------------------------------- -.. code:: bash +.. code-block:: bash - $ mmio_rename_trc --dirpath=./ --format=%Y%m%d-%H%M%S + \$ mmio_rename_trc --dirpath=./ --format=%Y%m%d-%H%M%S Rename the TRC files of the given folder to include the recording date in the filename. Output is : ``__.TRC``. The format must be compliant with python `strftime format codes `__ -.. code:: bash +.. code-block:: bash mmio_rename_trc --help # to see help @@ -182,11 +182,11 @@ Local install Download the repo and: -.. code:: bash +.. code-block:: bash - $ conda env create -f environment.yml - $ conda activate mmio - $ poetry install + \$ conda env create -f environment.yml + \$ conda activate mmio + \$ poetry install Please feel free to reach me if you want to contribute.