Skip to content

Commit

Permalink
3.6.0b7 - Better cubic plotting & new template config. Fixed windows req
Browse files Browse the repository at this point in the history
  • Loading branch information
Helveg committed Dec 11, 2020
1 parent 8e050cf commit 191c3d2
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bsb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "3.6.0b6"
__version__ = "3.6.0b7"

from .reporting import set_verbosity, report, warn
2 changes: 1 addition & 1 deletion bsb/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def start_cli():
"-t",
"--template",
action="store",
default="mouse_cerebellum_cortex_noTouch.json",
default="template.json",
help="Name of the template config file.",
)
parser_config.add_argument(
Expand Down
1 change: 1 addition & 0 deletions bsb/configurations/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
!touch.json
!mouse_cerebellum_cortex_noTouch.json
!mouse_cerebellum_cortex_io_dcn.json
!template.json
45 changes: 45 additions & 0 deletions bsb/configurations/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "Empty template",
"network_architecture": {
"simulation_volume_x": 400.0,
"simulation_volume_z": 400.0
},
"output": {
"format": "bsb.output.HDF5Formatter"
},
"layers": {
"base_layer": {
"thickness": 100
}
},
"cell_types": {
"base_type": {
"placement": {
"class": "bsb.placement.ParticlePlacement",
"layer": "base_layer",
"soma_radius": 2.5,
"density": 3.9e-4
},
"morphology": {
"class": "bsb.morphologies.NoGeometry"
},
"plotting": {
"display_label": "Template cell",
"color": "#E62314",
"opacity": 0.5
}
}
},
"after_placement": {

},
"connection_types": {

},
"after_connectivity": {

},
"simulations": {

}
}
22 changes: 19 additions & 3 deletions bsb/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ def wrapper_function(*args, fig=None, input_region=None, **kwargs):
return wrapper_function


def _plot_network(network, fig, swapaxes):
def _plot_network(network, fig, cubic, swapaxes):
xmin, xmax, ymin, ymax, zmin, zmax = tuple([0] * 6)
for type in network.configuration.cell_types.values():
if type.entity:
continue
Expand All @@ -217,6 +218,21 @@ def _plot_network(network, fig, swapaxes):
name=type.plotting.label,
)
)
xmin = min(xmin, np.min(pos[:, 0], initial=0))
xmax = max(xmax, np.max(pos[:, 0], initial=0))
ymin = min(ymin, np.min(pos[:, 1], initial=0))
ymax = max(ymax, np.max(pos[:, 1], initial=0))
zmin = min(zmin, np.min(pos[:, 2], initial=0))
zmax = max(zmax, np.max(pos[:, 2], initial=0))
if cubic:
rng = max(xmax - xmin, ymax - ymin, zmax - zmin)
fig.layout.scene.xaxis.range = [xmin, xmin + rng]
if swapaxes:
fig.layout.scene.yaxis.range = [ymin, ymin + rng]
fig.layout.scene.zaxis.range = [zmin, zmin + rng]
else:
fig.layout.scene.yaxis.range = [ymin, ymin + rng]
fig.layout.scene.zaxis.range = [zmin, zmin + rng]


@_network_figure
Expand All @@ -227,15 +243,15 @@ def plot_network(
Plot a network, either from the current cache or the storage.
"""
if from_memory:
_plot_network(network, fig, swapaxes)
_plot_network(network, fig, cubic, swapaxes)
else:
network.reset_network_cache()
for type in network.configuration.cell_types.values():
if type.entity:
continue
# Load from HDF5
network.get_cells_by_type(type.name)
_plot_network(network, fig, swapaxes)
_plot_network(network, fig, cubic, swapaxes)
return fig


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Add all packages with binary dependencies that cannot be installed on RTD here.
requires.extend(
[
"rtree-linux==0.9.4",
"rtree-linux>=0.9.4",
]
)

Expand Down

0 comments on commit 191c3d2

Please sign in to comment.