Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions pynetdicom/acse.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ def _check_async_ops(self) -> AsynchronousOperationsWindowNegotiation | None:
default values for the number of operations invoked/performed
(1, 1).
"""
# pylint: disable=broad-except
setattr(self.assoc, "abort", self.assoc._abort_nonblocking)
setattr(self.assoc, "abort", self.assoc._abort_nonblocking) # noqa: B010

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

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

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

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

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

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

if reject_assoc_rsd:
# pylint: disable=no-value-for-parameter
LOGGER.info("Rejecting Association")
self.send_reject(*reject_assoc_rsd)
evt.trigger(self.assoc, evt.EVT_REJECTED, {})
Expand Down Expand Up @@ -410,13 +403,11 @@ def _negotiate_as_acceptor(self) -> None:
rq_roles,
)

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

# Add any SCP/SCU Role Selection Negotiation response items
for role_item in ac_roles:
Expand Down Expand Up @@ -498,7 +489,6 @@ def _negotiate_as_requestor(self) -> None:
ac_roles,
)

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

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

Expand Down
1 change: 0 additions & 1 deletion pynetdicom/ae.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class ApplicationEntity:
or both.
"""

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

Expand Down
11 changes: 0 additions & 11 deletions pynetdicom/association.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from pydicom.tag import BaseTag
from pydicom.uid import UID, ImplicitVRLittleEndian, ExplicitVRBigEndian

# pylint: disable=no-name-in-module
from pynetdicom.acse import ACSE
from pynetdicom import _config, evt
from pynetdicom.dimse import DIMSEServiceProvider
Expand Down Expand Up @@ -89,7 +88,6 @@
from pynetdicom.transport import AssociationServer, AssociationSocket


# pylint: enable=no-name-in-module
LOGGER = logging.getLogger(__name__)
HandlerType = dict[
evt.EventType,
Expand Down Expand Up @@ -579,7 +577,6 @@ def mode(self, mode: str) -> None:
"or 'acceptor'"
)

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

