GeoEco.Metadata.CopyResultMetadata

GeoEco.Metadata.CopyResultMetadata(fromMethod, fromResultName, toMethod, toResultName, fromClass=None, fromModule=None, toClass=None, toModule=None)

Copies the ResultMetadata for a specified return value from one methods’s MethodMetadata to another’s.

Use this function to duplicate a ResultMetadata when two classes have an identical or very similar return value. If they are not exactly the same, you can modify the second methods’s ResultMetadata for the return value after it has been copied.

Parameters:
  • fromMethod (MethodType or str) – The method or name of the method to copy the ResultMetadata from. If the name is given, fromClass must also be given.

  • fromResultName (str) – The name of the return value in fromMethod for which the ResultMetadata should be copied.

  • toMethod (MethodType or str) – The method or name of the method to copy the ResultMetadata to. If the name is given, toClass must also be given.

  • toResultName (str) – The name of the return value in toMethod that should receive the copied ResultMetadata.

  • fromClass (type or str, optional) – The class containing fromMethod, either as the class itself or the unqualified name of the class (without module or package names). Only needed if fromMethod is given as a name rather than the method itself.

  • fromModule (ModuleType or str, optional) – The module that contains fromClass, either as the module object itself or the fully qualified name of the module (a.k.a. dotted module name). If not provided, the caller’s module is used.

  • toClass (type or str, optional) – The class containing toMethod, either as the class itself or the unqualified name of the class (without module or package names). Only needed if toMethod is given as a name rather than the method itself.

  • toModule (ModuleType or str, optional) – The module that contains toClass, either as the module object itself or the fully qualified name of the module (a.k.a. dotted module name). If not provided, the caller’s module is used.

Note

Before calling this function, use AddResultMetadata() to create a ResultMetadata for fromResultName and add it to the MethodMetadata of fromMethod.