agencyenterprise / neural-data-simulator

Electrophysiology data simulator for developing brain-computer interfaces
https://agencyenterprise.github.io/neural-data-simulator/
Apache License 2.0
71 stars 7 forks source link

Handles argument passing to `run_closed_loop` script #19

Closed eudesf closed 1 year ago

eudesf commented 1 year ago

Introduction

Fixes argument passing to run_closed_loop script, so parameters like --settings-path can get passed through.

Changes

This change sends all the arguments received on run_closed_loop script to the started modules subprocesses so they can be read and handled accordingly.

Behavior

The --settings-path parameter is being ignored on run_closed_loop script. With this change, that parameter and any other parameter passed will be captured and handled.

eudesf commented 1 year ago

With the code changes from this PR the arguments are passed to the processes, but with no modifications to the config files we have a crash, as the default settings.yaml doesn't contain the content required by the decoder and the center out reach task.

We also miss user documentation mentioning that a user can pass arguments to this script and we also miss some CLI documentation, like the following:

encoder --help
usage: encoder [-h] [--settings-path SETTINGS_PATH]

Run encoder.

optional arguments:
  -h, --help            show this help message and exit
  --settings-path SETTINGS_PATH
                        Path to the settings.yaml file.

Before proceeding with this changes I would like to discuss if this solution (sending the same arguments to all processes) is better than allowing the user to send specific arguments to each process

@NewtonSander please check again! I've included specific parameters for each process started. :)

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.20 :tada:

Comparison is base (2a2c6ce) 86.78% compared to head (25a59db) 86.99%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #19 +/- ## ========================================== + Coverage 86.78% 86.99% +0.20% ========================================== Files 21 21 Lines 1680 1707 +27 ========================================== + Hits 1458 1485 +27 Misses 222 222 ``` | [Impacted Files](https://app.codecov.io/gh/agencyenterprise/neural-data-simulator/pull/19?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=agencyenterprise) | Coverage Δ | | |---|---|---| | [src/neural\_data\_simulator/scripts/run\_encoder.py](https://app.codecov.io/gh/agencyenterprise/neural-data-simulator/pull/19?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=agencyenterprise#diff-c3JjL25ldXJhbF9kYXRhX3NpbXVsYXRvci9zY3JpcHRzL3J1bl9lbmNvZGVyLnB5) | `86.99% <100.00%> (+0.32%)` | :arrow_up: | | [...ural\_data\_simulator/scripts/run\_ephys\_generator.py](https://app.codecov.io/gh/agencyenterprise/neural-data-simulator/pull/19?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=agencyenterprise#diff-c3JjL25ldXJhbF9kYXRhX3NpbXVsYXRvci9zY3JpcHRzL3J1bl9lcGh5c19nZW5lcmF0b3IucHk=) | `87.09% <100.00%> (+0.43%)` | :arrow_up: | | [src/neural\_data\_simulator/scripts/run\_streamer.py](https://app.codecov.io/gh/agencyenterprise/neural-data-simulator/pull/19?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=agencyenterprise#diff-c3JjL25ldXJhbF9kYXRhX3NpbXVsYXRvci9zY3JpcHRzL3J1bl9zdHJlYW1lci5weQ==) | `95.45% <100.00%> (+0.07%)` | :arrow_up: | | [src/neural\_data\_simulator/util/runtime.py](https://app.codecov.io/gh/agencyenterprise/neural-data-simulator/pull/19?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=agencyenterprise#diff-c3JjL25ldXJhbF9kYXRhX3NpbXVsYXRvci91dGlsL3J1bnRpbWUucHk=) | `96.61% <100.00%> (+1.48%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.