-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55e915d
commit 6739599
Showing
3 changed files
with
10 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
from abc import ABC, abstractmethod | ||
from typing import Dict, Optional, Tuple | ||
from warnings import warn | ||
|
||
import jax.numpy as jnp | ||
|
||
|
||
|
@@ -25,29 +26,19 @@ def __init__(self, name: Optional[str] = None): | |
"[email protected] or create an issue on Github: " | ||
"https://github.com/jaxleyverse/jaxley/issues. Thank you!" | ||
) | ||
if not hasattr(self, "current_is_in_mA_per_cm2"): | ||
if ( | ||
not hasattr(self, "current_is_in_mA_per_cm2") | ||
and self.current_is_in_mA_per_cm2 | ||
): | ||
raise ValueError( | ||
"The channel you are using is deprecated. " | ||
"In Jaxley version 0.5.0, we changed the unit of the current returned " | ||
"by `compute_current` of channels from `uA/cm^2` to `mA/cm^2`. Please " | ||
"update your channel model (by dividing the resulting current by 1000) " | ||
"and set `self.current_is_in_mA_per_cm2=True` as the first line " | ||
"in the `__init__()` method of your channel. Alternatively, you can " | ||
"make Jaxley use `uA/cm^2 by setting " | ||
"`self.current_is_in_mA_per_cm2=False` as the " | ||
f"first line in the `__init__()` method of your channel. {contact}" | ||
) | ||
if not self.current_is_in_mA_per_cm2: | ||
warn( | ||
"You are using `current_is_in_mA_per_cm2=False`. This means that the " | ||
"current through the channel will be considered in `uA/cm^2`. In " | ||
"future versions of Jaxley, we will remove this option and force the " | ||
"channel to return the current in `mA/cm^2`. We recommend to adapt " | ||
"your `compute_current()` method now and return the current in " | ||
"`mA/cm^2` (by dividing the current by 1000). After this has been " | ||
"done, set `current_is_in_mA_per_cm2=True` to get rid of this " | ||
f"warning. {contact}" | ||
"in the `__init__()` method of your channel. {contact}" | ||
) | ||
|
||
self._name = name if name else self.__class__.__name__ | ||
|
||
@property | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.