Skip to content

Commit

Permalink
Codestyle fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Jan 3, 2025
1 parent a14f57e commit e7a01fc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
3 changes: 2 additions & 1 deletion glue_ar/common/scatter_export_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class ARVispyScatterExportOptions(State):
min_value=0,
max_value=7,
docstring="Controls how many points are put into each mesh. "
"Higher means a larger filesize, but better performance.")
"Higher means a larger filesize, but better performance."
)


class ARIpyvolumeScatterExportOptions(State):
Expand Down
7 changes: 3 additions & 4 deletions glue_ar/common/scatter_gltf.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ def add_scatter_layer_gltf(builder: GLTFBuilder,
triangles: List[Tuple[int, int, int]],
bounds: Bounds,
clip_to_bounds: bool = True,
points_per_mesh: Optional[int] = None,
):
points_per_mesh: Optional[int] = None):
if layer_state is None:
return

Expand Down Expand Up @@ -537,7 +536,7 @@ def add_vispy_scatter_layer_gltf(builder: GLTFBuilder,
if log_ppm == 7:
ppm = None
else:
ppm = 10 ** log_ppm
ppm = 10 ** log_ppm

Check warning on line 539 in glue_ar/common/scatter_gltf.py

View check run for this annotation

Codecov / codecov/patch

glue_ar/common/scatter_gltf.py#L539

Added line #L539 was not covered by tests

add_scatter_layer_gltf(builder=builder,
viewer_state=viewer_state,
Expand Down Expand Up @@ -565,7 +564,7 @@ def add_ipyvolume_scatter_layer_gltf(builder: GLTFBuilder,
if log_ppm == 7:
ppm = None

Check warning on line 565 in glue_ar/common/scatter_gltf.py

View check run for this annotation

Codecov / codecov/patch

glue_ar/common/scatter_gltf.py#L564-L565

Added lines #L564 - L565 were not covered by tests
else:
ppm = 10 ** log_ppm
ppm = 10 ** log_ppm

Check warning on line 567 in glue_ar/common/scatter_gltf.py

View check run for this annotation

Codecov / codecov/patch

glue_ar/common/scatter_gltf.py#L567

Added line #L567 was not covered by tests

add_scatter_layer_gltf(builder=builder,
viewer_state=viewer_state,
Expand Down
2 changes: 1 addition & 1 deletion glue_ar/common/voxels.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from glue_ar.common.volume_export_options import ARVoxelExportOptions
from glue_ar.usd_utils import material_for_color, sanitize_path
from glue_ar.utils import BoundsWithResolution, alpha_composite, binned_opacity, clamp, \
clip_sides, frb_for_layer, get_resolution, hex_to_components, isomin_for_layer, \
clip_sides, frb_for_layer, hex_to_components, isomin_for_layer, \
isomax_for_layer, layer_color, offset_triangles, unique_id, xyz_bounds

from glue_ar.gltf_utils import SHORT_MAX, add_points_to_bytearray, add_triangles_to_bytearray, \
Expand Down
6 changes: 2 additions & 4 deletions glue_ar/jupyter/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def info_icon(cb_property: CallbackProperty) -> v.Tooltip:
def boolean_callback_widgets(instance: HasCallbackProperties,
property: str,
display_name: str,
**kwargs,
) -> Tuple[DOMWidget]:
**kwargs) -> Tuple[DOMWidget]:

instance_type = type(instance)
cb_property = getattr(instance_type, property)
Expand All @@ -60,8 +59,7 @@ def number_callback_widgets(instance: HasCallbackProperties,
property: str,
display_name: str,
label_for_value=False,
**kwargs,
) -> Tuple[DOMWidget]:
**kwargs) -> Tuple[DOMWidget]:

value = getattr(instance, property)
instance_type = type(instance)
Expand Down
3 changes: 2 additions & 1 deletion glue_ar/qt/export_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def _update_layer_ui(self, state: State):
continue
row = QVBoxLayout()
name = self.display_name(property)
widget_tuples, connection = widgets_for_callback_property(state, property, name, label_for_value=not is_log_pm)
widget_tuples, connection = widgets_for_callback_property(state, property, name,
label_for_value=not is_log_pm)
self._layer_connections.append(connection)
for widgets in widget_tuples:
subrow = QHBoxLayout()
Expand Down
12 changes: 5 additions & 7 deletions glue_ar/qt/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ def info_button(cb_property: CallbackProperty) -> QPushButton:
def boolean_callback_widgets(instance: HasCallbackProperties,
property: str,
display_name: str,
**kwargs,
) -> Tuple[Tuple[Tuple[QWidget]], connect_checkable_button]:
**kwargs) -> Tuple[Tuple[Tuple[QWidget]], connect_checkable_button]:

value = getattr(instance, property)
instance_type = type(instance)
Expand All @@ -71,8 +70,7 @@ def number_callback_widgets(instance: HasCallbackProperties,
property: str,
display_name: str,
label_for_value=True,
**kwargs,
) -> Tuple[Tuple[Tuple[QWidget]], connect_value]:
**kwargs) -> Tuple[Tuple[Tuple[QWidget]], connect_value]:

value = getattr(instance, property)
instance_type = type(instance)
Expand All @@ -99,6 +97,7 @@ def number_callback_widgets(instance: HasCallbackProperties,

if label_for_value:
value_label = QLabel()

def update_label(value):
value_label.setText(f"{value:.{places}f}")

Expand All @@ -114,7 +113,7 @@ def on_widget_destroyed(widget, cb=remove_label_callback):
update_label(value)
add_callback(instance, property, update_label)
slider.destroyed.connect(on_widget_destroyed)

value_widgets = (slider, value_label)
else:
value_widgets = (slider,)
Expand All @@ -135,8 +134,7 @@ def on_widget_destroyed(widget, cb=remove_label_callback):
def widgets_for_callback_property(instance: HasCallbackProperties,
property: str,
display_name: str,
**kwargs,
) -> Tuple[Tuple[Tuple[QWidget]], BaseConnection]:
**kwargs) -> Tuple[Tuple[Tuple[QWidget]], BaseConnection]:

t = type(getattr(instance, property))
if t is bool:
Expand Down

0 comments on commit e7a01fc

Please sign in to comment.