...
Code Block |
---|
def actor_name(code_args = None, xml_parameters = None, job_settings = None): return None. # no returned values! |
Assumptions:
General:
- Python version 3.6+
- Programming conventions (PEP 8?)
- NO BACKWARD COMPATIBILITY
- Incompatibility with existing Python actors!
- All input arguments (user method arg and info determining how to launch job ) 'structured' within classes
- Classes will be defined for:
- user code arguments - autogenerated
- XML input parameters
- job settings
- The order of arguments will be arbitrary - implemented as arguments list (*args) or keyword arguments list (**kwargs)
- All arguments will be optional. If object of given class will be not provided - default values will be used.
...
- All arguments 'packed' within a class <ActorName>Arguments
- Class will be automatically generated, and copied to a wrapper package
- Order of attributes corresponds to order of user function arguments
- Every attribute is a class ToolNameArgument keeping not only value but also metadata describing argument:
- Name
- Type of value
- Value
- IN or OUT
- Attributes' setters/getters will be overridden - user will set only value of argument
- To reduce complexity visible by user
- To check if arg type is correct
Info | ||
---|---|---|
| ||
All code samples below use |
Code Block | ||
---|---|---|
| ||
# AUTO GENERATED ! class <ActorName>Arguments : def __init__(self): self.arg1 = ToolNameArgument( 'InVar', int, None, IN) self.arg2 = ToolNameArgument( 'OutVar', double, None, OUT) self.diagnostic_info = ToolNameDiagnosticInfo() # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class ToolNameArgument : def __init__(self, name, type, sub_type, intent): self.name = name #'argument name' READ ONLY self.type = type # (INT, DOUBLE, STRING, COMPLEX, IDS) READ ONLY self.sub_type = sub_type #'equilibrium' for IDSes only READ ONLY self.intent = intent # (IN/OUT) READ ONLY self.value = 7. # to be set by user # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class ToolNameDiagnosticInfo : def __init__(self): self.status self.message |
...
- OUT arguments - wrapper will update fields of <ActorName>Arguments class
Open points
...
...
- Only IN and OUT arguments (no INOUT arguments)
- Arrays as an inout of user method- only "dynamic" - i.e. of variable size
- Wrapper results:
- OUT arguments - wrapper will update fields of <ActorName>Arguments class
- INCOMPATIBILITY
- Diagnostic info
- Info returned from user method
- status flag
- user defined message
- 'Q: can it be mandatory in user sbrt?
- Info returned from user method
- Sandbox:
- Do we need this feature?
- Alternative library:
- Do we need this feature?
...