Skip to content

Commit

Permalink
Blacken
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion committed Nov 8, 2023
1 parent 687ff50 commit 75883fd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 38 deletions.
10 changes: 5 additions & 5 deletions pynetdicom/service_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ class QueryRetrieveServiceClass(ServiceClass):
"EncapsulatedDocument",
]
_SUPPORTED_UIDS = {
"C-FIND" : [
"C-FIND": [
"1.2.840.10008.5.1.4.1.2.1.1",
"1.2.840.10008.5.1.4.1.2.2.1",
"1.2.840.10008.5.1.4.1.2.3.1",
Expand All @@ -1551,7 +1551,7 @@ class QueryRetrieveServiceClass(ServiceClass):
"1.2.840.10008.5.1.4.45.2",
"1.2.840.10008.5.1.4.1.1.200.4",
],
"C-GET" : [
"C-GET": [
"1.2.840.10008.5.1.4.1.2.1.3",
"1.2.840.10008.5.1.4.1.2.2.3",
"1.2.840.10008.5.1.4.1.2.3.3",
Expand All @@ -1565,7 +1565,7 @@ class QueryRetrieveServiceClass(ServiceClass):
"1.2.840.10008.5.1.4.45.4",
"1.2.840.10008.5.1.4.1.1.200.6",
],
"C-MOVE" : [
"C-MOVE": [
"1.2.840.10008.5.1.4.1.2.1.2",
"1.2.840.10008.5.1.4.1.2.2.2",
"1.2.840.10008.5.1.4.1.2.3.2",
Expand Down Expand Up @@ -2390,7 +2390,7 @@ class BasicWorklistManagementServiceClass(QueryRetrieveServiceClass):

statuses = QR_FIND_SERVICE_CLASS_STATUS
_SUPPORTED_UIDS = {
"C-FIND" : ["1.2.840.10008.5.1.4.31"],
"C-FIND": ["1.2.840.10008.5.1.4.31"],
}

def SCP(self, req: "_QR", context: "PresentationContext") -> None:
Expand Down Expand Up @@ -2599,7 +2599,7 @@ class SubstanceAdministrationQueryServiceClass(QueryRetrieveServiceClass):

statuses = SUBSTANCE_ADMINISTRATION_SERVICE_CLASS_STATUS
_SUPPORTED_UIDS = {
"C-FIND" : ["1.2.840.10008.5.1.4.41", "1.2.840.10008.5.1.4.42"],
"C-FIND": ["1.2.840.10008.5.1.4.41", "1.2.840.10008.5.1.4.42"],
}

def SCP(self, req: "_QR", context: "PresentationContext") -> None:
Expand Down
47 changes: 22 additions & 25 deletions pynetdicom/sop_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,27 +455,27 @@ def _generate_sop_classes(sop_class_dict: Dict[str, str]) -> None:


_SERVICE_TO_UID_GROUP = {
VerificationServiceClass : _VERIFICATION_CLASSES,
QueryRetrieveServiceClass : _QR_CLASSES,
StorageServiceClass : _STORAGE_CLASSES,
ApplicationEventLoggingServiceClass : _APPLICATION_EVENT_CLASSES,
BasicWorklistManagementServiceClass : _BASIC_WORKLIST_CLASSES,
ColorPaletteQueryRetrieveServiceClass : _COLOR_PALETTE_CLASSES,
DefinedProcedureProtocolQueryRetrieveServiceClass : _DEFINED_PROCEDURE_CLASSES,
DisplaySystemManagementServiceClass : _DISPLAY_SYSTEM_CLASSES,
HangingProtocolQueryRetrieveServiceClass : _HANGING_PROTOCOL_CLASSES,
ImplantTemplateQueryRetrieveServiceClass : _IMPLANT_TEMPLATE_CLASSES,
InstanceAvailabilityNotificationServiceClass : _INSTANCE_AVAILABILITY_CLASSES,
MediaCreationManagementServiceClass : _MEDIA_CREATION_CLASSES,
NonPatientObjectStorageServiceClass : _NON_PATIENT_OBJECT_CLASSES,
PrintManagementServiceClass : _PRINT_MANAGEMENT_CLASSES,
ProcedureStepServiceClass : _PROCEDURE_STEP_CLASSES,
ProtocolApprovalQueryRetrieveServiceClass : _PROTOCOL_APPROVAL_CLASSES,
RelevantPatientInformationQueryServiceClass : _RELEVANT_PATIENT_QUERY_CLASSES,
RTMachineVerificationServiceClass : _RT_MACHINE_VERIFICATION_CLASSES,
StorageCommitmentServiceClass : _STORAGE_COMMITMENT_CLASSES,
SubstanceAdministrationQueryServiceClass : _SUBSTANCE_ADMINISTRATION_CLASSES,
UnifiedProcedureStepServiceClass : _UNIFIED_PROCEDURE_STEP_CLASSES,
VerificationServiceClass: _VERIFICATION_CLASSES,
QueryRetrieveServiceClass: _QR_CLASSES,
StorageServiceClass: _STORAGE_CLASSES,
ApplicationEventLoggingServiceClass: _APPLICATION_EVENT_CLASSES,
BasicWorklistManagementServiceClass: _BASIC_WORKLIST_CLASSES,
ColorPaletteQueryRetrieveServiceClass: _COLOR_PALETTE_CLASSES,
DefinedProcedureProtocolQueryRetrieveServiceClass: _DEFINED_PROCEDURE_CLASSES,
DisplaySystemManagementServiceClass: _DISPLAY_SYSTEM_CLASSES,
HangingProtocolQueryRetrieveServiceClass: _HANGING_PROTOCOL_CLASSES,
ImplantTemplateQueryRetrieveServiceClass: _IMPLANT_TEMPLATE_CLASSES,
InstanceAvailabilityNotificationServiceClass: _INSTANCE_AVAILABILITY_CLASSES,
MediaCreationManagementServiceClass: _MEDIA_CREATION_CLASSES,
NonPatientObjectStorageServiceClass: _NON_PATIENT_OBJECT_CLASSES,
PrintManagementServiceClass: _PRINT_MANAGEMENT_CLASSES,
ProcedureStepServiceClass: _PROCEDURE_STEP_CLASSES,
ProtocolApprovalQueryRetrieveServiceClass: _PROTOCOL_APPROVAL_CLASSES,
RelevantPatientInformationQueryServiceClass: _RELEVANT_PATIENT_QUERY_CLASSES,
RTMachineVerificationServiceClass: _RT_MACHINE_VERIFICATION_CLASSES,
StorageCommitmentServiceClass: _STORAGE_COMMITMENT_CLASSES,
SubstanceAdministrationQueryServiceClass: _SUBSTANCE_ADMINISTRATION_CLASSES,
UnifiedProcedureStepServiceClass: _UNIFIED_PROCEDURE_STEP_CLASSES,
}


Expand Down Expand Up @@ -592,9 +592,7 @@ def register_uid(
)

if not inspect.isclass(service_class):
raise TypeError(
"'service_class' must be a class object not a class instance"
)
raise TypeError("'service_class' must be a class object not a class instance")

if not issubclass(service_class, ServiceClass):
raise TypeError(
Expand All @@ -618,7 +616,6 @@ def register_uid(
)
service_class._SUPPORTED_UIDS[dimse_msg_type].append(uid)
else:

service_class._SUPPORTED_UIDS["C-FIND"].append(uid)


Expand Down
1 change: 0 additions & 1 deletion pynetdicom/tests/test_service_qr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6351,7 +6351,6 @@ def register_new_uid_bwm():
BasicWorklistManagementServiceClass._SUPPORTED_UIDS["C-FIND"].remove("1.2.3.4")



class TestBasicWorklistServiceClass:
"""Tests for BasicWorklistManagementServiceClass."""

Expand Down
1 change: 0 additions & 1 deletion pynetdicom/tests/test_service_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def register_new_uid():
delattr(sop_class, "NewStorage")



class TestStorageServiceClass:
"""Test the StorageServiceClass"""

Expand Down
12 changes: 6 additions & 6 deletions pynetdicom/tests/test_sop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tests for the sop module."""
"""Tests for the sop_class module."""

import pytest

Expand Down Expand Up @@ -98,7 +98,7 @@
PYDICOM_VERSION = __version__.split(".")[:2]


def test_all_sopes():
def test_all_sop_classes():
"""Test that all the SOP Class UIDs are correct."""
for uid in _APPLICATION_EVENT_CLASSES.values():
assert uid in UID_dictionary
Expand Down Expand Up @@ -166,9 +166,9 @@ def test_all_sop_instances():


class TestUIDtoSOPlass:
"""Tests for uid_to_sop"""
"""Tests for uid_to_sop_class"""

def test_missing_sop_cl(self):
def test_missing_sop_class(self):
"""Test SOP Class if UID not found."""
sop = uid_to_sop_class("1.2.3.4")
assert sop == "1.2.3.4"
Expand All @@ -186,7 +186,7 @@ def test_existing(self):


class TestUIDToServiceClass:
"""Tests for sop.uid_to_service_class."""
"""Tests for sop_class.uid_to_service_class."""

def test_service_class_uid(self):
uid = "1.2.840.10008.4.2"
Expand Down Expand Up @@ -318,7 +318,7 @@ def test_unknown_uid(self):


class TestSOPClass:
"""Tests for sop.SOPClass."""
"""Tests for sop_class.SOPClass."""

def test_class_type(self):
"""Test the class type is correct."""
Expand Down

0 comments on commit 75883fd

Please sign in to comment.