Skip to content

Commit 0b77fff

Browse files
committed
Renames and docstrings
1 parent f263fa4 commit 0b77fff

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

simpeg_drivers/driver.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ def validate_workers(self, workers: list[tuple[str]] | None) -> list[tuple[str]]
193193
@classmethod
194194
def start_dask_run(
195195
cls,
196-
ifile,
196+
json_path: Path,
197197
n_workers: int | None = None,
198198
n_threads: int | None = None,
199199
save_report: bool = True,
200200
):
201201
"""
202202
Sets Dask config settings.
203203
204-
:param ifile: Input file path.
204+
:param json_path: Path to input file (.ui.json) for the application.
205205
:param n_workers: Number of Dask workers.
206206
:param n_threads: Number of threads per Dask worker.
207207
:param save_report: Whether to save a performance report.
@@ -229,18 +229,18 @@ def start_dask_run(
229229
):
230230
# Full run
231231
with (
232-
performance_report(filename=ifile.parent / "dask_profile.html")
232+
performance_report(filename=json_path.parent / "dask_profile.html")
233233
if (save_report and isinstance(context_client, Client))
234234
else contextlib.nullcontext()
235235
):
236-
cls.start(ifile)
236+
cls.start(json_path)
237237
sys.stdout.close()
238238

239239
profiler.disable()
240240

241241
if save_report:
242242
with open(
243-
ifile.parent / "runtime_profile.txt", encoding="utf-8", mode="w"
243+
json_path.parent / "runtime_profile.txt", encoding="utf-8", mode="w"
244244
) as s:
245245
ps = pstats.Stats(profiler, stream=s)
246246
ps.sort_stats("cumulative")

simpeg_drivers/plate_simulation/match/driver.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545

4646
class PlateMatchDriver(BaseDriver):
47-
"""Sets up and manages workers to run all combinations of swepts parameters."""
47+
"""Sets up and manages workers to run all combinations of swept parameters."""
4848

4949
_params_class = PlateMatchOptions
5050

@@ -218,9 +218,9 @@ def run(self):
218218
)
219219

220220
tasks.append(
221-
self.client.submit(process_files_batch, *args)
221+
self.client.submit(batch_files_score, *args)
222222
if self.client
223-
else process_files_batch(*args)
223+
else batch_files_score(*args)
224224
)
225225

226226
# Display progress bar
@@ -312,9 +312,19 @@ def fetch_survey(workspace: Workspace) -> AirborneTEMReceivers | None:
312312
return None
313313

314314

315-
def process_files_batch(
315+
def batch_files_score(
316316
files: Path | list[Path], spatial_projection, time_projection, observed
317-
):
317+
) -> list[float]:
318+
"""
319+
Process a batch of simulation files and compute scores against observed data.
320+
321+
:param files: Simulation file or list of simulation files to process.
322+
:param spatial_projection: Spatial interpolation matrix.
323+
:param time_projection: Time interpolation matrix.
324+
:param observed: Observed data array.
325+
326+
:return: List of scores for each simulation file.
327+
"""
318328
scores = []
319329

320330
if isinstance(files, Path):

0 commit comments

Comments
 (0)