Skip to content

Commit 7f92649

Browse files
chore: adding issue links to TODOs (#1320)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 6af4805 commit 7f92649

File tree

25 files changed

+56
-32
lines changed

25 files changed

+56
-32
lines changed

doc/changelog.d/1320.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
chore: adding issue links to TODOs

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ select = [
130130
"I", # isort, see https://docs.astral.sh/ruff/rules/#isort-i
131131
"N", # pep8-naming, see https://docs.astral.sh/ruff/rules/#pep8-naming-n
132132
"PTH", # flake8-use-pathlib, https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
133+
"TD", # flake8-todos, https://docs.astral.sh/ruff/rules/#flake8-todos-td
134+
]
135+
ignore = [
136+
"TD002", # Missing author in TODOs comment
133137
]
134138

135139
[tool.ruff.lint.per-file-ignores]

src/ansys/geometry/core/connection/validate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ def validate(*args, **kwargs): # pragma: no cover
3838
"""Create a client using the default settings and validate it."""
3939
print(GrpcClient(*args, **kwargs))
4040
# TODO: consider adding additional server stat reporting
41+
# https://github.com/ansys/pyansys-geometry/issues/1319

src/ansys/geometry/core/designer/body.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,7 @@ def __generic_boolean_op(
14651465
# TODO: to be deleted - old versions did not have "tool_bodies" in the request
14661466
# This is a temporary fix to support old versions of the server - should be deleted
14671467
# once the server is no longer supported.
1468+
# https://github.com/ansys/pyansys-geometry/issues/1319
14681469
if not isinstance(other, Iterable):
14691470
response = self._template._bodies_stub.Boolean(
14701471
BooleanRequest(body1=self.id, body2=other.id, method=type_bool_op)

src/ansys/geometry/core/designer/component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"""Provides for managing components."""
2323

2424
from enum import Enum, unique
25-
import uuid # TODO: Is ID even needed? Maybe use from SC?
25+
import uuid
2626

2727
from ansys.api.dbu.v0.dbumodels_pb2 import EntityIdentifier
2828
from ansys.api.geometry.v0.bodies_pb2 import (

src/ansys/geometry/core/designer/design.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def _activate(self, called_after_design_creation: bool = False) -> None:
184184
self._grpc_client.log.debug(f"Design {self.name} is activated.")
185185

186186
# TODO: allow for list of materials
187+
# https://github.com/ansys/pyansys-geometry/issues/1319
187188
@protect_grpc
188189
@check_input_types
189190
@ensure_design_is_active
@@ -196,6 +197,7 @@ def add_material(self, material: Material) -> None:
196197
Material to add.
197198
"""
198199
# TODO: Add design id to the request
200+
# https://github.com/ansys/pyansys-geometry/issues/1319
199201
self._materials_stub.AddToDocument(
200202
AddToDocumentRequest(
201203
material=GRPCMaterial(
@@ -827,8 +829,8 @@ def __repr__(self) -> str:
827829
def __read_existing_design(self) -> None:
828830
"""Read an existing ``Design`` located on the server."""
829831
#
830-
# TODO: This might go out of sync with the _update_design_inplace method.
831-
# Ensure that the two methods are in sync. Especially regarding cleanup.
832+
# This might go out of sync with the _update_design_inplace method.
833+
# Ensure that the two methods are in sync. Especially regarding cleanup.
832834
#
833835
# TODO: Not all features implemented yet. Status is as follows
834836
#
@@ -854,6 +856,7 @@ def __read_existing_design(self) -> None:
854856
# - [X] CoordinateSystems
855857
# - [ ] SharedTopology
856858
#
859+
# https://github.com/ansys/pyansys-geometry/issues/1319
857860
import time
858861

859862
start = time.time()
@@ -920,10 +923,13 @@ def __read_existing_design(self) -> None:
920923
# TODO: Add support for more material properties...
921924
# - Need to add support for more MaterialPropertyTypes
922925
# - Need to add support for more Quantity units
926+
# https://github.com/ansys/pyansys-geometry/issues/1319
923927
try:
924928
mp_type = MaterialPropertyType.from_id(property.id)
925-
except ValueError as err: # TODO: Errors coming from MaterialPropertyType.from_id
929+
except ValueError as err:
930+
# TODO: Errors coming from MaterialPropertyType.from_id
926931
# because of unsupported MaterialPropertyType entries...
932+
# https://github.com/ansys/pyansys-geometry/issues/1319
927933
self._grpc_client.log.warning(
928934
f"Material property {property.display_name} of type {property.id} is not supported." # noqa : E501
929935
" Storing as string."
@@ -937,6 +943,7 @@ def __read_existing_design(self) -> None:
937943
UndefinedUnitError,
938944
TypeError,
939945
) as err: # TODO: Errors coming from Quantity ctor because of unsupported units...
946+
# https://github.com/ansys/pyansys-geometry/issues/1319
940947
self._grpc_client.log.warning(
941948
f"Material property {property.display_name} with units {property.units} is not fully supported." # noqa : E501
942949
" Storing value only as float."
@@ -971,8 +978,9 @@ def __read_existing_design(self) -> None:
971978

972979
# Set SharedTopology
973980
# TODO: Maybe just add it to Component or Part message
974-
# - we're starting to iterate through all the Components too much
975-
# TODO: Make sure design doesn't need edge case attention
981+
# we're starting to iterate through all the Components too much.
982+
# Make sure design doesn't need edge case attention
983+
# https://github.com/ansys/pyansys-geometry/issues/1319
976984
num_created_shared_topologies = 0
977985
for component_id, shared_topology_type in response.component_shared_topologies.items():
978986
component = created_components.get(component_id)
@@ -1001,8 +1009,9 @@ def _update_design_inplace(self) -> None:
10011009
# Clear all the existing information
10021010
#
10031011
# TODO: This might go out of sync with the __read_existing_design method
1004-
# if the latter is updated and this method is not. Ensure that
1005-
# the two methods are in sync.
1012+
# if the latter is updated and this method is not. Ensure that
1013+
# the two methods are in sync.
1014+
# https://github.com/ansys/pyansys-geometry/issues/1319
10061015
#
10071016
self._components = []
10081017
self._bodies = []

src/ansys/geometry/core/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def __init__(self, level=logging.DEBUG, to_file=False, to_stdout=True, filename=
374374
self.logger.addFilter(InstanceFilter())
375375
self.logger.setLevel(level)
376376
self.logger.propagate = True
377-
self.level = self.logger.level # TODO: TO REMOVE
377+
self.level = self.logger.level
378378

379379
# Writing logging methods.
380380
self.debug = self.logger.debug

src/ansys/geometry/core/misc/measurements.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ def __init__(self, value: Union[Real, Quantity], unit: Unit, dimensions: Unit):
163163
# Check the input
164164
if isinstance(value, Quantity):
165165
# TODO: inform that if Quantity is given, we will ignore provided unit value
166+
# https://github.com/ansys/pyansys-geometry/issues/1319
166167
unit = value.units
167168
else:
168169
check_is_float_int(value, "value")

src/ansys/geometry/core/modeler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def __init__(
119119

120120
# Initialize the RepairTools - Not available on Linux
121121
# TODO: delete "if" when Linux service is able to use repair tools
122+
# https://github.com/ansys/pyansys-geometry/issues/1319
122123
if self.client.backend_type == BackendType.LINUX_SERVICE:
123124
self._repair_tools = None
124125
self._prepare_tools = None

src/ansys/geometry/core/shapes/curves/curve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,5 @@ def trim(self, interval: Interval) -> "TrimmedCurve":
9494
self.evaluate(interval.start).position,
9595
self.evaluate(interval.end).position,
9696
interval,
97-
None, # TODO: calculate length on client?
97+
None,
9898
)

0 commit comments

Comments
 (0)