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

fix units of compute_current #461

Merged
merged 7 commits into from
Oct 24, 2024
Merged

fix units of compute_current #461

merged 7 commits into from
Oct 24, 2024

Conversation

michaeldeistler
Copy link
Contributor

@michaeldeistler michaeldeistler commented Oct 23, 2024

Closes #274

This is a tricky PR as it will impact users which ported channels themselves. I hope that this is not many people yet, so now is the time to still do it.

Copy link
Contributor

@huangziwei huangziwei left a comment

Choose a reason for hiding this comment

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

see below.

Copy link
Contributor

@huangziwei huangziwei left a comment

Choose a reason for hiding this comment

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

Looks good!

voltage_terms = voltage_terms.at[indices].add(voltage_term * 1000.0)
constant_terms = constant_terms.at[indices].add(-constant_term * 1000.0)
else:
# If `current_is_in_mA_per_cm2=False` then the current is assumed as
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd remove the backward compatibility here, simply because giving people options will make them lazy to adopt the new convention. it's also confusing if both conventions floating around, and it'll be difficult to debug once things go wrong.

@michaeldeistler michaeldeistler merged commit 5ce7c45 into main Oct 24, 2024
1 check passed
@michaeldeistler michaeldeistler deleted the units branch October 24, 2024 13:13
michaeldeistler added a commit that referenced this pull request Nov 13, 2024
* fix units of compute_current

* Enforce new unit convention

* Add raise and warn for old channel models

* add option to use `current_is_in_mA_per_cm2=False`

* Add test

* Remove warning

* fixups
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.

Units of compute_current() in channels do not match NEURON
2 participants