-
Notifications
You must be signed in to change notification settings - Fork 16
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
docs: New documentation #858
Changes from all commits
1a8b541
c95f4b1
63f1e8c
8c580b6
dd172c1
8921ac5
d70c538
4cec130
f7a425c
846934e
592c20b
adca741
fc662cf
95c80ec
01136c8
f77e952
5cdc0d4
73896b9
168d0c5
c9a7170
572badb
174eb58
45d989b
fd26887
4363c78
9c98b16
b4844c0
c7c0dca
a049938
8e63d49
0e548fd
7fbe8f4
9b89272
c783f88
28d0c8b
a2f1a97
63d91c5
7f3b201
5b6a88f
734c1b2
2ccfb95
f9c6bc4
4c36d3f
0b62f84
25f5c8d
b81f3a2
6e5e02c
0eabf30
7c58b33
19ff167
b871a37
b2a7f60
ada450a
7292807
047f1f5
3044916
2438b79
1920d9c
157401e
f54ffa3
3b547b2
4986e73
0919db7
b42a978
edc7a43
45752c6
78be5e7
11da986
8e4001d
1961dc4
5d8ec80
90fbd3f
43991f2
17e27eb
d51b0ac
07e30cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ htmlcov/ | |
*.io | ||
.vscode/ | ||
.idea/ | ||
.vs/ | ||
bsb-*/ | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,7 +27,9 @@ class Distribution: | |||||
distribution: str = config.attr( | ||||||
type=types.in_(_available_distributions), required=True | ||||||
) | ||||||
"""Name of the scipy.stats distribution function""" | ||||||
parameters: dict[str, typing.Any] = config.catch_all(type=types.any_()) | ||||||
"""parameters to pass to the distribution""" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
def __init__(self, **kwargs): | ||||||
if self.distribution == "constant": | ||||||
|
@@ -42,8 +44,36 @@ def __init__(self, **kwargs): | |||||
) | ||||||
|
||||||
def draw(self, n): | ||||||
"""Draw n random samples from the distribution""" | ||||||
return self._distr.rvs(size=n) | ||||||
|
||||||
def definition_interval(self, epsilon=0): | ||||||
""" | ||||||
Returns the `epsilon` and 1 - `epsilon` values of | ||||||
the distribution Percent point function. | ||||||
:param float epsilon: ratio of the interval to ignore | ||||||
""" | ||||||
if epsilon < 0 or epsilon > 1: | ||||||
raise ValueError("Epsilon must be between 0 and 1") | ||||||
return self._distr.ppf(epsilon), self._distr.ppf(1 - epsilon) | ||||||
|
||||||
def cdf(self, value): | ||||||
""" | ||||||
Returns the result of the cumulative distribution function for `value` | ||||||
:param float value: value to evaluate | ||||||
""" | ||||||
return self._distr.cdf(value) | ||||||
|
||||||
def sf(self, value): | ||||||
""" | ||||||
Returns the result of the Survival function for `value` | ||||||
:param float value: value to evaluate | ||||||
""" | ||||||
return self._distr.sf(value) | ||||||
|
||||||
def __getattr__(self, attr): | ||||||
if "_distr" not in self.__dict__: | ||||||
raise AttributeError("No underlying _distr found for distribution node.") | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -577,6 +577,24 @@ def get_placement_sets(self) -> typing.List["PlacementSet"]: | |
""" | ||
return [cell_type.get_placement_set() for cell_type in self.cell_types.values()] | ||
|
||
def connect_cells(self, pre_set, post_set, src_locs, dest_locs, name): | ||
""" | ||
Connect cells from a presynaptic placement set to cells of a postsynaptic placement set, | ||
and into a connectivity set. | ||
The description of the hemitype (source or target cell population) connection location | ||
is stored as a list of 3 ids: the cell index (in the placement set), morphology branch | ||
index, and the morphology branch section index. | ||
If no morphology is attached to the hemitype, then the morphology indexes can be set to -1. | ||
|
||
:param bsb.storage.interfaces.PlacementSet pre_set: presynaptic placement set | ||
:param bsb.storage.interfaces.PlacementSet post_set: postsynaptic placement set | ||
:param List[List[int, int, int]] src_locs: list of the presynaptic `connection location`. | ||
:param List[List[int, int, int]] dest_locs: list of the postsynaptic `connection location`. | ||
:param str name: Name to give to the `ConnectivitySet` | ||
""" | ||
cs = self.require_connectivity_set(pre_set.cell_type, post_set.cell_type, name) | ||
cs.connect(pre_set, post_set, src_locs, dest_locs) | ||
|
||
def get_connectivity( | ||
self, anywhere=None, presynaptic=None, postsynaptic=None, skip=None, only=None | ||
) -> typing.List["ConnectivitySet"]: | ||
|
@@ -778,7 +796,7 @@ def create_job_pool(self, fail_fast=None, quiet=False): | |
) | ||
try: | ||
# Check whether stdout is a TTY, and that it is larger than 0x0 | ||
# (e.g. MPI sets it to 0x0 unless an xterm is emulated. | ||
# (e.g. MPI sets it to 0x0 unless a xterm is emulated. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is "an xterm," because the choice between "a" and "an" depends on the sound that follows, not the written letter. Since "xterm" is pronounced with an initial vowel sound ("exterm"), "an" is correct. |
||
tty = os.isatty(sys.stdout.fileno()) and sum(os.get_terminal_size()) | ||
except Exception: | ||
tty = False | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,13 @@ def _all_chunks(iter_): | |
|
||
|
||
def _queue_connectivity(self, pool: "JobPool"): | ||
# Get the queued jobs of all the strategies we depend on. | ||
"""Get the queued jobs of all the strategies we depend on. | ||
Parameters | ||
---------- | ||
Comment on lines
+32
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not part of the docstring syntax we use |
||
param pool : pool where the jobs will be queued | ||
type pool: bsb.services.pool.JobPool | ||
""" | ||
deps = set(_gutil.ichain(pool.get_submissions_of(strat) for strat in self.get_deps())) | ||
# Schedule all chunks in 1 job | ||
pre_chunks = _all_chunks(self.presynaptic.cell_types) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ def pick(self, morphology): | |
|
||
@config.node | ||
class NeuroMorphoSelector(NameSelector, classmap_entry="from_neuromorpho"): | ||
_url = "https://neuromorpho.org/" | ||
_url = "http://cng.gmu.edu:8080/neuroMorpho/" # "https://neuromorpho.org/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change this? neuromorpho.org still seems to be working? |
||
_meta = "api/neuron/select?q=neuron_name:" | ||
_files = "dableFiles/" | ||
|
||
|
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 think the CLI is kebab cased