-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulator CLI/GUI #368
Simulator CLI/GUI #368
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I haven't pulled it locally to try the new GUI yet, but will soon. We should demo with Dan after the next visit to get some feedback.
@@ -0,0 +1,65 @@ | |||
"""Update parameters files to latest.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What versions of BciPy would this support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this works for all versions.
setup.py
Outdated
@@ -110,6 +110,7 @@ def run(self): | |||
'bcipy = bcipy.main:bcipy_main', | |||
'bcipy-erp-viz = bcipy.helpers.visualization:erp', | |||
'bcipy-sim = bcipy.simulator:main', | |||
'bcipy-sim-gui = bcipy.simulator.ui.gui:main', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a flag on bcipy-sim
? I was considering collapsing some of these scripts in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored to remove the setup script and include a command line flag instead.
return True | ||
|
||
|
||
class ChooseFileInput(QWidget): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have similar code in the GUI
module for getting files and directories. Could we leverage that here? We will be collapsing some of the GUI code (and likely passing around a single QApplication Instance) to package in the future, which is why I ask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These widgets are a bit different in that they represent just the selection input and not the input, label, checkbox, and separator, all of which would affect the layout. These also have hooks for a change action, which is important for this form, but not the parameters GUI.
I do think our existing widgets could be updated to use these components as the underlying input, which would eliminate the duplicate code between the two. That would be a good refinement and when we do that work these could move to a common location.
command = panel.cli_output() | ||
app.quit() | ||
if command: | ||
print(command, file=sys.stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the logger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this starts executing a subprocess immediately in the console it's confusing to the user if this doesn't print to stdout. Also, this gives users the opportunity to run straight from the command line once the configuration is set, which can be faster than the GUI if you're doing this multiple times with only small variation.
@@ -133,7 +133,7 @@ def compute_device_evidence( | |||
# This assumes that sampling is independent. Changes to the sampler API are needed if | |||
# we need to provide the trial context of the last sample. | |||
sampled_data = sampler.sample_data(current_state) | |||
evidence = model.compute_class_probabilities( | |||
evidence = model.compute_likelihood_ratio( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
"Override. Another checkbox is needed for editable" | ||
if value is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update type to show it can be more than bool
I think this can go to the base branch |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
Overview
Created a command line interface and GUI to assist with configuring parameters for a simulation.
Ticket
https://www.pivotaltracker.com/story/show/188497024
Contributions
bcipy-sim -i
.bcipy-sim-gui
Test