Fix subgrid arg for CLI

这个提交包含在:
Craig Warren
2023-09-04 11:03:02 +01:00
父节点 ce2ac508a4
当前提交 2e891861a2

查看文件

@@ -262,8 +262,9 @@ class SimulationConfig:
# Add pyopencl available device(s) # Add pyopencl available device(s)
self.devices["devs"] = detect_opencl() self.devices["devs"] = detect_opencl()
self.general["subgrid"] = self.args.subgrid # Subgrids
if self.args.subgrid: try:
self.general["subgrid"] = self.args.subgrid
# Double precision should be used with subgrid for best accuracy # Double precision should be used with subgrid for best accuracy
self.general["precision"] = "double" self.general["precision"] = "double"
if (self.general["subgrid"] and self.general["solver"] == "cuda") or ( if (self.general["subgrid"] and self.general["solver"] == "cuda") or (
@@ -273,6 +274,8 @@ class SimulationConfig:
"You cannot currently use CUDA or OpenCL-based " "solvers with models that contain sub-grids." "You cannot currently use CUDA or OpenCL-based " "solvers with models that contain sub-grids."
) )
raise ValueError raise ValueError
except AttributeError:
self.general["subgrid"] = False
# Scenes parameter may not exist if user enters via CLI # Scenes parameter may not exist if user enters via CLI
try: try: