Skip to content

Commit 3c07d30

Browse files
refactor: remove ruff ignores F (#506)
## Description remove ruff ignore for F rules ## Issue linked #478 ## Checklist - [x] I have tested my changes locally. - [x] I have added necessary documentation or updated existing documentation. - [x] I have followed the coding style guidelines of this project. - [x] I have added appropriate tests (unit, integration, system). - [x] I have reviewed my changes before submitting this pull request. - [x] I have linked the issue or issues that are solved by the PR if any. - [x] I have assigned this PR to myself. - [x] I have made sure that the title of my PR follows [Conventional commits style](https://www.conventionalcommits.org/en/v1.0.0/#summary) (e.g. ``feat: add optical property``) - [x] I have agreed with the Contributor License Agreement ([CLA](https://developer.ansys.com/form/cla-acceptance)). --------- Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 585e9ba commit 3c07d30

33 files changed

+26
-56
lines changed

doc/changelog.d/506.miscellaneous.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
remove ruff ignores F

examples/core/source.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# There are different type of sources available: luminaire source, surface source, ray file source.
66

77
# +
8-
import os
98
from pathlib import Path
109

1110
from ansys.speos.core import GeoRef, Project, Speos

examples/kernel/modify-scene.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
from ansys.api.speos.sensor.v1 import camera_sensor_pb2
3131
from ansys.speos.core import Speos
32-
from ansys.speos.core.kernel import SensorTemplateLink
3332
from ansys.speos.core.kernel.scene import ProtoScene
3433
from ansys.speos.core.kernel.sensor_template import ProtoSensorTemplate
3534

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ select = [
9999
"TD", # flake8-todos, https://docs.astral.sh/ruff/rules/#flake8-todos-td
100100
]
101101
ignore = [
102-
"F401",
103-
"F841", # TODO: Local variable assigned but never used
104102
"N802", # TODO: Function name should be lowercase
105103
"N803",
106104
"N806",
@@ -113,6 +111,7 @@ ignore = [
113111

114112
[tool.ruff.lint.per-file-ignores]
115113
"examples/*" = ["D100", "E402"]
114+
"__init__.py" = ["F401"]
116115

117116

118117
[tool.ruff.lint.pydocstyle]

src/ansys/speos/core/workflow/combine_speos.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
# SOFTWARE.
2222
"""Import geometries and materials from several SPEOS files to a project."""
2323

24-
import os
2524
from pathlib import Path
2625
from typing import List, Optional
2726

tests/core/test_intensity.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic using intensity."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.speos.core import GeoRef, Intensity, Speos

tests/core/test_lxp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic using lxp."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
import ansys.speos.core.lxp as lxp

tests/core/test_opt_prop.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic using optical properties."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.speos.core import GeoRef, Project, Speos

tests/core/test_project.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic using project."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.speos.core import Body, Face, Part, Project, Speos
@@ -167,16 +166,16 @@ def test_find_feature_geom(speos: Speos):
167166
p2 = Project(speos=speos)
168167
root_part = p2.create_root_part()
169168
body_01 = root_part.create_body(name="Body.01")
170-
face_011 = body_01.create_face(name="Face.011")
171-
face_012 = body_01.create_face(name="Face.012")
172-
body_02 = root_part.create_body(name="Body.02")
173-
face_021 = body_01.create_face(name="Face.021")
169+
body_01.create_face(name="Face.011")
170+
body_01.create_face(name="Face.012")
171+
root_part.create_body(name="Body.02")
172+
body_01.create_face(name="Face.021")
174173
face_022 = body_01.create_face(name="Face.022")
175-
face_023 = body_01.create_face(name="Face.023")
174+
body_01.create_face(name="Face.023")
176175
sub_part_1 = root_part.create_sub_part(name="SubPart.1")
177176
body_1 = sub_part_1.create_body(name="Body.1")
178-
face_11 = body_1.create_face(name="Face.11")
179-
face_12 = body_1.create_face(name="Face.12")
177+
body_1.create_face(name="Face.11")
178+
body_1.create_face(name="Face.12")
180179
sub_part_11 = sub_part_1.create_sub_part(name="SubPart.11")
181180
body_11 = sub_part_11.create_body(name="Body.11")
182181
face_111 = body_11.create_face(name="Face.111")
@@ -185,7 +184,7 @@ def test_find_feature_geom(speos: Speos):
185184
body_2 = sub_part_2.create_body(name="Body.2")
186185
face_21 = body_2.create_face(name="Face.21")
187186
face_22 = body_2.create_face(name="Face.22")
188-
face_23 = body_2.create_face(name="Face.23")
187+
body_2.create_face(name="Face.23")
189188

190189
# Look at first level : 2 Bodies and 2 SubParts
191190
found_feats = p2.find(name=".*", name_regex=True, feature_type=Part)

tests/core/test_proto_message_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic using proto_message_utils."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.speos.core import OptProp, Project, Speos, proto_message_utils

tests/core/test_sensor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Test basic using sensor."""
2424

2525
import math
26-
import os
2726
from pathlib import Path
2827

2928
from ansys.api.speos.sensor.v1 import camera_sensor_pb2

tests/core/test_simulation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic using simulation."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.api.speos.simulation.v1 import simulation_template_pb2

tests/core/test_source.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Unit test for Source Class."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.speos.core import GeoRef, Project, Speos

tests/core/test_spectrum.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic using spectrums."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.speos.core import Spectrum, Speos

tests/helper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
in local.
2828
"""
2929

30-
import os
3130
from pathlib import Path
3231
import subprocess
3332
import time

tests/kernel/test_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Test basic client connection."""
2424

2525
from grpc import insecure_channel
26-
import pytest
2726

2827
from ansys.speos.core.kernel.client import SpeosClient
2928
from ansys.speos.core.speos import Speos

tests/kernel/test_intensity_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic intensity template database connection."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.api.speos.common.v1 import data_pb2

tests/kernel/test_job.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_job(speos: Speos):
3939
scene = create_basic_scene(speos)
4040
assert len(scene.get().simulations) == 4
4141

42-
job_dir = speos.client.jobs().create(
42+
speos.client.jobs().create(
4343
message=ProtoJob(
4444
name="job_dir",
4545
scene_guid=scene.key,
@@ -50,7 +50,7 @@ def test_job(speos: Speos):
5050
)
5151
)
5252

53-
job_inv = speos.client.jobs().create(
53+
speos.client.jobs().create(
5454
message=ProtoJob(
5555
name="job_inv",
5656
scene_guid=scene.key,
@@ -64,7 +64,7 @@ def test_job(speos: Speos):
6464
)
6565
)
6666

67-
job_int = speos.client.jobs().create(
67+
speos.client.jobs().create(
6868
message=ProtoJob(
6969
name="job_int",
7070
scene_guid=scene.key,

tests/kernel/test_scene.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test scene."""
2424

25-
import os
2625
from pathlib import Path
2726
from typing import List, Mapping, Optional
2827

tests/kernel/test_sensor_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test source template."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.api.speos.sensor.v1 import (

tests/kernel/test_sop_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Test basic sop template database connection."""
2424

2525
import json
26-
import os
2726
from pathlib import Path
2827

2928
import grpc

tests/kernel/test_source_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Test source template."""
2424

2525
import json
26-
import os
2726
from pathlib import Path
2827

2928
import grpc

tests/kernel/test_spectrum.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test basic spectrum database connection."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.speos.core.kernel.spectrum import ProtoSpectrum

tests/kernel/test_vop_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Test basic vop template database connection."""
2424

2525
import json
26-
import os
2726
from pathlib import Path
2827

2928
import grpc

tests/stubs/test_anisotropic_bsdf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Unit test for anisotropic bsdf service."""
2424

2525
import math
26-
import os
2726
from pathlib import Path
2827

2928
from google.protobuf.empty_pb2 import Empty

tests/stubs/test_bsdf_creation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Unit test for BSDF creation service."""
2424

2525
import math
26-
import os
2726
from pathlib import Path
2827

2928
import ansys.api.speos.bsdf.v1.bsdf_creation_pb2 as bsdf_creation__v1__pb2

tests/stubs/test_eulumdat_file.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Unit Test for Eulumdat service."""
2424

2525
import logging
26-
import os
2726
from pathlib import Path
2827

2928
from ansys.api.speos.intensity_distributions.v1 import (
@@ -235,17 +234,17 @@ def test_grpc_eulumdat_intensity(speos: Speos):
235234
eulumdat = createEulumdatIntensity()
236235

237236
logging.debug("Sending protocol buffer to server")
238-
import_response = eulumdat_pb2.Import_Response()
239-
import_response = stub.Import(eulumdat)
237+
eulumdat_pb2.Import_Response()
238+
stub.Import(eulumdat)
240239

241240
logging.debug("Writing as {save_name.file_uri}")
242-
save_response = eulumdat_pb2.Save_Response()
243-
save_response = stub.Save(save_name)
241+
eulumdat_pb2.Save_Response()
242+
stub.Save(save_name)
244243
assert helper.does_file_exist(save_name.file_uri)
245244

246245
logging.debug("Reading {load_name.file_uri} back")
247-
load_response = eulumdat_pb2.Load_Response()
248-
load_response = stub.Load(load_name)
246+
eulumdat_pb2.Load_Response()
247+
stub.Load(load_name)
249248
helper.remove_file(load_name.file_uri)
250249

251250
logging.debug("Exporting eulumdat intensity protocol buffer")

tests/stubs/test_ies_file.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Unit test for IES service."""
2424

2525
import logging
26-
import os
2726
from pathlib import Path
2827

2928
from ansys.api.speos.intensity_distributions.v1 import ies_pb2, ies_pb2_grpc
@@ -149,22 +148,22 @@ def test_grpc_ies_intensity(speos: Speos):
149148
ies = createIesIntensity()
150149

151150
logging.debug("Sending protocol buffer to server")
152-
import_response = ies_pb2.Import_Response()
153-
import_response = stub.Import(ies)
151+
ies_pb2.Import_Response()
152+
stub.Import(ies)
154153

155154
logging.debug("Writing as {save_request.file_uri}")
156-
save_response = ies_pb2.Save_Response()
157-
save_response = stub.Save(save_request)
155+
ies_pb2.Save_Response()
156+
stub.Save(save_request)
158157
assert helper.does_file_exist(save_request.file_uri)
159158

160159
logging.debug("Reading {load_response.file_uri}")
161-
load_response = ies_pb2.Load_Response()
162-
load_response = stub.Load(load_request)
160+
ies_pb2.Load_Response()
161+
stub.Load(load_request)
163162
helper.remove_file(load_request.file_uri)
164163

165164
logging.debug("Exporting ies intensity protocol buffer")
166165
export_request = ies_pb2.Export_Request()
167-
ies2 = ies_pb2.IesIntensityDistribution()
166+
ies_pb2.IesIntensityDistribution()
168167
ies2 = stub.Export(export_request)
169168

170169
logging.debug("Comparing ies intensity distributions")

tests/stubs/test_lpf_file_reader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Unit test for LPF reader service."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
import ansys.api.speos.file.v1.file_transfer as file_transfer_helper__v1

tests/stubs/test_spectral_bsdf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Unit tests for spectral BSDF service."""
2424

2525
import math
26-
import os
2726
from pathlib import Path
2827

2928
from google.protobuf.empty_pb2 import Empty

tests/stubs/test_xmp_intensity_file.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Unit test for Intensity XMP service."""
2424

2525
import logging
26-
import os
2726
from pathlib import Path
2827

2928
from ansys.api.speos.intensity_distributions.v1 import (

tests/stubs/test_xmp_spectral_intensity_file.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"""Unit test for spectral Intensity XMP service."""
2424

2525
import logging
26-
import os
2726
from pathlib import Path
2827

2928
from ansys.api.speos.intensity_distributions.v1 import (

tests/workflow/test_combine_speos.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
"""Test using combine_speos module in workflow layer."""
2424

25-
import os
2625
from pathlib import Path
2726

2827
from ansys.speos.core import OptProp, Part, Project, Speos

0 commit comments

Comments
 (0)