@property
Expand Down Expand Up @@ -2212,7 +2209,6 @@ def _wrap_get_move_responses(
# statuses should contain an Identifier dataset
# with a (0008,0058) Failed SOP Instance UID List
# element however this can't be assumed
# pylint: disable=broad-except
with self.lock:
try:
identifier = decode(
Expand Down Expand Up @@ -2437,7 +2433,6 @@ def send_n_action(
b: BytesIO = rsp.ActionReply # type: ignore
if b and b.getvalue() != b"":
# Attempt to decode the response's dataset
# pylint: disable=broad-except
try:
action_reply = decode(
b,
Expand Down Expand Up @@ -2675,7 +2670,6 @@ def send_n_create(
b: BytesIO = rsp.AttributeList # type: ignore
if b and b.getvalue() != b"":
# Attempt to decode the response's dataset
# pylint: disable=broad-except
try:
attribute_list = decode(
b,
Expand Down Expand Up @@ -3006,7 +3000,6 @@ def send_n_event_report(
b: BytesIO = rsp.EventReply # type: ignore
if b and b.getvalue() != b"":
# Attempt to decode the response"s dataset
# pylint: disable=broad-except
try:
event_reply = decode(
b,
Expand Down Expand Up @@ -3214,7 +3207,6 @@ def send_n_get(
b: BytesIO = rsp.AttributeList # type: ignore
if b and b.getvalue() != b"":
# Attempt to decode the response"s dataset
# pylint: disable=broad-except
try:
attribute_list = decode(
b,
Expand Down Expand Up @@ -3465,7 +3457,6 @@ def send_n_set(
b: BytesIO = rsp.AttributeList # type: ignore
if b and b.getvalue() != b"":
# Attempt to decode the response's dataset
# pylint: disable=broad-except
try:
attribute_list = decode(
b,
Expand Down Expand Up @@ -3823,7 +3814,6 @@ def extended_negotiation(self) -> list[_UI]:

return items

# pylint: disable=unidiomatic-typecheck
items.extend(item for item in self.user_information if type(item) in self._ext_neg)

return items
Expand Down Expand Up @@ -4174,7 +4164,6 @@ def remove_negotiation_item(self, item: _UI) -> None:
"has started"
)

# pylint: disable=unidiomatic-typecheck
if type(item) in self._ext_neg:
# Do nothing if item not in _ext_neg
if item in self._ext_neg[type(item)]:
Expand Down
2 changes: 0 additions & 2 deletions pynetdicom/dimse.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from pynetdicom import evt

# pylint: disable=no-name-in-module
from pynetdicom.dimse_messages import (
C_STORE_RQ,
C_STORE_RSP,
Expand Down Expand Up @@ -38,7 +37,6 @@
DIMSEMessage,
)

# pylint: enable=no-name-in-module
from pynetdicom.dimse_primitives import (
C_STORE,
C_FIND,
Expand Down
2 changes: 0 additions & 2 deletions pynetdicom/dimse_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ def decode_msg(self, primitive: P_DATA, assoc: "Association | None" = None) -> b

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

# Determine which DIMSE Message class to use
Expand Down Expand Up @@ -746,7 +745,6 @@ def primitive_to_message(self, primitive: DimsePrimitiveType) -> None:
:ref:`pynetdicom.dimse_primitives<api_dimse_primitives>`
to convert to the current ``DIMSEMessage`` object.
"""
# pylint: disable=too-many-branches,too-many-statements
cls_type_name = self.__class__.__name__.replace("_", "-")
if cls_type_name not in _COMMAND_SET_KEYWORDS:
raise ValueError(
Expand Down
4 changes: 0 additions & 4 deletions pynetdicom/dimse_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ def close(self) -> None: ...
DimsePrimitiveType: TypeAlias = "C_CANCEL | DimseServiceType"


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

Expand Down
1 change: 0 additions & 1 deletion pynetdicom/dsutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def encode(
The encoded dataset as :class:`bytes` (if successful) or ``None`` if
the encoding failed.
"""
# pylint: disable=broad-except
fp = DicomBytesIO()
fp.is_implicit_VR = is_implicit_vr
fp.is_little_endian = is_little_endian
Expand Down
2 changes: 0 additions & 2 deletions pynetdicom/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def __str__(self) -> str:
return self.name


# pylint: disable=line-too-long
EVT_ABORTED = NotificationEvent("EVT_ABORTED", "Association aborted")
EVT_ACCEPTED = NotificationEvent("EVT_ACCEPTED", "Association request accepted") # noqa
EVT_ACSE_RECV = NotificationEvent(
Expand Down Expand Up @@ -190,7 +189,6 @@ def __str__(self) -> str:
) # noqa
EVT_N_GET = InterventionEvent("EVT_N_GET", "N-GET request received")
EVT_N_SET = InterventionEvent("EVT_N_SET", "N-SET request received")
# pylint: enable=line-too-long

_INTERVENTION_EVENTS = [
ii[1]
Expand Down
2 changes: 0 additions & 2 deletions pynetdicom/fsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class InvalidEventError(Exception):
pass


# pylint: disable=invalid-name
class StateMachine:
"""Implementation of the DICOM Upper Layer State Machine.

Expand Down Expand Up @@ -1034,7 +1033,6 @@ def AA_8(dul: "DULServiceProvider") -> str:

# Finite State Machine
# Machine State Definitions, PS3.8 Tables 9-1, 9-2, 9-3, 9-4, 9-5
# pylint: disable=line-too-long
STATES = {
# No association
"Sta1": "Idle",
Expand Down
1 change: 0 additions & 1 deletion pynetdicom/pdu.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def __eq__(self, other: object) -> bool:
if other is self:
return True

# pylint: disable=protected-access
if isinstance(other, self.__class__):
self_dict = {
enc[0]: getattr(self, enc[0]) for enc in self._encoders if enc[0]
Expand Down
3 changes: 0 additions & 3 deletions pynetdicom/pdu_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2272,7 +2272,6 @@ def scu_role(self) -> int | None:
@scu_role.setter
def scu_role(self, value: int | None) -> None:
"""Set the *SCU Role* field value."""
# pylint: disable=attribute-defined-outside-init
if value not in [0, 1, None]:
raise ValueError("SCU Role parameter value must be 0 or 1")
else:
Expand All @@ -2291,7 +2290,6 @@ def scp_role(self) -> int | None:
@scp_role.setter
def scp_role(self, value: int | None) -> None:
"""Set the *SCP Role* field value."""
# pylint: disable=attribute-defined-outside-init
if value not in [0, 1, None]:
raise ValueError("SCP Role parameter value must be 0 or 1")
else:
Expand Down Expand Up @@ -2814,7 +2812,6 @@ def related_general_sop_class_identification(
value_list : list of pydicom.uid.UID
A list of UIDs.
"""
# pylint: disable=attribute-defined-outside-init
self._related_general_sop_class_identification = []

for value in value_list:
Expand Down
Loading
Loading