Skip to content

Commit

Permalink
Merge pull request #237 from yarikoptic/enh-codespell
Browse files Browse the repository at this point in the history
codespell: config, workflow + typos fixed
  • Loading branch information
CPBridge committed Jun 21, 2023
2 parents 3f194da + c318280 commit 76829e8
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 32 deletions.
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
skip = .git,*.pdf,*.svg,*.ipynb
# te,fo - either abbreviations of variables
ignore-words-list = te,fo
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Finding relevant content in the nested SR content tree:
print(containers)
# Query content of SR document, where content is structured according
# to TID 1500 "Measurment Report"
# to TID 1500 "Measurement Report"
if sr_dataset.ContentTemplateSequence[0].TemplateIdentifier == 'TID1500':
# Determine who made the observations reported in the document
observers = hd.sr.utils.find_content_items(
Expand Down
2 changes: 1 addition & 1 deletion src/highdicom/ann/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class GraphicTypeValues(Enum):
"""

POINT = 'POINT'
"""An individual piont defined by a single coordinate."""
"""An individual point defined by a single coordinate."""

POLYLINE = 'POLYLINE'
"""Connected line segments defined by two or more ordered coordinates.
Expand Down
2 changes: 1 addition & 1 deletion src/highdicom/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def encode_frame(
-------
bytes
Encoded pixel data (potentially compressed in case of encapsulated
format encoding, depending on the transfer snytax)
format encoding, depending on the transfer syntax)
Raises
------
Expand Down
2 changes: 1 addition & 1 deletion src/highdicom/ko/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(
Name of the department of the person or device that creates the
document instance
requested_procedures: Union[Sequence[pydicom.dataset.Dataset], None], optional
Requested procedures that are being fullfilled by creation of the
Requested procedures that are being fulfilled by creation of the
document
transfer_syntax_uid: str, optional
UID of transfer syntax that should be used for encoding of
Expand Down
2 changes: 1 addition & 1 deletion src/highdicom/legacy/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def _convert_legacy_to_enhanced(
# All remaining unassigned attributes will be collected in either the
# UnassignedSharedConvertedAttributesSequence or the
# UnassignedPerFrameConvertedAttributesSequence, depending on whether
# values vary accross frames (original single-frame image instances).
# values vary across frames (original single-frame image instances).
unassigned_shared_ca_item = Dataset()
unassigned_perframe_ca_items = [
Dataset()
Expand Down
2 changes: 1 addition & 1 deletion src/highdicom/pm/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def __init__(
Identifying information for the person who created the content of
this parametric map.
palette_color_lut_transformation: Union[highdicom.PaletteColorLUTTransformation, None], optional
Description of the Palette Color LUT Transformation for tranforming
Description of the Palette Color LUT Transformation for transforming
grayscale into RGB color pixel values
**kwargs: Any, optional
Additional keyword arguments that will be passed to the constructor
Expand Down
2 changes: 1 addition & 1 deletion src/highdicom/pr/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(
label: str
Name used to identify the Graphic Group (maximum 64 characters).
description: Union[str, None], optional
Description of the group (maxiumum 10240 characters).
Description of the group (maximum 10240 characters).
"""
super().__init__()
Expand Down
6 changes: 3 additions & 3 deletions src/highdicom/pr/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def __init__(
device_serial_number: Union[str, None]
Manufacturer's serial number of the device
palette_color_lut_transformation: highdicom.PaletteColorLUTTransformation
Description of the Palette Color LUT Transformation for tranforming
Description of the Palette Color LUT Transformation for transforming
grayscale into RGB color pixel values
content_label: str
A label used to describe the content of this presentation state.
Expand Down Expand Up @@ -419,10 +419,10 @@ def __init__(
Identifying information for the person who created the content of
this presentation state.
modality_lut_transformation: Union[highdicom.ModalityLUTTransformation, None], optional
Description of the Modality LUT Transformation for tranforming modality
Description of the Modality LUT Transformation for transforming modality
dependent into modality independent pixel values
voi_lut_transformations: Union[Sequence[highdicom.pr.SoftcopyVOILUTTransformation], None], optional
Description of the VOI LUT Transformation for tranforming
Description of the VOI LUT Transformation for transforming
modality pixel values into pixel values that are of interest to a
user or an application
icc_profile: Union[bytes, None], optional
Expand Down
14 changes: 7 additions & 7 deletions src/highdicom/seg/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def iterate_indices_by_source_instance(
relabel: bool, optional
If True and ``combine_segments`` is ``True``, the output segment
numbers are relabelled into the range ``0`` to
``len(segment_numbers)`` (inclusive) accoring to the position of
``len(segment_numbers)`` (inclusive) according to the position of
the original segment numbers in ``segment_numbers`` parameter. If
``combine_segments`` is ``False``, this has no effect.
Expand Down Expand Up @@ -690,7 +690,7 @@ def iterate_indices_by_source_frame(
relabel: bool, optional
If True and ``combine_segments`` is ``True``, the output segment
numbers are relabelled into the range ``0`` to
``len(segment_numbers)`` (inclusive) accoring to the position of
``len(segment_numbers)`` (inclusive) according to the position of
the original segment numbers in ``segment_numbers`` parameter. If
``combine_segments`` is ``False``, this has no effect.
Expand Down Expand Up @@ -793,7 +793,7 @@ def iterate_indices_by_dimension_index_values(
relabel: bool, optional
If True and ``combine_segments`` is ``True``, the output segment
numbers are relabelled into the range ``0`` to
``len(segment_numbers)`` (inclusive) accoring to the position of
``len(segment_numbers)`` (inclusive) according to the position of
the original segment numbers in ``segment_numbers`` parameter. If
``combine_segments`` is ``False``, this has no effect.
Expand Down Expand Up @@ -2640,7 +2640,7 @@ def _get_pixels_by_seg_frame(
relabel: bool
If True and ``combine_segments`` is ``True``, the pixel values in
the output array are relabelled into the range ``0`` to
``len(segment_numbers)`` (inclusive) accoring to the position of
``len(segment_numbers)`` (inclusive) according to the position of
the original segment numbers in ``segment_numbers`` parameter. If
``combine_segments`` is ``False``, this has no effect.
rescale_fractional: bool
Expand Down Expand Up @@ -3012,7 +3012,7 @@ def get_pixels_by_source_instance(
relabel: bool, optional
If True and ``combine_segments`` is ``True``, the pixel values in
the output array are relabelled into the range ``0`` to
``len(segment_numbers)`` (inclusive) accoring to the position of
``len(segment_numbers)`` (inclusive) according to the position of
the original segment numbers in ``segment_numbers`` parameter. If
``combine_segments`` is ``False``, this has no effect.
ignore_spatial_locations: bool, optional
Expand Down Expand Up @@ -3231,7 +3231,7 @@ def get_pixels_by_source_frame(
relabel: bool, optional
If True and ``combine_segments`` is ``True``, the pixel values in
the output array are relabelled into the range ``0`` to
``len(segment_numbers)`` (inclusive) accoring to the position of
``len(segment_numbers)`` (inclusive) according to the position of
the original segment numbers in ``segment_numbers`` parameter. If
``combine_segments`` is ``False``, this has no effect.
ignore_spatial_locations: bool, optional
Expand Down Expand Up @@ -3496,7 +3496,7 @@ def get_pixels_by_dimension_index_values(
relabel: bool, optional
If True and ``combine_segments`` is ``True``, the pixel values in
the output array are relabelled into the range ``0`` to
``len(segment_numbers)`` (inclusive) accoring to the position of
``len(segment_numbers)`` (inclusive) according to the position of
the original segment numbers in ``segment_numbers`` parameter. If
``combine_segments`` is ``False``, this has no effect.
assert_missing_frames_are_empty: bool, optional
Expand Down
2 changes: 1 addition & 1 deletion src/highdicom/sr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Package for creationg of Structured Report (SR) instances."""
"""Package for creation of Structured Report (SR) instances."""
from highdicom.sr.coding import CodedConcept
from highdicom.sr.content import (
FindingSite,
Expand Down
10 changes: 5 additions & 5 deletions src/highdicom/sr/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def __init__(
performed_procedure_codes: Union[List[highdicom.sr.CodedConcept], None], optional
Codes of the performed procedures that resulted in the SR document
requested_procedures: Union[List[pydicom.dataset.Dataset], None], optional
Requested procedures that are being fullfilled by creation of the
Requested procedures that are being fulfilled by creation of the
SR document
previous_versions: Union[List[pydicom.dataset.Dataset], None], optional
Instances representing previous versions of the SR document
Expand Down Expand Up @@ -356,7 +356,7 @@ class EnhancedSR(_SR):

"""SOP class for an Enhanced Structured Report (SR) document, whose
content may include textual and a minimal amount of coded information,
numeric measurement values, references to SOP Instances (retricted to the
numeric measurement values, references to SOP Instances (restricted to the
leaves of the tree), as well as 2D spatial or temporal regions of interest
within such SOP Instances.
"""
Expand Down Expand Up @@ -432,7 +432,7 @@ def __init__(
performed_procedure_codes: Union[List[highdicom.sr.CodedConcept], None], optional
Codes of the performed procedures that resulted in the SR document
requested_procedures: Union[List[pydicom.dataset.Dataset], None], optional
Requested procedures that are being fullfilled by creation of the
Requested procedures that are being fulfilled by creation of the
SR document
previous_versions: Union[List[pydicom.dataset.Dataset], None], optional
Instances representing previous versions of the SR document
Expand Down Expand Up @@ -563,7 +563,7 @@ def __init__(
performed_procedure_codes: Union[List[highdicom.sr.CodedConcept], None], optional
Codes of the performed procedures that resulted in the SR document
requested_procedures: Union[List[pydicom.dataset.Dataset], None], optional
Requested procedures that are being fullfilled by creation of the
Requested procedures that are being fulfilled by creation of the
SR document
previous_versions: Union[List[pydicom.dataset.Dataset], None], optional
Instances representing previous versions of the SR document
Expand Down Expand Up @@ -725,7 +725,7 @@ def __init__(
performed_procedure_codes: Union[List[highdicom.sr.CodedConcept], None], optional
Codes of the performed procedures that resulted in the SR document
requested_procedures: Union[List[pydicom.dataset.Dataset], None], optional
Requested procedures that are being fullfilled by creation of the
Requested procedures that are being fulfilled by creation of the
SR document
previous_versions: Union[List[pydicom.dataset.Dataset], None], optional
Instances representing previous versions of the SR document
Expand Down
4 changes: 2 additions & 2 deletions src/highdicom/sr/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,7 @@ def __init__(
"General Region of Interest Measurement Modifiers"
for options)
finding_sites: Union[Sequence[highdicom.sr.FindingSite], None], optional
Coded description of one or more anatomic locations corresonding
Coded description of one or more anatomic locations corresponding
to the image region from which measurement was taken
method: Union[highdicom.sr.CodedConcept, pydicom.sr.coding.Code, None], optional
Measurement method (see
Expand Down Expand Up @@ -3274,7 +3274,7 @@ def __init__(
algorithm_id: Union[highdicom.sr.AlgorithmIdentification, None], optional
Identification of algorithm used for making measurements
finding_sites: Union[Sequence[highdicom.sr.FindingSite], None], optional
Coded description of one or more anatomic locations corresonding
Coded description of one or more anatomic locations corresponding
to the image region from which measurement was taken
session: Union[str, None], optional
Description of the session
Expand Down
6 changes: 3 additions & 3 deletions src/highdicom/sr/value_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ def __init__(
Number of frame(s) to which the reference applies in case of a
multi-frame image
referenced_segment_numbers: Union[int, Sequence[int], None], optional
Number of segment(s) to which the refernce applies in case of a
Number of segment(s) to which the reference applies in case of a
segmentation image
relationship_type: Union[highdicom.sr.RelationshipTypeValues, str, None], optional
Type of relationship with parent content item
Expand Down Expand Up @@ -1702,7 +1702,7 @@ class Scoord3DContentItem(ContentItem):
Note
----
Spatial coordinates are defined in the patient or specimen-based coordinate
system and have milimeter unit.
system and have millimeter unit.
"""

Expand Down Expand Up @@ -1955,7 +1955,7 @@ def __init__(
referenced_waveform_channels: Union[Sequence[Tuple[int, int]], None], optional
Pairs of waveform number (number of item in the Waveform Sequence)
and channel definition number (number of item in the Channel
Defition Sequence) to which the reference applies in case of a
Definition Sequence) to which the reference applies in case of a
multi-channel waveform
relationship_type: Union[highdicom.sr.RelationshipTypeValues, str, None], optional
Type of relationship with parent content item
Expand Down
4 changes: 2 additions & 2 deletions src/highdicom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def compute_plane_position_tiled_full(
Returns
-------
highdicom.PlanePositionSequence
Positon of the plane in the slide coordinate system
Position, of the plane in the slide coordinate system
Raises
------
Expand Down Expand Up @@ -262,7 +262,7 @@ def _compute_plane_position_tiled_full_efficiently(
Returns
-------
highdicom.PlanePositionSequence
Positon of the plane in the slide coordinate system
Position, of the plane in the slide coordinate system
"""
row_offset_frame = ((row_index - 1) * rows)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ko.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def test_construction(self):
container = content[0]
assert isinstance(container, ContainerContentItem)
assert container.ContentTemplateSequence[0].TemplateIdentifier == '2010'
# Oberver Context (Person): 2
# Oberver Context (Device): 3
# Observer Context (Person): 2
# Observer Context (Device): 3
# Description: 1
# Referenced Objects: 4
assert len(container.ContentSequence) == 10
Expand Down

0 comments on commit 76829e8

Please sign in to comment.