2626 XYZ_ColourMatchingFunctions ,
2727 LMS_ConeFundamentals ,
2828)
29- from colour .hints import Dict , NDArrayFloat , Optional
29+ from colour .hints import Dict , NDArrayFloat
3030from colour .utilities import as_float_array , tstack
3131
3232from colour_datasets .loaders import AbstractDatasetLoader
@@ -52,7 +52,7 @@ class Specification_Asano2015(
5252 "Specification_Asano2015" ,
5353 ("XYZ_2" , "XYZ_10" , "LMS_2" , "LMS_10" , "parameters" , "others" ),
5454 )
55- ): # noqa: D405,D407,D410,D411
55+ ):
5656 """
5757 Define the *Asano (2015)* specification for an observer.
5858
@@ -74,7 +74,7 @@ class Specification_Asano2015(
7474 References
7575 ----------
7676 :cite:`Asano2015`
77- """
77+ """ # noqa: D405, D407, D410, D411
7878
7979 def __new__ (
8080 cls ,
@@ -83,7 +83,7 @@ def __new__(
8383 LMS_2 : LMS_ConeFundamentals ,
8484 LMS_10 : LMS_ConeFundamentals ,
8585 parameters : NDArrayFloat ,
86- others : Optional [ Dict ] = None ,
86+ others : Dict | None = None ,
8787 ):
8888 """
8989 Return a new instance of the
@@ -122,7 +122,7 @@ class DatasetLoader_Asano2015(AbstractDatasetLoader):
122122 def __init__ (self ) -> None :
123123 super ().__init__ (datasets ()[DatasetLoader_Asano2015 .ID ])
124124
125- def load (self ) -> Dict [str , Specification_Asano2015 ]:
125+ def load (self ) -> Dict [str , Dict [ int , Specification_Asano2015 ] ]:
126126 """
127127 Sync, parse, convert and return the *Asano (2015)*
128128 *Observer Function Database* dataset content.
@@ -145,12 +145,10 @@ def load(self) -> Dict[str, Specification_Asano2015]:
145145
146146 super ().sync ()
147147
148- self ._content = dict (
149- [
150- ("Categorical Observers" , dict ()),
151- ("Colour Normal Observers" , dict ()),
152- ]
153- )
148+ self ._content = {
149+ "Categorical Observers" : {},
150+ "Colour Normal Observers" : {},
151+ }
154152
155153 # Categorical Observers
156154 workbook_path = os .path .join (
@@ -247,7 +245,7 @@ def parse_workbook_Asano2015(
247245
248246 shape = SpectralShape (390 , 780 , 5 )
249247 wavelengths = shape .range ()
250- data : Dict = dict ()
248+ data : Dict = {}
251249
252250 for i , cmfs in enumerate (
253251 [
@@ -276,7 +274,7 @@ def parse_workbook_Asano2015(
276274 observer = k + 1
277275 rgb = tstack ([x [k ], y [k ], z [k ]])
278276 if data .get (observer ) is None :
279- data [observer ] = dict ()
277+ data [observer ] = {}
280278
281279 key = f"{ cmfs [1 ]} _{ degree [0 ]} "
282280 data [observer ][key ] = cmfs [0 ](
@@ -310,7 +308,7 @@ def parse_workbook_Asano2015(
310308 return data
311309
312310
313- _DATASET_LOADER_ASANO2015 : Optional [ DatasetLoader_Asano2015 ] = None
311+ _DATASET_LOADER_ASANO2015 : DatasetLoader_Asano2015 | None = None
314312"""
315313Singleton instance of the *Asano (2015)* *Observer Function Database* dataset
316314loader.
0 commit comments