Skip to content

Commit

Permalink
Fix typos found by codespell (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Dec 21, 2021
1 parent 5521896 commit 142d4e4
Show file tree
Hide file tree
Showing 33 changed files with 115 additions and 163 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black
pip install flake8 black codespell
- name: Check code formatting
run: black . --check
- name: Check spelling
run: codespell -L halp,ot,pres -d pynetdicom
- name: Check for syntax errors
run: python -m flake8 --select=E901,E999,F821,F822,F823 ${{ steps.pydiff.outputs.pyfiles }} --ignore F821
- name: Check for style warnings
Expand Down
2 changes: 1 addition & 1 deletion build_tools/circle/push_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This script is meant to be called in the "deploy" step defined
# in .circleci/config.yml. See https://circleci.com/docs/2.0 for more details.

# We have three possibily workflows:
# We have three possible workflows:
# If the git branch is 'master' then we want to commit and merge the dev/
# docs on gh-pages
# If the git branch is [0-9].[0.9].X (i.e. 0.9.X, 1.0.X, 1.2.X, 41.21.X) then
Expand Down
2 changes: 1 addition & 1 deletion docs/apps/echoscu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The source code for the application can be found `here
Usage
=====

The following example shows what happens when it's succesfully run on
The following example shows what happens when it is successfully run on
an SCP at IP ``127.0.0.1`` and listen port ``11112`` that supports the
Verification service:

Expand Down
2 changes: 1 addition & 1 deletion docs/apps/findscu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The source code for the application can be found `here
Usage
=====

The following example shows what happens when it is succesfully run on
The following example shows what happens when it is successfully run on
an SCP at IP ``127.0.0.1`` and listen port ``11112`` that supports the
Query/Retrieve (Find) service:

Expand Down
2 changes: 1 addition & 1 deletion docs/apps/getscu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The source code for the application can be found `here
Usage
=====

The following example shows what happens when it is succesfully run on
The following example shows what happens when it is successfully run on
an SCP at IP ``127.0.0.1`` and listen port ``11112`` that supports the
Query/Retrieve (Get) service:

Expand Down
2 changes: 1 addition & 1 deletion docs/apps/movescu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The source code for the application can be found `here
Usage
=====

The following example shows what happens when it is succesfully run on
The following example shows what happens when it is successfully run on
an SCP at IP ``127.0.0.1`` and listen port ``11112`` that supports the
Query/Retrieve service with the default *Move Destination* AE title
``STORESCP``:
Expand Down
2 changes: 1 addition & 1 deletion docs/apps/storescu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The source code for the application can be found `here
Usage
=====

The following example shows what happens when it is succesfully run on
The following example shows what happens when it is successfully run on
an SCP at IP ``127.0.0.1`` and listen port ``11112`` that supports the *Storage
Service*:

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/mpps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ MPPS - Set SCU
Once the MPPS SOP Instance has successfully been created, the modality can send
one or more N-SET requests to the MPPS SCP in order to update the attributes
of the SOP Instance. When the procedure has been completed a final N-SET
request is sent containing a *Modification List* with an (0040,0252) *Peformed
request is sent containing a *Modification List* with an (0040,0252) *Performed
Procedure Step Status* of ``"COMPLETED"``.

.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/print.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Which utilise the following SOP Classes:
of the printer.

There are also the following SOP Classes that are not included under
the Meta Print Mangement SOP Classes and which may optionally be supported:
the Meta Print Management SOP Classes and which may optionally be supported:

* *Basic Annotation Box SOP Class* used with N-SET to describe the presentation
of an annotation on a film.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/qr_find.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ to see the requirements for the ``evt.EVT_C_FIND`` handler.
inst for inst in instances if inst.PatientName == ds.PatientName
]
# Skip the other possibile values...
# Skip the other possible values...
# Skip the other possible attributes...
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/qr_get.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ the SERIES level.

One extra step needed with the Query/Retrieve (Get) Service is
that during association we need to include a :class:`SCP/SCU Role Selection
Negotation <pynetdicom.pdu_items.SCP_SCU_RoleSelectionSubItem>`
Negotiation <pynetdicom.pdu_items.SCP_SCU_RoleSelectionSubItem>`
item for each of the supported presentation contexts that may be used with
the C-STORE requests.

Expand Down
2 changes: 1 addition & 1 deletion docs/service_classes/rt_machine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The :dcm:`RT Machine Verification Service Class<part04/chapter_DD.html>`
defines a service that uses the DIMSE N-CREATE, N-SET, N-DELETE, N-ACTION,
N-EVENT-REPORT and N-GET services to
facilitate the independent verification of geometric and dosimetric settings
on a radiation delivery system priot to delivery of treatment.
on a radiation delivery system prior to delivery of treatment.

.. _rt_machine_sops:

Expand Down
4 changes: 2 additions & 2 deletions pynetdicom/acse.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _check_sop_class_extended(self) -> List[SOPClassExtendedNegotiation]:

if not isinstance(user_response, (type(None), dict)):
LOGGER.error(
"Invalid type returned by handler bount to " "'evt.EVT_SOP_EXTENDED'"
"Invalid type returned by handler bound to " "'evt.EVT_SOP_EXTENDED'"
)
user_response = {}

Expand Down Expand Up @@ -428,7 +428,7 @@ def _negotiate_as_acceptor(self) -> None:
# Callbacks/Logging
evt.trigger(self.assoc, evt.EVT_ACCEPTED, {})

# Assocation established OK
# Association established OK
self.assoc.is_established = True
evt.trigger(self.assoc, evt.EVT_ESTABLISHED, {})

Expand Down
12 changes: 6 additions & 6 deletions pynetdicom/association.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,8 @@ def unbind(self, event: evt.EventType, handler: Callable) -> None:
def _c_store_scp(self, req: C_STORE) -> None:
"""A C-STORE SCP implementation.
Handles C-STORE requests from the peer over the same assocation as the
local AE sent a C-MOVE or C-GET request.
Handles C-STORE requests from the peer over the same association as
the local AE sent a C-MOVE or C-GET request.
Must always send a C-STORE response back to the peer.
Expand Down Expand Up @@ -1422,7 +1422,7 @@ def send_c_get(
req.Identifier = BytesIO(bytestream)
else:
LOGGER.error("Failed to encode the supplied Identifier dataset")
raise ValueError("Failed to encode the supplied Identifer dataset")
raise ValueError("Failed to encode the supplied Identifier dataset")

LOGGER.info(f"Sending Get Request: MsgID {msg_id}")
LOGGER.info("")
Expand Down Expand Up @@ -1526,7 +1526,7 @@ def send_c_move(
*Query/Retrieve Service, Hanging Protocol Query/Retrieve Service,
Defined Procedure Protocol Query/Retrieve Service, Color Palette
Query/Retrieve Service* , *Implant Template Query/Retreive
Query/Retrieve Service* , *Implant Template Query/Retrieve
Service* and *Protocol Approval Query/Retrieve Service*
specific (DICOM Standard, Part 4, Annexes C, U, Y, X, BB and HH):
Expand Down Expand Up @@ -1993,7 +1993,7 @@ def _wrap_find_responses(
yield status, identifier
continue

# Only reach this point if status is Sucess, Warning, Failure
# Only reach this point if status is Success, Warning, Failure
# or Cancel
self._reactor_checkpoint.set()
yield status, identifier
Expand Down Expand Up @@ -2133,7 +2133,7 @@ def _wrap_get_move_responses(
LOGGER.exception(exc)
identifier = None

# Only reach this point if status is Sucess, Warning, Failure
# Only reach this point if status is Success, Warning, Failure
# or Cancel
self._reactor_checkpoint.set()
yield status, identifier
Expand Down
2 changes: 1 addition & 1 deletion pynetdicom/dimse_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def primitive_to_message(self, primitive: DimsePrimitiveType) -> None:
else:
del self.command_set[elem.tag]

# Theres a one-to-one relationship in the _MESSAGE_TYPES dict, so
# There's a one-to-one relationship in the _MESSAGE_TYPES dict, so
# invert it for convenience
rev_type = {vv[0]: kk for kk, vv in _MESSAGE_TYPES.items()}
self.command_set.CommandField = rev_type[cls_type_name]
Expand Down
2 changes: 1 addition & 1 deletion pynetdicom/dul.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def _is_transport_event(self) -> bool:
return True

# By this point the connection should be established
# If theres incoming data on the connection then check the PDU
# If there's incoming data on the connection then check the PDU
# type
# Fix for #28 - caused by peer disconnecting before run loop is
# stopped by assoc.release()
Expand Down
2 changes: 1 addition & 1 deletion pynetdicom/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ def _sop_extended_handler(event: Event) -> Dict[UID, bytes]:


def _user_identity_handler(event: Event) -> Tuple[bool, Optional[bytes]]:
"""Default hander for when a user identity negotiation item is included
"""Default handler for when a user identity negotiation item is included
with the association request.
See _handlers.doc_handler_userid for detailed documentation.
Expand Down
9 changes: 6 additions & 3 deletions pynetdicom/fsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,10 @@ def AA_8(dul: "DULServiceProvider") -> str:


# Finite State Machine
# Machine State Defintions, PS3.8 Tables 9-1, 9-2, 9-3, 9-4, 9-5
# 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",
# Association establishment
"Sta2": "Transport connection open (Awaiting A-ASSOCIATE-RQ PDU)",
Expand All @@ -1023,11 +1024,13 @@ def AA_8(dul: "DULServiceProvider") -> str:
"Sta10": "Release collision acceptor side; awaiting A-RELEASE-RP PDU",
"Sta11": "Release collision requestor side; awaiting A-RELEASE-RP PDU",
"Sta12": "Release collision acceptor side; awaiting A-RELEASE response primitive (from local user)",
# Waiting for transport connection close
"Sta13": "Awaiting Transport Connection Close Indication (Association no longer exists)",
}

# State Machine Action Definitions, PS3.8 Tables 9-6, 9-7, 9-8, 9-9
ACTIONS = {
# Association establishment related actions
"AE-1": (
"Issue TRANSPORT CONNECT request primitive to local transport service",
AE_1,
Expand Down Expand Up @@ -1058,7 +1061,7 @@ def AA_8(dul: "DULServiceProvider") -> str:
# Data transfer related actions
"DT-1": ("Send P-DATA-TF PDU", DT_1, "Sta6"),
"DT-2": ("Send P-DATA indication primitive", DT_2, "Sta6"),
# Assocation Release related actions
# Association Release related actions
"AR-1": ("Send A-RELEASE-RQ PDU", AR_1, "Sta7"),
"AR-2": ("Issue A-RELEASE indication primitive", AR_2, "Sta8"),
"AR-3": (
Expand Down Expand Up @@ -1114,7 +1117,7 @@ def AA_8(dul: "DULServiceProvider") -> str:
"Evt3": "A-ASSOCIATE-AC PDU (received on transport connection)",
"Evt4": "A-ASSOCIATE-RJ PDU (received on transport connection)",
"Evt5": "Transport connection indication (local transport service)",
"Evt6": "A-ASSOCIATE-RQ PDU (on tranport connection)",
"Evt6": "A-ASSOCIATE-RQ PDU (on transport connection)",
"Evt7": "A-ASSOCIATE response primitive (accept)",
"Evt8": "A-ASSOCIATE response primitive (reject)",
"Evt9": "P-DATA request primitive",
Expand Down
6 changes: 3 additions & 3 deletions pynetdicom/pdu_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2364,7 +2364,7 @@ def uid_length(self) -> int:
class SOPClassExtendedNegotiationSubItem(PDUItem):
"""A SOP Class Extended Negotiation Sub-item.
A SOP Class Extended Negotation Sub-item allows peer Application Entities
A SOP Class Extended Negotiation Sub-item allows peer Application Entities
to exchange application information defined by specific Service Class
specifications.
Expand Down Expand Up @@ -2565,7 +2565,7 @@ def uid(self) -> Optional[UID]:
return self.sop_class_uid


# Overriden _generate_items, _wrap_generate_items
# Overridden _generate_items, _wrap_generate_items
class SOPClassCommonExtendedNegotiationSubItem(PDUItem):
"""A SOP Class Common Extended Negotiation Sub-item.
Expand Down Expand Up @@ -3356,7 +3356,7 @@ def __str__(self) -> str:


# P-DATA-TF Item
# Overriden item_type
# Overridden item_type
class PresentationDataValueItem(PDUItem):
"""A Presentation Data Value Item.
Expand Down
2 changes: 1 addition & 1 deletion pynetdicom/pdu_primitives.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Implementaion of the service parameter primitives.
Implementation of the service parameter primitives.
"""
import logging
from typing import Optional, List, Any, Union, Tuple, cast, Type
Expand Down
18 changes: 9 additions & 9 deletions pynetdicom/service_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def _c_find_scp(self, req: C_FIND, context: "PresentationContext") -> None:
else:
(rsp_status, dataset) = cast(UserReturnType, result)

# Event hander has aborted or released
# Event handler has aborted or released
if not self.assoc.is_established:
return

Expand Down Expand Up @@ -362,7 +362,7 @@ def _c_find_scp(self, req: C_FIND, context: "PresentationContext") -> None:

self.dimse.send_msg(rsp, cx_id)

# Event hander has aborted or released
# Event handler has aborted or released
if not self.assoc.is_established:
return

Expand Down Expand Up @@ -1422,7 +1422,7 @@ def SCP(self, req: C_ECHO, context: "PresentationContext") -> None:
evt.EVT_C_ECHO,
{"request": req, "context": context.as_tuple},
)
# Event hander has aborted or released
# Event handler has aborted or released
if not self.assoc.is_established:
return

Expand Down Expand Up @@ -1714,7 +1714,7 @@ def _add_failed_instance(ds: Dataset) -> None:
else:
(rsp_status, dataset) = cast(UserReturnType, result)

# Event hander has aborted or released - after any yields
# Event handler has aborted or released - after any yields
if not self.assoc.is_established:
return

Expand Down Expand Up @@ -1927,7 +1927,7 @@ def _add_failed_instance(ds: Dataset) -> None:
rsp.NumberOfCompletedSuboperations = store_results[3]
self.dimse.send_msg(rsp, cx_id)

# Event hander has aborted or released - prevent final message
# Event handler has aborted or released - prevent final message
if not self.assoc.is_established:
return

Expand Down Expand Up @@ -2138,7 +2138,7 @@ def _add_failed_instance(ds: Dataset) -> None:
else:
(rsp_status, dataset) = cast(UserReturnType, result)

# Event hander has aborted or released - during any status yields
# Event handler has aborted or released - during any status yields
if not self.assoc.is_established:
store_assoc.release()
return
Expand Down Expand Up @@ -2335,7 +2335,7 @@ def _add_failed_instance(ds: Dataset) -> None:

store_assoc.release()

# Event hander has aborted or released - after any yields
# Event handler has aborted or released - after any yields
if not self.assoc.is_established:
return

Expand Down Expand Up @@ -2495,7 +2495,7 @@ def SCP(self, req: C_FIND, context: "PresentationContext") -> None:
responses = cast(Iterator[UserReturnType], responses)
(rsp_status, rsp_identifier) = next(responses)
except (StopIteration, TypeError):
# Event hander has aborted or released - before any yields
# Event handler has aborted or released - before any yields
if not self.assoc.is_established:
return

Expand All @@ -2512,7 +2512,7 @@ def SCP(self, req: C_FIND, context: "PresentationContext") -> None:
self.dimse.send_msg(rsp, cx_id)
return

# Event hander has aborted or released
# Event handler has aborted or released
if not self.assoc.is_established:
return

Expand Down

0 comments on commit 142d4e4

Please sign in to comment.