File tree Expand file tree Collapse file tree
src/xarray_data_accessor/data_converters Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22from xarray_data_accessor .data_converters .base import DataConverterBase
33from typing import (
44 Dict ,
5+ List ,
56)
67
78
@@ -83,6 +84,13 @@ def get_functions(
8384 """Returns a dictionary of conversion functions."""
8485 return cls .__conversion_functions
8586
87+ @classmethod
88+ def get_function_provenance (
89+ cls ,
90+ ) -> Dict [str , DataConverterBase ]:
91+ """Returns a dictionary of conversion function provenance."""
92+ return cls .__conversion_function_provenance
93+
8694 @classmethod
8795 def get_converter_classes (
8896 cls ,
@@ -94,15 +102,22 @@ class DataConversionFunctions:
94102 """A class for accessing data conversion functions."""
95103
96104 __data_conversion_factory = DataConversionFactory
105+ __added_functions : List [str ] = []
97106
98107 @classmethod
99108 def get_factory (cls ) -> DataConversionFactory :
100109 """Returns the factory."""
101110 return cls .__data_conversion_factory
102111
112+ @classmethod
113+ def get_function_names (cls ) -> List [str ]:
114+ """Returns a list of the added functions."""
115+ return cls .__added_functions
116+
103117 @classmethod
104118 def add_functions (cls ):
105119 # add the data conversion functions
106120 for name , func in cls .__data_conversion_factory .get_functions ().items ():
107121 if name not in cls .__dict__ .keys ():
108122 setattr (cls , name , func )
123+ cls .__added_functions .append (name )
You can’t perform that action at this time.
0 commit comments