Skip to content

Commit 751bd86

Browse files
author
Cyrille Favreau
authored
Merge pull request #319 from favreau/master
Version 1.7.0
2 parents bd2c6a0 + 601a117 commit 751bd86

File tree

9,457 files changed

+204723
-183822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

9,457 files changed

+204723
-183822
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set(NAME BIOEXPLORER)
2222

2323
set(PACKAGE_VERSION_ABI 1)
2424
set(PACKAGE_VERSION_MAJOR 1)
25-
set(PACKAGE_VERSION_MINOR 6)
25+
set(PACKAGE_VERSION_MINOR 7)
2626
set(PACKAGE_VERSION_PATCH 0)
2727

2828
# Get the Git revision using the git command

bioexplorer/pythonsdk/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ VENV_BIN:=$(VENV)/bin
3131
unexport DISPLAY
3232

3333
# Test coverage pass threshold (percent)
34-
MIN_COV?=50
34+
MIN_COV?=45
3535
VENV_INSTALLED=.installed
3636
PIP_INSTALL_OPTIONS=--ignore-installed
3737

bioexplorer/pythonsdk/bioexplorer/bio_explorer.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -235,27 +235,18 @@ def copy(self):
235235

236236

237237
class Transformation:
238-
"""
239-
Transformation describes an object transformation defined by a translation, a rotation, a
240-
rotation center and a scale
241-
"""
238+
"""Transformation defined by a translation, a rotation, a rotation center and a scale"""
242239

