Hello,
thanks to both of you for your help, I’m planning to use this scala task :). For now, I can’t get the standard output to work in the CARETask. Here is what I have so far, I can’t figure why it’s not working, I don’t get error messages from OpenMole v7.1
Python Script, sumTask.py :
import sys
param1 = float(sys.argv[1])
param2 = float(sys.argv[2])
sumTaskResult = param1 + param2
print("%f" % sumTaskResult ) #I'm currently using this, it's from the Random Forest exemple
# sys.stdout.write(str(sumTaskResult)) #This is the an other way for making a std output with Python
Using the care command :
care -o sumTask.tgz.bin python sumTask.py 5 8
I get the following :
care info: concealed path: $HOME /home/leonard
care info: concealed path: /tmp
care info: revealed path: $PWD /home/leonard/Documents/LIP6/Codes LIP6/openMole
care info: revealed path: /home/leonard/anaconda3/bin/python3.6
care info: ----------------------------------------------------------------------
13.000000
care info: ----------------------------------------------------------------------
care info: Hints:
care info: - search for “conceal” in care -h if the execution didn’t go as expected.
care info: - run ./sumTask.tgz.bin or care -x sumTask.tgz.bin to extract the output archive correctly.
And the OpenMole script, model.oms :
val param1 = Val[Double]
val param2 = Val[Double]
val strResult = Val[String]
val makeAsum =
CARETask("sumTask.tgz.bin", "python sumTask.py ${param1} ${param2}") set (
inputs += (param1, param2),
outputs += (param1, param2, strResult),
stdOut := strResult,
param1 := 5.0,
param2 := 8.0
)
makeAsum hook ToStringHook()
And I have model.oms, sumTask.py and sumTask.tgz.bin in the same folder in openMole.
About the documentation, i will be happy to provide you some MWE with python/cython Tasks.