-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate pkg_resources -> importlib.resources (#146)
* replace pkg_resources -> importlib.resources * use importlib_resources for backward compat
- Loading branch information
Showing
3 changed files
with
11 additions
and
10 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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
"""A simple ball and stick model.""" | ||
|
||
import pkg_resources | ||
import importlib_resources as resources | ||
from bluecellulab.cell import Cell | ||
|
||
|
||
def create_ball_stick() -> Cell: | ||
"""Creates a ball and stick model by using package's hoc and asc.""" | ||
hoc = pkg_resources.resource_filename("bluecellulab", "cell/ballstick/emodel.hoc") | ||
morphology = pkg_resources.resource_filename("bluecellulab", "cell/ballstick/morphology.asc") | ||
hoc = resources.files("bluecellulab") / "cell/ballstick/emodel.hoc" | ||
morphology = resources.files("bluecellulab") / "cell/ballstick/morphology.asc" | ||
return Cell(template_path=hoc, morphology_path=morphology) |
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 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