243240
def __init__(
244-
self,
245-
translation=Vector3(),
246-
rotation=Quaternion(),
247-
rotation_center=Vector3(),
248-
scale=Vector3(),
249-
):
241+
self, translation=Vector3(), rotation=Quaternion(), rotation_center=Vector3(),
242+
scale=Vector3()):
250243
"""
251-
Class describing an object transformation defined by a translation, a rotation, a
252-
rotation center and a scale
244+
Transformation defined by a translation, a rotation, a rotation center and a scale
253245
254-
Args:
255-
translation (Vector3, optional): Translation. Defaults to Vector3().
256-
rotation (Quaternion, optional): Rotation. Defaults to Quaternion().
257-
rotation_center (Vector3, optional): Rotation center. Defaults to Vector3().
258-
scale (Vector3, optional): Scale. Defaults to Vector3().
246+
:param Vector3 translation: Translation. Defaults to Vector3()
247+
:param Quaternion rotation: Rotation. Defaults to Quaternion()
248+
:param Vector3 rotation_center: Rotation center. Defaults to Vector3()
249+
:param Vector3 scale: Scale. Defaults to Vector3()
259250
"""
260251
assert isinstance(translation, Vector3)
261252
assert isinstance(rotation, Quaternion)
@@ -2787,7 +2778,8 @@ def go_magnetic(
27872778
return tf
27882779
return None
27892780

2790-
def build_fields(self, voxel_size, density=1.0, data_type=FIELD_DATA_TYPE_POINT, model_ids=list()):
2781+
def build_fields(
2782+
self, voxel_size, density=1.0, data_type=FIELD_DATA_TYPE_POINT, model_ids=list()):
27912783
"""
27922784
Build fields acceleration structures and creates according data handler
27932785
@@ -3063,7 +3055,8 @@ def start_model_loading_transaction(self):
30633055
"""
30643056
Starts the loading of models
30653057
3066-
All models loaded from this point will only appear in the scene once the commit_model_loading_transaction function is invoked
3058+
All models loaded from this point will only appear in the scene once the
3059+
commit_model_loading_transaction function is invoked
30673060
30683061
:return: Result of the request submission
30693062
"""

bioexplorer/pythonsdk/bioexplorer/metabolism.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ def set_renderer(
110110
"""
111111
Set the metabolism renderer
112112
113-
The renderer travels through the scene using
114-
the ray-marching technique. For every voxel, the region is identified and
115-
the metabolite concentration is used to define the opacity of the voxel.
113+
The renderer travels through the scene using the ray-marching technique. For every voxel,
114+
the region is identified and the metabolite concentration is used to define the opacity of
115+
the voxel.
116116
117117
:max_accum_frames: Maximum number of accumulated framed
118118
:subsampling: Sub-sampling
@@ -183,12 +183,7 @@ def callback(self, location, metabolite_id):
183183
self._core.set_renderer()
184184

185185
def display(self):
186-
"""
187-
Displays a widget in the notebook.
188-
189-
The widget allows selection of metabolites and regions that should be rendered
190-
"""
191-
186+
"""Displays the widget allowing selection of metabolites and regions"""
192187
class Updated:
193188
"""Class used to interactively update the Metabolism widget"""
194189

@@ -377,7 +372,7 @@ def _hex_to_rgb(value):
377372
value = value.lstrip("#")
378373
lv = len(value)
379374
return tuple(
380-
int(value[i : i + lv // 3], 16) for i in range(0, lv, lv // 3)
375+
int(value[i: i + lv // 3], 16) for i in range(0, lv, lv // 3)
381376
)
382377

383378
def _get_data(self, guid):

bioexplorer/pythonsdk/bioexplorer/notebook_widgets.py

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ def update_target(_):
425425

426426
def display_palette_for_models(self):
427427
"""Display visual controls for color palettes applied to models"""
428-
429428
def set_colormap(model_id, colormap_name, shading_mode):
430429
material_ids = self._be.get_material_ids(model_id)["ids"]
431430
nb_materials = len(material_ids)
@@ -702,7 +701,6 @@ def focus_on_instance(event):
702701

703702
def __display_advanced_settings(self, object_type, threaded):
704703
"""Display visual controls for camera or renderer advanced settings"""
705-
706704
class Updated:
707705
"""Inner class that insures communication with the remote server"""
708706

@@ -839,7 +837,7 @@ def _create_widgets(self):
839837
for i in range(0, nb_widgets, nb_columns):
840838
box_widgets = list()
841839

842-
for widget in list(widgets_list)[i : min(i + nb_columns, nb_widgets)]:
840+
for widget in list(widgets_list)[i: min(i + nb_columns, nb_widgets)]:
843841
box_widgets.append(widgets_list[widget])
844842

845843
vboxes.append(HBox(box_widgets))
@@ -857,7 +855,6 @@ def display_advanced_camera_settings(self, is_threaded=True):
857855

858856
def display_rendering_settings(self):
859857
"""Display visual controls for renderer settings"""
860-
861858
def update_params(_):
862859
"""Update renderer params"""
863860
self._client.set_renderer(
@@ -965,7 +962,7 @@ def update_slider(value):
965962
palette_size,
966963
)
967964
lbl.value = sequence_as_list[2][
968-
value["new"][0] - value_range[0] : value["new"][1] - value_range[0]
965+
value["new"][0] - value_range[0]: value["new"][1] - value_range[0]
969966
]
970967

971968
irs.observe(update_slider, "value")
@@ -974,32 +971,29 @@ def update_slider(value):
974971

975972
def display_clipping_planes(self, value_range=[0, 128]):
976973
"""
977-
The code is implementing a visualization feature that allows the user to add and
978-
manipulate clip planes in a 3D space.
974+
Add and manipulate clip planes in a 3D space
979975
980-
The code starts by getting the currently existing clip planes using
981-
the _client.get_clip_planes() method. If there are any existing clip planes, it stores
982-
the ID of the last plane in the variable plane_id and removes all existing clip planes
983-
using the _client.remove_clip_planes() method.
976+
The code starts by getting the currently existing clip planes using
977+
the _client.get_clip_planes() method. If there are any existing clip planes, it stores
978+
the ID of the last plane in the variable plane_id and removes all existing clip planes
979+
using the _client.remove_clip_planes() method.
984980
985-
Next, the code adds 6 new clip planes at the origin using the _client.add_clip_plane()
986-
method. The clip planes are added in pairs along the x, y, and z axes.
981+
Next, the code adds 6 new clip planes at the origin using the _client.add_clip_plane()
982+
method. The clip planes are added in pairs along the x, y, and z axes.
987983
988-
After that, the code defines three update functions update_x, update_y, and update_z
989-
that will be called when the user interacts with the sliders.
984+
After that, the code defines three update functions update_x, update_y, and update_z
985+
that will be called when the user interacts with the sliders.
990986
991-
Each update function calls the _client.update_clip_plane() method to update the position
992-
of the corresponding clip plane based on the value of the slider. The plane_id variable
993-
is used to identify the correct clip plane to update.
987+
Each update function calls the _client.update_clip_plane() method to update the position
988+
of the corresponding clip plane based on the value of the slider. The plane_id variable
989+
is used to identify the correct clip plane to update.
994990
995-
Finally, three sliders w_y, w_y, and w_z are created using IntRangeSlider with provided
996-
minimum and maximum values. Each slider is then associated with its corresponding update
997-
function using the observe() method. The sliders are displayed using the display()
998-
function.
991+
Finally, three sliders w_y, w_y, and w_z are created using IntRangeSlider with provided
992+
minimum and maximum values. Each slider is then associated with its corresponding update
993+
function using the observe() method. The sliders are displayed using the display()
994+
function.
999995
1000-
Args:
1001-
value_range (list, optional): Range of values for the clipping planes. Defaults to
1002-
[0, 128].
996+
:param floats value_range: Range of values for the clipping planes. Defaults to [0, 128]
1003997
"""
1004998
planes = self._client.get_clip_planes()
1005999
plane_id = -1
@@ -1066,16 +1060,19 @@ def update_z(value):
10661060

10671061
def display_model_transformation(self, model_id):
10681062
"""
1069-
The code is a versatile user interface element designed to enable users to manipulate and transform models within a 3D scene. It provides intuitive controls for translating, rotating, and scaling objects with precision and ease.
1063+
Manipulate and transform models within a 3D scene
10701064
1071-
Translation Controls: The widget includes handles or controls that allow users to move the object along the X, Y, and Z axes. Users can click and drag these handles to relocate the object within the workspace.
1065+
Translation Controls: The widget includes handles or controls that allow users to move the
1066+
object along the X, Y, and Z axes. Users can click and drag these handles to relocate the
1067+
object within the workspace.
10721068
1073-
Rotation Controls: It offers handles for rotating the object around different axes. Users can rotate the model by dragging these handles, ensuring precise orientation adjustments.
1069+
Rotation Controls: It offers handles for rotating the object around different axes. Users
1070+
can rotate the model by dragging these handles, ensuring precise orientation adjustments.
10741071
1075-
Scaling Controls: The widget provides controls for resizing the model uniformly or independently along each axis.
1072+
Scaling Controls: The widget provides controls for resizing the model uniformly or
1073+
independently along each axis.
10761074
1077-
Args:
1078-
model_id (integer): Id of the model on which the transformation will be applied
1075+
:param integer model_id: Id of the model on which the transformation will be applied
10791076
"""
10801077
tf = self._be.get_model_transformation(model_id)
10811078

0 commit comments

Comments
 (0)