...
Code Block | ||
---|---|---|
| ||
# AUTO GENERATED ! class <ActorName>Arguments : def __init__(self): self.arg1 = <ToolName>Argument( 'InVar', int, None, IN) self.arg2 = <ToolName>Argument( 'OutVar', double, None, OUT) self.diagnostic_info = <ToolName>DiagnosticInfo() # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class <ToolName>Argument : 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 <ToolName>DiagnosticInfo : def __init__(self): self.status self.message |
...
- OUT arguments - wrapper will update fields of <ActorName>Arguments class
Examples
Assumption
Defining job settings
Example
Code Block | ||
---|---|---|
from my_test.wrapper import my_test_actor
# # # # # JOB SETTINGS # # # # # # #
| ||
Code Block | ||
| ||
job_settings = <ToolName>JobSettings()
#batch job
job_settings.batch_job.queue = 'gw_default"
#debugging
# no debugging for batch jobs
#mpi
job_settings.mpi.nodes = 5
#OpenMP
# it is not OpenMP job
# Sandbox
job_settings.sandbox.lifetime = LIFTIME_WORKFLOW
job_settings.sandbox.clean_up = True
# # # # # CODE ARGUMENTS # # # # # # #
arguments = <ActorName>Arguments()
self.my_in_arg_01.value = 5
self.my_in_arg_02.value = 0.123
self.my_in_core_profiles_01.value = in_cp_obj
self.my_in_core_profiles_02.value = in_cp_metadata #object keeping shot/run/user
# # # # # RUNNING ACTOR # # # # # # #
my_test(code_args = arguments, job_settings = job_settings)
# # # # # RETURN # # # # # # #
ret_eq = arguments.my_out_equilibrium_02.value |
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?
...