Fix: FEM part lookup (exclude _i.prt), hole_count unit (Constant not mm), add file logging
- solve_simulation.py: FEM finder now excludes idealized parts, falls back to loading .fem - solve_simulation.py: hole_count written as [Constant] not [MilliMeter] in .exp - run_doe.py: dual logging to console + results/doe_run.log
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -644,13 +644,26 @@ def main() -> None:
|
||||
"""Entry point."""
|
||||
args = parse_args()
|
||||
|
||||
# Configure logging
|
||||
# Configure logging — console + file
|
||||
log_level = logging.DEBUG if args.verbose else logging.INFO
|
||||
log_format = "%(asctime)s [%(levelname)-7s] %(name)s: %(message)s"
|
||||
log_datefmt = "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
# Ensure results dir exists for log file
|
||||
results_dir = Path(args.results_dir)
|
||||
results_dir.mkdir(parents=True, exist_ok=True)
|
||||
log_file = results_dir / "doe_run.log"
|
||||
|
||||
logging.basicConfig(
|
||||
level=log_level,
|
||||
format="%(asctime)s [%(levelname)-7s] %(name)s: %(message)s",
|
||||
datefmt="%Y-%m-%d %H:%M:%S",
|
||||
format=log_format,
|
||||
datefmt=log_datefmt,
|
||||
handlers=[
|
||||
logging.StreamHandler(), # console
|
||||
logging.FileHandler(log_file, mode="a", encoding="utf-8"), # file
|
||||
],
|
||||
)
|
||||
logger.info("Log file: %s", log_file.resolve())
|
||||
|
||||
# Run
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user