-
Notifications
You must be signed in to change notification settings - Fork 50
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
[ENH] Added tonic input to GUI drivers tab #773
[ENH] Added tonic input to GUI drivers tab #773
Conversation
@ntolley @jasmainak @rythorpe Thoughts on if times should be above or below the amplitudes? |
I vote above, but it's a mild preference. |
Correct, synchronous inputs don't make sense to tonic inputs. |
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.
Looking good Camilo! Per the discussion:
- Remove Sync Inputs checkbox from tonics
- Move times above amplitudes
- Add test to check tonic widget is created with prespecified_drive_data
- Add test to check an added tonic amplitude is added to the network when _init_network_from_widgets is called
hnn_core/gui/gui.py
Outdated
amplitude=weights_amplitudes, | ||
t0=drive["t0"].value, | ||
tstop=drive["tstop"].value) | ||
return |
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.
Should this be returning?
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.
The rest of the logic in that function doesnt apply to Tonic inputs. I want to avoid the elif
branching
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 talked it over and I'll remove the return
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #773 +/- ##
==========================================
- Coverage 92.33% 92.28% -0.05%
==========================================
Files 27 27
Lines 5059 5096 +37
==========================================
+ Hits 4671 4703 +32
- Misses 388 393 +5 ☔ View full report in Codecov by Sentry. |
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 played around with this and replicated the Simulate Gamma API Tutorial tonic example. Below is the plot comparing the simulations with and without the added tonic.
I think everything is working as expected! Great job Camilo!
Some quality of life considerations.
- When adding a tonic drive, the default Stop Time is set to 0. Should this sync with the simulation tstop parameter on creation?
- The simulation tab stop time label is "tstop (ms)" while in the tonic it's "Stop Time". Should we be consistent here? And which do you prefer?
- I think the cell types should be ordered alphabetically: [L2_basket, L2_pyramidal, L5_basket, L5_pyramidal]
@ntolley @jasmainak @rythorpe Thoughts?
@@ -457,6 +458,10 @@ def _simulation_list_change(value): | |||
is_disabled="", btn_height=self.layout['run_btn'].height, | |||
color_theme=self.layout['theme_color'])) | |||
|
|||
def _driver_type_change(value): | |||
self.widget_location_selection.disabled = ( |
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.
Very useful! Glad to see this is implemented natively
hnn_core/gui/gui.py
Outdated
'amplitude': 0, | ||
't0': 0, | ||
'tstop': 0, | ||
'seedcore': 14, |
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.
'seedcore': 14, |
is seedcore
actually used anywhere? net.add_tonic_drives
doesn't have any randomization so probably safe to delete
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.
Removed
hnn_core/gui/gui.py
Outdated
|
||
start_times = BoundedFloatText( | ||
value=deepcopy(default_data['t0']), description="Start time", | ||
min=0, max=1e6, step=0.01, **kwargs) |
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.
min=0, max=1e6, step=0.01, **kwargs) | |
min=0, max=1e6, step=1.0, **kwargs) |
This is a pretty small step size considering what's being changed
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.
Done
hnn_core/gui/gui.py
Outdated
min=0, max=1e6, step=0.01, **kwargs) | ||
stop_times = BoundedFloatText( | ||
value=deepcopy(default_data['tstop']), description="Stop time", | ||
min=-1, max=1e6, step=0.01, **kwargs) |
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.
min=-1, max=1e6, step=0.01, **kwargs) | |
min=-1, max=1e6, step=1.0, **kwargs) |
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.
Done
@@ -1026,6 +1082,10 @@ def add_drive_widget(drive_type, drive_boxes, drive_widgets, drives_out, | |||
sync_evinput=False): | |||
"""Add a widget for a new drive.""" | |||
|
|||
# Check only adds 1 tonic input widget | |||
if drive_type == "Tonic" and not _is_valid_add_tonic_input(drive_widgets): | |||
return |
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.
Does this just mean the add drive button doesn't do anything once you add a tonic drive?
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.
That is correct.
@gtdang
This was discussed at our dev sync. |
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.
Great work @kmilo9999 !!
I'm a bit confused about the codespell, I wonder if the github action somehow got updated and is now checking new files...
Do you think you could modify the typos in any case? It's just the 3 lines and they'll need to be fixed at some point
4e82443
to
bb0fc1a
Compare
Created a separate PR for those typos #777 |
@gtdang is this request satisfied?
Did you mean for there to be a test with |
bb0fc1a
to
301948d
Compare
This |
@ntolley is there an example of the flat a json or param file with tonics encoded? |
@ntolley why the |
These cells are modeled as just one single |
Merging since every test is passing besides Ubuntu (which is in progress) Thanks @kmilo9999!!! |
Wok on new Feature to add tonic input from in the GUI
Solves #715