Skip to content

Commit a33adda

Browse files
committed
DOc fixes
1 parent 1919bb6 commit a33adda

15 files changed

Lines changed: 60 additions & 60 deletions

File tree

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import os
1414
import sys
1515
import pkg_resources
16+
import datetime
1617

1718
source_dir = os.path.dirname(__file__)
1819
pkg_dir = os.path.join(source_dir, '..', '..', 'src', 'highdicom')
@@ -21,7 +22,7 @@
2122
# -- Project information -----------------------------------------------------
2223

2324
project = 'highdicom'
24-
copyright = '2020-2022, Herrmann Lab'
25+
copyright = f'2020-{datetime.datetime.now().year}, highdicom contributors'
2526
author = 'Markus D. Herrmann'
2627

2728
# The full version, including alpha/beta/rc tags

src/highdicom/ann/content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def from_dataset(
167167
)
168168
]
169169

170-
return cast(cls, measurements)
170+
return cast(Self, measurements)
171171

172172

173173
class AnnotationGroup(Dataset):
@@ -840,4 +840,4 @@ def from_dataset(
840840
for ds in group.PrimaryAnatomicStructureSequence
841841
]
842842

843-
return cast(cls, group)
843+
return cast(Self, group)

src/highdicom/ann/sop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def from_dataset(
453453
for item in ann.AnnotationGroupSequence
454454
]
455455

456-
return cast(cls, ann)
456+
return cast(Self, ann)
457457

458458

459459
def annread(

src/highdicom/content.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def from_sequence(
148148
else:
149149
algo_id_sequence = sequence
150150
algo_id_sequence.__class__ = cls
151-
return cast(cls, algo_id_sequence)
151+
return cast(Self, algo_id_sequence)
152152

153153
@property
154154
def name(self) -> str:
@@ -402,7 +402,7 @@ def from_sequence(
402402
else:
403403
pixel_measures = sequence
404404
pixel_measures.__class__ = cls
405-
return cast(cls, pixel_measures)
405+
return cast(Self, pixel_measures)
406406

407407
def __eq__(self, other: DataElementSequence) -> bool:
408408
"""Determine whether two sets of pixel measures are the same.
@@ -617,7 +617,7 @@ def from_sequence(
617617
else:
618618
plane_position = sequence
619619
plane_position.__class__ = cls
620-
return cast(cls, plane_position)
620+
return cast(Self, plane_position)
621621

622622

623623
class PlaneOrientationSequence(DataElementSequence):
@@ -754,7 +754,7 @@ def from_sequence(
754754
else:
755755
plane_orientation = sequence
756756
plane_orientation.__class__ = cls
757-
return cast(cls, plane_orientation)
757+
return cast(Self, plane_orientation)
758758

759759

760760
class IssuerOfIdentifier(Dataset):
@@ -852,7 +852,7 @@ def from_dataset(
852852
issuer_of_identifier._issuer_of_identifier = issuer_id
853853
issuer_of_identifier._issuer_of_identifier_type = issuer_type
854854

855-
return cast(cls, issuer_of_identifier)
855+
return cast(Self, issuer_of_identifier)
856856

857857

858858
class SpecimenCollection(ContentSequence):
@@ -2037,7 +2037,7 @@ def from_dataset(
20372037

20382038
dataset_copy = dataset
20392039
dataset_copy.__class__ = cls
2040-
return cast(cls, dataset_copy)
2040+
return cast(Self, dataset_copy)
20412041

20422042
def get_scaled_lut_data(
20432043
self,
@@ -2960,7 +2960,7 @@ def extract_from_dataset(cls, dataset: Dataset, color: str) -> Self:
29602960
setattr(new_ds, kw, getattr(dataset, kw))
29612961

29622962
new_ds.__class__ = cls
2963-
return cast(cls, new_ds)
2963+
return cast(Self, new_ds)
29642964

29652965

29662966
class SegmentedPaletteColorLUT(Dataset):
@@ -3200,7 +3200,7 @@ def extract_from_dataset(cls, dataset: Dataset, color: str) -> Self:
32003200
setattr(new_ds, kw, getattr(dataset, kw))
32013201

32023202
new_ds.__class__ = cls
3203-
return cast(cls, new_ds)
3203+
return cast(Self, new_ds)
32043204

32053205

32063206
class PaletteColorLUTTransformation(Dataset):
@@ -3612,7 +3612,7 @@ def extract_from_dataset(cls, dataset: Dataset) -> Self:
36123612
setattr(new_dataset, data_kw, data)
36133613

36143614
new_dataset.__class__ = cls
3615-
return cast(cls, new_dataset)
3615+
return cast(Self, new_dataset)
36163616

36173617
def apply(
36183618
self,

src/highdicom/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ def from_dataset(
11471147
else:
11481148
im = dataset
11491149
im.__class__ = cls
1150-
im = cast(cls, im)
1150+
im = cast(Self, im)
11511151

11521152
im._build_luts()
11531153
return im

src/highdicom/ko/content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def from_sequence(
177177
)
178178
instance = ContentSequence.from_sequence(sequence, is_root=True)
179179
instance.__class__ = cls
180-
return cast(cls, instance)
180+
return cast(Self, instance)
181181

182182
def get_observer_contexts(
183183
self,

src/highdicom/ko/sop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,4 @@ def from_dataset(cls, dataset: Dataset) -> Self:
230230
sop_instance_uid
231231
)
232232

233-
return cast(cls, sop_instance)
233+
return cast(Self, sop_instance)

src/highdicom/sc/sop.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,7 @@ def from_ref_dataset(
499499
column dimension
500500
laterality: Union[str, highdicom.LateralityValues, None], optional
501501
Laterality of the examined body part
502-
patient_orientation:
503-
Union[Tuple[str, str], Tuple[highdicom.PatientOrientationValuesBiped, highdicom.PatientOrientationValuesBiped], Tuple[highdicom.PatientOrientationValuesQuadruped, highdicom.PatientOrientationValuesQuadruped], None], optional
502+
patient_orientation: Union[Tuple[str, str], Tuple[highdicom.PatientOrientationValuesBiped, highdicom.PatientOrientationValuesBiped], Tuple[highdicom.PatientOrientationValuesQuadruped, highdicom.PatientOrientationValuesQuadruped], None], optional
504503
Orientation of the patient along the row and column axes of the
505504
image (required if `coordinate_system` is ``"PATIENT"``)
506505
anatomical_orientation_type: Union[str, highdicom.AnatomicalOrientationTypeValues, None], optional

src/highdicom/seg/content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def from_dataset(
232232
CodedConcept.from_dataset(ds, copy=False)
233233
for ds in desc.PrimaryAnatomicStructureSequence
234234
]
235-
return cast(cls, desc)
235+
return cast(Self, desc)
236236

237237
@property
238238
def segment_number(self) -> int:

src/highdicom/seg/sop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2855,7 +2855,7 @@ def from_dataset(
28552855

28562856
seg = super().from_dataset(seg, copy=False)
28572857

2858-
return cast(cls, seg)
2858+
return cast(Self, seg)
28592859

28602860
@property
28612861
def segmentation_type(self) -> SegmentationTypeValues:

0 commit comments

Comments
 (0)