Skip to content

Commit bb1ec6d

Browse files
Get rid of # pylint pragmas
As far as i can see pylint is not used any more, this project uses ruff.
1 parent 4615d4d commit bb1ec6d

16 files changed

Lines changed: 4 additions & 73 deletions

pynetdicom/acse.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ def _check_async_ops(self) -> AsynchronousOperationsWindowNegotiation | None:
7878
default values for the number of operations invoked/performed
7979
(1, 1).
8080
"""
81-
# pylint: disable=broad-except
82-
setattr(self.assoc, "abort", self.assoc._abort_nonblocking)
81+
setattr(self.assoc, "abort", self.assoc._abort_nonblocking) # noqa: B010
8382

8483
try:
8584
# Response is always ignored as async ops is not supported
@@ -113,8 +112,7 @@ def _check_sop_class_common_extended(
113112
The {SOP Class UID : SOPClassCommonExtendedNegotiation} items for
114113
the accepted SOP Class Common Extended negotiation items.
115114
"""
116-
# pylint: disable=broad-except
117-
setattr(self.assoc, "abort", self.assoc._abort_nonblocking)
115+
setattr(self.assoc, "abort", self.assoc._abort_nonblocking) # noqa: B010
118116

119117
try:
120118
rsp = evt.trigger(
@@ -155,8 +153,7 @@ def _check_sop_class_extended(self) -> list[SOPClassExtendedNegotiation]:
155153
list of pdu_primitives.SOPClassExtendedNegotiation
156154
The SOP Class Extended Negotiation items to be sent in response
157155
"""
158-
# pylint: disable=broad-except
159-
setattr(self.assoc, "abort", self.assoc._abort_nonblocking)
156+
setattr(self.assoc, "abort", self.assoc._abort_nonblocking) # noqa: B010
160157

161158
try:
162159
user_response = evt.trigger(
@@ -207,8 +204,7 @@ def _check_user_identity(self) -> tuple[bool, UserIdentityNegotiation | None]:
207204
The negotiation response, if a positive response is requested,
208205
otherwise None.
209206
"""
210-
# pylint: disable=broad-except
211-
setattr(self.assoc, "abort", self.assoc._abort_nonblocking)
207+
setattr(self.assoc, "abort", self.assoc._abort_nonblocking) # noqa: B010
212208

213209
# The UserIdentityNegotiation (request) item
214210
req = self.requestor.user_identity
@@ -361,9 +357,7 @@ def _negotiate_as_acceptor(self) -> None:
361357

362358
# SOP Class Common Extended Negotiation items
363359
# Note: No response items are allowed
364-
# pylint: disable=protected-access
365360
self.acceptor._common_ext = self._check_sop_class_common_extended()
366-
# pylint: enable=protected-access
367361

368362
# Asynchronous Operations Window Negotiation items
369363
if self.requestor.asynchronous_operations != (1, 1):
@@ -382,7 +376,6 @@ def _negotiate_as_acceptor(self) -> None:
382376
reject_assoc_rsd = (0x02, 0x03, 0x02)
383377

384378
if reject_assoc_rsd:
385-
# pylint: disable=no-value-for-parameter
386379
LOGGER.info("Rejecting Association")
387380
self.send_reject(*reject_assoc_rsd)
388381
evt.trigger(self.assoc, evt.EVT_REJECTED, {})
@@ -410,13 +403,11 @@ def _negotiate_as_acceptor(self) -> None:
410403
rq_roles,
411404
)
412405

413-
# pylint: disable=protected-access
414406
# Accepted contexts are stored as {context ID : context}
415407
self.assoc._accepted_cx = {
416408
cast(int, cx.context_id): cx for cx in result if cx.result == 0x00
417409
}
418410
self.assoc._rejected_cx = [cx for cx in result if cx.result != 0x00]
419-
# pylint: enable=protected-access
420411

421412
# Add any SCP/SCU Role Selection Negotiation response items
422413
for role_item in ac_roles:
@@ -498,7 +489,6 @@ def _negotiate_as_requestor(self) -> None:
498489
ac_roles,
499490
)
500491

