@@ -46,31 +46,6 @@ def getDataframe() -> pandas.DataFrame:
4646 dataframeTarget = pandas .read_csv (pathFilenameDatabaseAST , index_col = indexColumns )
4747 return dataframeTarget
4848
49- def Z0Z_getToolElements (elementIndex : str , * elements : str , sortOn : str | None = None , deprecated : bool = False , versionMinorMaximum : int | None = None ):
50- """Get elements of class `AST` and its subclasses for tool manufacturing.
51-
52- This is a prototype function that would work for all tool manufacturing.
53-
54- Parameters
55- ----------
56- elementIndex
57- The column name to use as a primary identifier for each element.
58- elements
59- The data elements used to create the tool.
60- sortOn (None)
61- The element to sort on.
62- deprecated (False)
63- If True, include deprecated classes.
64- versionMinorMaximum (None)
65- The maximum version minor to get. If None, get the latest version.
66-
67- Returns
68- -------
69- dictionaryToolElements
70- A list of tuples, The elements of the class, in the order requested.
71- """
72- pass
73-
7449def getElementsTypeAlias (deprecated : bool = False , versionMinorMaximum : int | None = None ) -> dict [str , dict [str , dict [int , list [str ]]]]:
7550 listElementsHARDCODED = ['attribute' , 'TypeAliasSubcategory' , 'attributeVersionMinorMinimum' , 'classAs_astAttribute' ]
7651 listElements = listElementsHARDCODED
@@ -113,7 +88,7 @@ def getElementsTypeAlias(deprecated: bool = False, versionMinorMaximum: int | No
11388 dictionaryAttribute [attribute ] = dictionaryTypeAliasSubcategory
11489 return cast (dict [str , dict [str , dict [int , list [str ]]]], dictionaryAttribute )
11590
116- def getElementsBe (sortOn : str | None = None , deprecated : bool = False , versionMinorMaximum : int | None = None ) -> list [dict [str , Any ]]:
91+ def getElementsBe (deprecated : bool = False , versionMinorMaximum : int | None = None ) -> list [dict [str , Any ]]:
11792 """Get elements of class `AST` and its subclasses for tool manufacturing.
11893
11994 Parameters
@@ -150,19 +125,21 @@ def getElementsBe(sortOn: str | None = None, deprecated: bool = False, versionMi
150125
151126 # Remove duplicate ClassDefIdentifier
152127 # TODO think about how the function knows to remove _these_ duplicates
153- dataframe = dataframe .sort_values (by = 'versionMinor' , inplace = False , ascending = False ).drop_duplicates ('ClassDefIdentifier' ) # type: ignore
128+ dataframe = dataframe .sort_values (by = 'versionMinor' , inplace = False , ascending = False ).drop_duplicates ('ClassDefIdentifier' )
154129
155- if sortOn is not None :
156- # TODO after changing the dataframe storage from csv to something smart, make this check smarter
157- # match str(dataframe[sortOn].dtype):
158- dataframe = dataframe .iloc [dataframe [sortOn ].astype (str ).str .lower ().argsort ()]
130+ # TODO after changing the dataframe storage from csv to something smart, make this check smarter
131+ # match str(dataframe[sortOn].dtype):
132+ dataframe = dataframe .iloc [dataframe ['ClassDefIdentifier' ].astype (str ).str .lower ().argsort ()]
159133
160134 # Select the requested columns, in the specified order
161135 dataframe = dataframe [listElements ]
162136
163- return dataframe .to_dict (orient = 'records' ) # type: ignore
137+ return dataframe .to_dict (orient = 'records' ) # pyright: ignore[reportReturnType]
138+
139+ def getElementsDOT (deprecated : bool = False , versionMinorMaximum : int | None = None ):
140+ pass
164141
165- def getElementsMake (sortOn : str | None = None , deprecated : bool = False , versionMinorMaximum : int | None = None ) -> list [dict [str , Any ]]:
142+ def getElementsMake (deprecated : bool = False , versionMinorMaximum : int | None = None ) -> list [dict [str , Any ]]:
166143 """Get elements of class `AST` and its subclasses for tool manufacturing.
167144
168145 Parameters
@@ -202,12 +179,11 @@ def getElementsMake(sortOn: str | None = None, deprecated: bool = False, version
202179 # TODO think about how the function knows to remove _these_ duplicates
203180 dataframe = dataframe .sort_values (by = 'versionMinor' , inplace = False , ascending = False ).drop_duplicates ('ClassDefIdentifier' )
204181
205- if sortOn is not None :
206- # TODO after changing the dataframe storage from csv to something smart, make this check smarter
207- # match str(dataframe[sortOn].dtype):
208- dataframe = dataframe .iloc [dataframe [sortOn ].astype (str ).str .lower ().argsort ()]
182+ # TODO after changing the dataframe storage from csv to something smart, make this check smarter
183+ # match str(dataframe[sortOn].dtype):
184+ # dataframe = dataframe.iloc[dataframe[sortOn].astype(str).str.lower().argsort()]
209185
210186 # Select the requested columns, in the specified order
211187 dataframe = dataframe [listElements ]
212188
213- return dataframe .to_dict (orient = 'records' ) # type : ignore
189+ return dataframe .to_dict (orient = 'records' ) # pyright : ignore[reportReturnType]
0 commit comments