添加一个python目录
This commit is contained in:
parent
b37b982d8e
commit
ca1cd80f97
|
|
@ -9,6 +9,11 @@ import org.springframework.stereotype.Component;
|
|||
@ConfigurationProperties(prefix = "t1h-download")
|
||||
public class T1hDownloadProperties {
|
||||
|
||||
/**
|
||||
* python环境路径
|
||||
*/
|
||||
private String pythonPath;
|
||||
|
||||
/**
|
||||
* 下载T1H的Py脚本路径
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ public class ExecutePyUtils {
|
|||
processWatch.start();
|
||||
Process process = null;
|
||||
try {
|
||||
|
||||
System.out.println("执行命令: " + String.join(" ", processBuilder.command()));
|
||||
System.out.println("工作目录: " + processBuilder.directory());
|
||||
process = processBuilder.start();
|
||||
|
||||
// 异步处理输出流
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class DownloadT1hJob {
|
|||
List<String> forecastTimes = generateForecastTimes();
|
||||
|
||||
ProcessBuilder processBuilder = new ProcessBuilder(
|
||||
systemStorageProperties.getAiModelsPath() + File.separator + "python3 ",
|
||||
t1hDownloadProperties.getPythonPath(),
|
||||
getPythonScriptPath(t1hDownloadProperties.getMergeT1hPy()),
|
||||
"--indir", getFullPath(t1hDownloadProperties.getT1hPath(), baseTime),
|
||||
"--output_dir", getFullPath(systemStorageProperties.getT1h(), baseTime),
|
||||
|
|
@ -94,7 +94,7 @@ public class DownloadT1hJob {
|
|||
"--forecast_times", String.join(",", forecastTimes),
|
||||
"--base_date", baseTime
|
||||
);
|
||||
processBuilder.directory(new File(systemStorageProperties.getRootPath()));
|
||||
|
||||
ExecutePyUtils.executePythonProcess(processBuilder, "文件合并");
|
||||
}
|
||||
|
||||
|
|
@ -127,7 +127,6 @@ public class DownloadT1hJob {
|
|||
log.info("执行Python脚本: {}", Arrays.toString(command));
|
||||
|
||||
ProcessBuilder processBuilder = new ProcessBuilder(command);
|
||||
processBuilder.directory(new File(systemStorageProperties.getRootPath()));
|
||||
ExecutePyUtils.executePythonProcess(processBuilder,
|
||||
String.format("元素%s预报时长%s下载", element, forecastHours));
|
||||
}
|
||||
|
|
@ -137,7 +136,7 @@ public class DownloadT1hJob {
|
|||
*/
|
||||
private String[] buildPythonCommand(String element, String baseTime, String forecastHours) {
|
||||
return new String[]{
|
||||
systemStorageProperties.getAiModelsPath() + File.separator + "python3 ",
|
||||
t1hDownloadProperties.getPythonPath(),
|
||||
getPythonScriptPath(t1hDownloadProperties.getDownloadT1hPy()),
|
||||
"--base-time", baseTime,
|
||||
"--element", element,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user