重构: 切换存储至SQLite,启用INI配置与API Key校验
This commit is contained in:
@ -5,7 +5,7 @@ from pathlib import Path
|
||||
import plotly.graph_objects as go
|
||||
from jinja2 import Template
|
||||
from plotly.io import to_html
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import yaml
|
||||
|
||||
@ -61,7 +61,7 @@ def mass_balance_report(
|
||||
)
|
||||
|
||||
|
||||
def generate_reports(name: str, processor, config: dict):
|
||||
def generate_reports(name: str, processor, config: dict, output_dir: Path):
|
||||
"""
|
||||
Generates reports, configuration files, and processed output variables for gasflux processing runs.
|
||||
|
||||
@ -69,11 +69,11 @@ def generate_reports(name: str, processor, config: dict):
|
||||
name (str): The name identifier for the current processing run (task_id).
|
||||
processor (object): The processing object containing report data and output variables.
|
||||
config (dict): Configuration dictionary used for processing.
|
||||
output_dir (Path): Output directory path (already includes task_id) from INI configuration.
|
||||
"""
|
||||
output_dir = Path(config["output_dir"]).expanduser()
|
||||
processing_time = datetime.now()
|
||||
# Save directly to outputs/{task_id} directory
|
||||
output_path = output_dir / "outputs" / name
|
||||
processing_time = datetime.now() + timedelta(hours=8) # Beijing time (UTC+8)
|
||||
# Save directly to the output directory (already includes task_id)
|
||||
output_path = output_dir
|
||||
output_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Save reports
|
||||
|
||||
Reference in New Issue
Block a user