@@ -394,7 +394,7 @@ def __contains__(self, wavelength: ArrayLike) -> bool:
394
394
False
395
395
"""
396
396
397
- decimals = np .finfo (cast (Any , DTYPE_FLOAT_DEFAULT )).precision
397
+ decimals = np .finfo (cast (" Any" , DTYPE_FLOAT_DEFAULT )).precision
398
398
399
399
return bool (
400
400
np .all (
@@ -531,7 +531,7 @@ def range(self, dtype: Type[DTypeFloat] | None = None) -> NDArrayFloat:
531
531
_CACHE_SHAPE_RANGE [hash_key ] = range_
532
532
533
533
if interval_effective != self ._interval :
534
- self ._interval = cast (float , interval_effective )
534
+ self ._interval = cast (" float" , interval_effective )
535
535
runtime_warning (
536
536
f'"{ (start , end , interval )} " shape could not be honoured, '
537
537
f'using "{ self } "!'
@@ -717,7 +717,7 @@ def _on_domain_changed(
717
717
"""Invalidate *sd._shape* when *sd._domain* is changed."""
718
718
719
719
if name == "_domain" :
720
- sd ._shape = None # noqa: SLF001
720
+ sd ._shape = None
721
721
722
722
return value
723
723
@@ -1883,8 +1883,7 @@ def display_labels(self, value: Sequence) -> None:
1883
1883
1884
1884
attest (
1885
1885
is_iterable (value ),
1886
- f'"display_labels" property: "{ value } " is not an "iterable" like '
1887
- f"object!" ,
1886
+ f'"display_labels" property: "{ value } " is not an "iterable" like object!' ,
1888
1887
)
1889
1888
1890
1889
attest (
@@ -1899,7 +1898,7 @@ def display_labels(self, value: Sequence) -> None:
1899
1898
1900
1899
self ._display_labels = [str (label ) for label in value ]
1901
1900
for i , signal in enumerate (self .signals .values ()):
1902
- cast (SpectralDistribution , signal ).display_name = self ._display_labels [i ]
1901
+ cast (" SpectralDistribution" , signal ).display_name = self ._display_labels [i ]
1903
1902
1904
1903
@property
1905
1904
def wavelengths (self ) -> NDArrayFloat :
@@ -2217,7 +2216,7 @@ def interpolate(
2217
2216
"""
2218
2217
2219
2218
for signal in self .signals .values ():
2220
- cast (SpectralDistribution , signal ).interpolate (
2219
+ cast (" SpectralDistribution" , signal ).interpolate (
2221
2220
shape , interpolator , interpolator_kwargs
2222
2221
)
2223
2222
@@ -2303,7 +2302,7 @@ def extrapolate(
2303
2302
"""
2304
2303
2305
2304
for signal in self .signals .values ():
2306
- cast (SpectralDistribution , signal ).extrapolate (
2305
+ cast (" SpectralDistribution" , signal ).extrapolate (
2307
2306
shape , extrapolator , extrapolator_kwargs
2308
2307
)
2309
2308
@@ -2451,7 +2450,7 @@ def align(
2451
2450
"""
2452
2451
2453
2452
for signal in self .signals .values ():
2454
- cast (SpectralDistribution , signal ).align (
2453
+ cast (" SpectralDistribution" , signal ).align (
2455
2454
shape ,
2456
2455
interpolator ,
2457
2456
interpolator_kwargs ,
@@ -2536,7 +2535,7 @@ def trim(self, shape: SpectralShape) -> Self:
2536
2535
"""
2537
2536
2538
2537
for signal in self .signals .values ():
2539
- cast (SpectralDistribution , signal ).trim (shape )
2538
+ cast (" SpectralDistribution" , signal ).trim (shape )
2540
2539
2541
2540
return self
2542
2541
@@ -2585,7 +2584,7 @@ def normalise(self, factor: Real = 1) -> Self:
2585
2584
"""
2586
2585
2587
2586
for signal in self .signals .values ():
2588
- cast (SpectralDistribution , signal ).normalise (factor )
2587
+ cast (" SpectralDistribution" , signal ).normalise (factor )
2589
2588
2590
2589
return self
2591
2590
@@ -2639,7 +2638,7 @@ def to_sds(self) -> List[SpectralDistribution]:
2639
2638
"""
2640
2639
2641
2640
return [
2642
- cast (SpectralDistribution , signal .copy ())
2641
+ cast (" SpectralDistribution" , signal .copy ())
2643
2642
for signal in self .signals .values ()
2644
2643
]
2645
2644
0 commit comments