interface.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #
  2. # Copyright 2019 The FATE Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. from federatedml.util.param_extract import ParamExtract
  17. from federatedml.components.components import Components
  18. def get_support_role(module, roles=None, cache=None):
  19. return Components.get(module, cache).get_supported_roles()
  20. def get_module(module, role, cache=None):
  21. return Components.get(module, cache).get_run_obj(role)
  22. def get_module_name(module, role, cache=None):
  23. return Components.get(module, cache).get_run_obj_name(role)
  24. def get_module_param(module, alias, cache=None):
  25. return Components.get(module, cache).get_param_obj(alias)
  26. # this interface only support for dsl v1
  27. def get_not_builtin_types_for_dsl_v1(param):
  28. return ParamExtract().get_not_builtin_types(param)