wavesimpro 0.14.1__tar.gz → 0.15.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/PKG-INFO +1 -1
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/pyproject.toml +1 -1
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/__init__.py +1 -1
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/client.py +74 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/execute.py +624 -584
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/simulate.py +14 -2
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro.egg-info/PKG-INFO +1 -1
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/setup.cfg +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/__main__.py +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/binary_utils.py +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/config.py +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/exceptions.py +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/json_helper.py +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/py.typed +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/setup.py +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro/validate.py +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro.egg-info/SOURCES.txt +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro.egg-info/dependency_links.txt +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro.egg-info/requires.txt +0 -0
- {wavesimpro-0.14.1 → wavesimpro-0.15.2}/src/wavesimpro.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "wavesimpro"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.15.2"
|
|
8
8
|
description = "WavesimPro Python API — cloud execution client for the Rayfos simulation platform"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -277,6 +277,80 @@ class RayfosClient:
|
|
|
277
277
|
# PROJECT MANAGEMENT METHODS
|
|
278
278
|
# ========================================================================
|
|
279
279
|
|
|
280
|
+
def preflight_check(
|
|
281
|
+
self,
|
|
282
|
+
domain_um: tuple,
|
|
283
|
+
voxel_um: float,
|
|
284
|
+
boundary_um: float = 0.0,
|
|
285
|
+
periodic: tuple = (False, False, False),
|
|
286
|
+
engine_preference: str = "Any",
|
|
287
|
+
use_gpu: Optional[bool] = None,
|
|
288
|
+
) -> Dict[str, Any]:
|
|
289
|
+
"""
|
|
290
|
+
Ask the server (cloud or machine-service) whether a simulation of the
|
|
291
|
+
given shape will fit on the available compute targets, BEFORE uploading
|
|
292
|
+
any files.
|
|
293
|
+
|
|
294
|
+
This calls POST /api/preflightCheck. The same response shape is returned
|
|
295
|
+
regardless of which server answers (cloud aggregator vs single machine).
|
|
296
|
+
|
|
297
|
+
Args:
|
|
298
|
+
domain_um: (size_x, size_y, size_z) simulation domain extent in μm
|
|
299
|
+
voxel_um: voxel size in μm
|
|
300
|
+
boundary_um: PML / absorbing-boundary thickness in μm
|
|
301
|
+
periodic: (periodic_x, periodic_y, periodic_z) — periodic axes don't get boundary padding
|
|
302
|
+
engine_preference: "Any" | "Python" | "Cpp"
|
|
303
|
+
use_gpu: None (auto), True (require GPU), False (force CPU)
|
|
304
|
+
|
|
305
|
+
Returns:
|
|
306
|
+
PreflightCheckResponse dict with keys:
|
|
307
|
+
- status: "Ok" | "Warning" | "Error"
|
|
308
|
+
- description: human-readable summary
|
|
309
|
+
- estimate: { nx, ny, nz, paddedNx, ..., totalMemoryGB, ... }
|
|
310
|
+
- machines: [{ machineId, gpuMemoryGB, cpuMemoryGB, fitsOnGpu, fitsOnCpu, ... }]
|
|
311
|
+
- recommendedMachineId
|
|
312
|
+
- suggestedAdjustments: [str, ...]
|
|
313
|
+
|
|
314
|
+
The minimal WavesimProperties payload is built here (no primitives, no
|
|
315
|
+
sources) since the estimator only needs domain + voxel + boundary + periodic.
|
|
316
|
+
"""
|
|
317
|
+
size_x, size_y, size_z = domain_um
|
|
318
|
+
periodic_x, periodic_y, periodic_z = periodic
|
|
319
|
+
body = {
|
|
320
|
+
"wavesimProperties": {
|
|
321
|
+
"simulationDomain": {
|
|
322
|
+
"positioningMode": "CenterAndSize",
|
|
323
|
+
"position": {
|
|
324
|
+
"x": {"value": 0.0, "unit": "Micrometers"},
|
|
325
|
+
"y": {"value": 0.0, "unit": "Micrometers"},
|
|
326
|
+
"z": {"value": 0.0, "unit": "Micrometers"},
|
|
327
|
+
},
|
|
328
|
+
"size": {
|
|
329
|
+
"width": {"value": float(size_x), "unit": "Micrometers"},
|
|
330
|
+
"height": {"value": float(size_y), "unit": "Micrometers"},
|
|
331
|
+
"depth": {"value": float(size_z), "unit": "Micrometers"},
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
"voxelSize": {"value": float(voxel_um), "unit": "Micrometers"},
|
|
335
|
+
"boundarySize": {"value": float(boundary_um), "unit": "Micrometers"},
|
|
336
|
+
"periodicX": bool(periodic_x),
|
|
337
|
+
"periodicY": bool(periodic_y),
|
|
338
|
+
"periodicZ": bool(periodic_z),
|
|
339
|
+
},
|
|
340
|
+
"enginePreference": engine_preference,
|
|
341
|
+
"useGpu": use_gpu,
|
|
342
|
+
}
|
|
343
|
+
# Machine service URL takes precedence (local single-machine preflight); else cloud aggregator.
|
|
344
|
+
if self.config.machine_service_url:
|
|
345
|
+
url = self.config.get_machine_service_url("/api/preflightCheck")
|
|
346
|
+
verify = self.config.verify_ssl_machine_service
|
|
347
|
+
else:
|
|
348
|
+
url = self.config.get_api_url("/api/preflightCheck")
|
|
349
|
+
verify = self.config.verify_ssl
|
|
350
|
+
logger.info(f"POST {url} [preflight]")
|
|
351
|
+
response = self.session.post(url, json=body, timeout=self.config.timeout, verify=verify)
|
|
352
|
+
return self._handle_response(response)
|
|
353
|
+
|
|
280
354
|
def get_projects(self) -> List[Dict[str, Any]]:
|
|
281
355
|
"""
|
|
282
356
|
Get all projects for the authenticated user
|