mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Fix Ruff UP034 (extraneous-parentheses)
https://docs.astral.sh/ruff/rules/extraneous-parentheses/
This commit is contained in:
@@ -70,7 +70,7 @@ def add_zero_length_segment(file: ifcopenshell.file, entity: entity_instance) ->
|
||||
curve_segment = file.createIfcCurveSegment(
|
||||
Transition="DISCONTINUOUS",
|
||||
Placement=file.createIfcAxis2Placement2D(
|
||||
Location=file.createIfcCartesianPoint(((x, y))),
|
||||
Location=file.createIfcCartesianPoint((x, y)),
|
||||
RefDirection=file.createIfcDirection((dx, dy)),
|
||||
),
|
||||
SegmentStart=file.createIfcLengthMeasure(0.0),
|
||||
|
||||
@@ -116,7 +116,7 @@ class Usecase:
|
||||
offset_direction = direction_ratios # offset direction doesn't change if direction_sense is negative
|
||||
extrusion_direction = self.file.createIfcDirection(direction_ratios)
|
||||
if self.direction_sense == "NEGATIVE":
|
||||
direction_ratios = tuple((-n for n in direction_ratios))
|
||||
direction_ratios = tuple(-n for n in direction_ratios)
|
||||
extrusion_direction = self.file.createIfcDirection(direction_ratios)
|
||||
|
||||
perpendicular_offset = self.convert_si_to_unit(self.offset) * abs(1 / cos(self.x_angle))
|
||||
|
||||
@@ -112,7 +112,7 @@ class Usecase:
|
||||
self.file.createIfcDirection((1.0, 0.0, 0.0)),
|
||||
),
|
||||
extrusion_direction,
|
||||
self.convert_si_to_unit(self.settings["height"]) * abs((1 / cos(self.settings["x_angle"]))),
|
||||
self.convert_si_to_unit(self.settings["height"]) * abs(1 / cos(self.settings["x_angle"])),
|
||||
)
|
||||
if self.settings["booleans"]:
|
||||
extrusion = self.apply_booleans(extrusion)
|
||||
|
||||
@@ -55,7 +55,7 @@ def unassign_lag_time(file: ifcopenshell.file, rel_sequence: ifcopenshell.entity
|
||||
# What if you didn't?
|
||||
ifcopenshell.api.sequence.unassign_lag_time(model, rel_sequence=sequence)
|
||||
"""
|
||||
if file.get_total_inverses((current_lag_time := rel_sequence.TimeLag)) == 1:
|
||||
if file.get_total_inverses(current_lag_time := rel_sequence.TimeLag) == 1:
|
||||
file.remove(current_lag_time)
|
||||
else:
|
||||
rel_sequence.TimeLag = None
|
||||
|
||||
@@ -302,7 +302,7 @@ class Settings:
|
||||
def set_(self, *args): ...
|
||||
def setting_names(self): ...
|
||||
|
||||
class SvgSerializer (WriteOnlyGeometrySerializer):
|
||||
class SvgSerializer(WriteOnlyGeometrySerializer):
|
||||
SH_NONE: Any
|
||||
SH_FULL: Any
|
||||
SH_LEFT: Any
|
||||
|
||||
@@ -135,7 +135,7 @@ def offset_date(start, duration, duration_type: DURATION_TYPE, calendar: ifcopen
|
||||
months = getattr(duration, "months", 0)
|
||||
years = getattr(duration, "years", 0)
|
||||
|
||||
abs_duration = abs((duration.days + months * 30 + years * 12 * 30))
|
||||
abs_duration = abs(duration.days + months * 30 + years * 12 * 30)
|
||||
date_offset = datetime.timedelta(days=1 if duration.days > 0 else -1)
|
||||
while abs_duration > 0:
|
||||
if duration_type == "ELAPSEDTIME" or not is_calendar_applicable(current_date, calendar):
|
||||
|
||||
Reference in New Issue
Block a user