@@ -1,5 +1,9 @@ |
package m.cfa.trends; |
|
+import csip.annotations.*; |
+import static csip.annotations.ResourceType.ARCHIVE; |
+import static csip.annotations.ResourceType.OUTPUT; |
+import static csip.annotations.ResourceType.PYTHON3; |
import csip.ModelDataService; |
import csip.api.server.PayloadParameter; |
import csip.api.server.PayloadResults; |
@@ -19,7 +23,9 @@ |
@Description("CSIP end point for trend assessment of time series data") |
@VersionInfo("1.0") |
@Path("m/cfa/trends/1.0") |
-@Resource(file = "/python/trends_WQseries.py", type = FILE, id = "trends_WQseries") |
+@Resource(type = ARCHIVE, file = "/archive/**") |
+// @Resource(type = PYTHON3, file = "/archive/trends_WQseries.py", id = "trends_WQseries") |
+@Resource(type = PYTHON3, file = "/archive/trends.py", id = "trends") |
public class V1_0 extends ModelDataService { |
|
File resultFile = null; |
@@ -33,14 +39,15 @@ |
//String ts_data = inputPayload.getString("ts_data", ""); |
|
//Setup directory/result file |
- File pythonModel = resources().getFile("trends_WQseries"); |
+ //File pythonModel = resources().getFile("trends_WQseries"); |
+ File pythonModel = resources().getFile("trends"); |
resultFile = new File(directory, "trendsResult.csv"); |
|
//Setup inputs to python |
List<String> args = new ArrayList<>(); |
args.add("python"); |
args.add(pythonModel.getAbsolutePath()); |
- args.add(directory); // this dirctory is same to the dirctory in the python file |
+ args.add(directory); |
args.add(resultFile.getAbsolutePath()); |
|
//Call service |
@@ -65,6 +72,6 @@ |
// files (auto added as a download link by csip) |
resultPayload.put(resultFile); |
// values (if you want a simple statistics value, like sens slope, add it this way) |
- resultPayload.put("result_file", resultFile.getName()); |
+ //resultPayload.put("result_file", resultFile.getName()); |
} |
} |