Skip to content
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

[MRG] Update error message for adding drives #681

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

tianqi-cheng
Copy link

@tianqi-cheng tianqi-cheng commented Oct 9, 2023

Closes #668.

Added "Please delete the L5_basket part from the code." to the error message.

@ntolley
Copy link
Contributor

ntolley commented Oct 9, 2023

This is looking good @tianqi-cheng!

Take a look at the PR description, I edited it to say "Closes #668" on the first line. We do this so that we can keep track of which issue this PR is addressing.

Github also pulls a little magic and will automatically close the issue when this PR is merged when you add that line

@ntolley
Copy link
Contributor

ntolley commented Oct 9, 2023

Also we didn't get a chance to talk about unit tests (we will this Wednesday), but if you click on the "details" for the units tests you can get information on what's failing

@@ -40,7 +40,7 @@ def _get_target_properties(weights_ampa, weights_nmda, synaptic_delays,
if location == 'distal' and 'L5_basket' in target_populations:
raise ValueError('When adding a distal drive, synaptic weight cannot '
'be defined for the L5_basket cell type as this '
'connection does not exist.')
'connection does not exist. Please delete the L5_basket part from the code.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This right here produces a "flake8" error. flake8 is basically a program that enforces certain rules for how code should be styled. Here the line is too long so you should break this string into 2 lines.

You can enable flake8 on VSCode so that it highlights areas that break PEP8 style conventions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a more precise and explicit way to write this error message. What about something like this?

f"Due to physiological/anatomical constraints, a distal drive cannot target L5_basket cell types. L5_basket cell types must remain undefined by the user in all synaptic weights dictionaries for this drive ({drive_name})".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a more precise and explicit way to write this error message. What about something like this?

f"Due to physiological/anatomical constraints, a distal drive cannot target L5_basket cell types. L5_basket cell types must remain undefined by the user in all synaptic weights dictionaries for this drive ({drive_name})".

Thank you for the suggestion. I will fix it!

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (7bebb00) 91.38% compared to head (f1d24f2) 91.38%.

❗ Current head f1d24f2 differs from pull request most recent head 3dcaa33. Consider uploading reports for the commit 3dcaa33 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #681   +/-   ##
=======================================
  Coverage   91.38%   91.38%           
=======================================
  Files          25       25           
  Lines        4599     4599           
=======================================
  Hits         4203     4203           
  Misses        396      396           
Files Coverage Δ
hnn_core/drives.py 98.52% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ntolley ntolley changed the title WIP: Update error message for adding drives [MRG] Update error message for adding drives Oct 11, 2023
@ntolley ntolley merged commit 7953101 into jonescompneurolab:master Oct 11, 2023
7 checks passed
@ntolley
Copy link
Contributor

ntolley commented Oct 11, 2023

Congrats on the first PR @tianqi-cheng!!

Quick note for future PR's, we typically change the title from WIP to [MRG] when we've made all the changes. It's also a way to signal to us that the PR is ready to be reviewed

@jasmainak
Copy link
Collaborator

@tianqi-cheng you don't have your git set up properly. The commits don't link back to your profile. You should set up the email address correctly. @ntolley can guide you!

@tianqi-cheng
Copy link
Author

@tianqi-cheng you don't have your git set up properly. The commits don't link back to your profile. You should set up the email address correctly. @ntolley can guide you!

Thank you for the suggestion! I will ask Nick about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error messages for adding drives
5 participants