501-
# pylint: disable=protected-access
502492
# Accepted contexts are stored as {context ID : context}
503493
self.assoc._accepted_cx = {
504494
cast(int, cx.context_id): cx
@@ -508,7 +498,6 @@ def _negotiate_as_requestor(self) -> None:
508498
self.assoc._rejected_cx = [
509499
cx for cx in negotiated_contexts if cx.result != 0x00
510500
]
511-
# pylint: enable=protected-access
512501

513502
evt.trigger(self.assoc, evt.EVT_ACCEPTED, {})
514503

pynetdicom/ae.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class ApplicationEntity:
5353
or both.
5454
"""
5555

56-
# pylint: disable=too-many-instance-attributes,too-many-public-methods
5756
def __init__(self, ae_title: str = "PYNETDICOM") -> None:
5857
"""Create a new Application Entity.
5958

pynetdicom/association.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from pydicom.tag import BaseTag
2121
from pydicom.uid import UID, ImplicitVRLittleEndian, ExplicitVRBigEndian
2222

23-
# pylint: disable=no-name-in-module
2423
from pynetdicom.acse import ACSE
2524
from pynetdicom import _config, evt
2625
from pynetdicom.dimse import DIMSEServiceProvider
@@ -90,7 +89,6 @@
9089
from pynetdicom.transport import AssociationServer, AssociationSocket
9190

9291

93-
# pylint: enable=no-name-in-module
9492
LOGGER = logging.getLogger(__name__)
9593
HandlerType = dict[
9694
evt.EventType,
@@ -580,7 +578,6 @@ def mode(self, mode: str) -> None:
580578
"or 'acceptor'"
581579
)
582580

583-
# pylint: disable=attribute-defined-outside-init
584581
self._mode = mode
585582

586583
@property
@@ -2213,7 +2210,6 @@ def _wrap_get_move_responses(
22132210
# statuses should contain an Identifier dataset
22142211
# with a (0008,0058) Failed SOP Instance UID List
22152212
# element however this can't be assumed
2216-
# pylint: disable=broad-except
22172213
with self.lock:
22182214
try:
22192215
identifier = decode(
@@ -2438,7 +2434,6 @@ def send_n_action(
24382434
b: BytesIO = rsp.ActionReply # type: ignore
24392435
if b and b.getvalue() != b"":
24402436
# Attempt to decode the response's dataset
2441-
# pylint: disable=broad-except
24422437
try:
24432438
action_reply = decode(
24442439
b,
@@ -2676,7 +2671,6 @@ def send_n_create(
26762671
b: BytesIO = rsp.AttributeList # type: ignore
26772672
if b and b.getvalue() != b"":
26782673
# Attempt to decode the response's dataset
2679-
# pylint: disable=broad-except
26802674
try:
26812675
attribute_list = decode(
26822676
b,
@@ -3007,7 +3001,6 @@ def send_n_event_report(
30073001
b: BytesIO = rsp.EventReply # type: ignore
30083002
if b and b.getvalue() != b"":
30093003
# Attempt to decode the response"s dataset
3010-
# pylint: disable=broad-except
30113004
try:
30123005
event_reply = decode(
30133006
b,
@@ -3215,7 +3208,6 @@ def send_n_get(
32153208
b: BytesIO = rsp.AttributeList # type: ignore
32163209
if b and b.getvalue() != b"":
32173210
# Attempt to decode the response"s dataset
3218-
# pylint: disable=broad-except
32193211
try:
32203212
attribute_list = decode(
32213213
b,
@@ -3466,7 +3458,6 @@ def send_n_set(
34663458
b: BytesIO = rsp.AttributeList # type: ignore
34673459
if b and b.getvalue() != b"":
34683460
# Attempt to decode the response's dataset
3469-
# pylint: disable=broad-except
34703461
try:
34713462
attribute_list = decode(
34723463
b,
@@ -3824,7 +3815,6 @@ def extended_negotiation(self) -> list[_UI]:
38243815

38253816
return items
38263817

3827-
# pylint: disable=unidiomatic-typecheck
38283818
for item in self.user_information:
38293819
if type(item) in self._ext_neg.keys():
38303820
items.append(item)
@@ -4177,7 +4167,6 @@ def remove_negotiation_item(self, item: _UI) -> None:
41774167
"has started"
41784168
)
41794169

4180-
# pylint: disable=unidiomatic-typecheck
41814170
if type(item) in self._ext_neg:
41824171
# Do nothing if item not in _ext_neg
41834172
if item in self._ext_neg[type(item)]:

pynetdicom/dimse.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
from pynetdicom import evt
1212

13-
# pylint: disable=no-name-in-module
1413
from pynetdicom.dimse_messages import (
1514
C_STORE_RQ,
1615
C_STORE_RSP,
@@ -38,7 +37,6 @@
3837
DIMSEMessage,
3938
)
4039

41-
# pylint: enable=no-name-in-module
4240
from pynetdicom.dimse_primitives import (
4341
C_STORE,
4442
C_FIND,

pynetdicom/dimse_messages.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ def decode_msg(self, primitive: P_DATA, assoc: "Association | None" = None) -> b
436436

437437
# Command Set is always encoded Implicit VR Little Endian
438438
# decode(dataset, is_implicit_VR, is_little_endian)
439-
# pylint: disable=attribute-defined-outside-init
440439
self.command_set = decode(self.encoded_command_set, True, True)
441440

442441
# Determine which DIMSE Message class to use
@@ -745,7 +744,6 @@ def primitive_to_message(self, primitive: DimsePrimitiveType) -> None:
745744
:ref:`pynetdicom.dimse_primitives<api_dimse_primitives>`
746745
to convert to the current ``DIMSEMessage`` object.
747746
"""
748-
# pylint: disable=too-many-branches,too-many-statements
749747
cls_type_name = self.__class__.__name__.replace("_", "-")
750748
if cls_type_name not in _COMMAND_SET_KEYWORDS:
751749
raise ValueError(

pynetdicom/dimse_primitives.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ def close(self) -> None: ...
4444
DimsePrimitiveType: TypeAlias = "C_CANCEL | DimseServiceType"
4545

4646

47-
# pylint: disable=invalid-name
48-
# pylint: disable=attribute-defined-outside-init
49-
# pylint: disable=too-many-instance-attributes
50-
# pylint: disable=anomalous-backslash-in-string
5147
class DIMSEPrimitive:
5248
"""Base class for the DIMSE primitives."""
5349

pynetdicom/dsutils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ def encode(
145145
The encoded dataset as :class:`bytes` (if successful) or ``None`` if
146146
the encoding failed.
147147
"""
148-
# pylint: disable=broad-except
149148
fp = DicomBytesIO()
150149
fp.is_implicit_VR = is_implicit_vr
151150
fp.is_little_endian = is_little_endian

pynetdicom/events.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ def __str__(self) -> str:
9898
return self.name
9999

100100

101-
# pylint: disable=line-too-long
102101
EVT_ABORTED = NotificationEvent("EVT_ABORTED", "Association aborted")
103102
EVT_ACCEPTED = NotificationEvent("EVT_ACCEPTED", "Association request accepted") # noqa
104103
EVT_ACSE_RECV = NotificationEvent(
@@ -189,7 +188,6 @@ def __str__(self) -> str:
189188
) # noqa
190189
EVT_N_GET = InterventionEvent("EVT_N_GET", "N-GET request received")
191190
EVT_N_SET = InterventionEvent("EVT_N_SET", "N-SET request received")
192-
# pylint: enable=line-too-long
193191

194192
_INTERVENTION_EVENTS = [
195193
ii[1]

pynetdicom/fsm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class InvalidEventError(Exception):
3434
pass
3535

3636

37-
# pylint: disable=invalid-name
3837
class StateMachine:
3938
"""Implementation of the DICOM Upper Layer State Machine.
4039
@@ -1036,7 +1035,6 @@ def AA_8(dul: "DULServiceProvider") -> str:
10361035

10371036
# Finite State Machine
10381037
# Machine State Definitions, PS3.8 Tables 9-1, 9-2, 9-3, 9-4, 9-5
1039-
# pylint: disable=line-too-long
10401038
STATES = {
10411039
# No association
10421040
"Sta1": "Idle",

pynetdicom/pdu.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def __eq__(self, other: Any) -> bool:
134134
if other is self:
135135
return True
136136

137-
# pylint: disable=protected-access
138137
if isinstance(other, self.__class__):
139138
self_dict = {
140139
enc[0]: getattr(self, enc[0]) for enc in self._encoders if enc[0]

0 commit comments

Comments
 (0)