sim-plugin-hfss 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,22 @@
1
+ """Ansys HFSS driver plugin for sim-cli.
2
+
3
+ The package is discovered by sim-cli through entry points. Importing it must
4
+ stay safe on machines without AEDT or PyAEDT; the driver imports PyAEDT lazily
5
+ only when a runtime operation needs it.
6
+ """
7
+ from importlib.resources import files
8
+
9
+ from .driver import HfssDriver
10
+
11
+ skills_dir = files(__name__) / "_skills"
12
+
13
+
14
+ plugin_info = {
15
+ "name": "hfss",
16
+ "summary": "Ansys HFSS 3D driver plugin for sim-cli.",
17
+ "homepage": "https://github.com/svd-ai-lab/sim-plugin-hfss",
18
+ "license_class": "commercial",
19
+ "solver_name": "hfss",
20
+ }
21
+
22
+ __all__ = ["HfssDriver", "skills_dir", "plugin_info"]
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: hfss
3
+ description: "Work with Ansys HFSS 3D through sim-plugin-hfss and PyAEDT. Use when the user asks an agent to inspect, build, edit, run, or debug HFSS 3D models."
4
+ ---
5
+
6
+ # HFSS Skill
7
+
8
+ Use this skill for Ansys HFSS 3D work through `sim-plugin-hfss`.
9
+
10
+ This initial plugin targets HFSS 3D through PyAEDT. It does not yet cover HFSS
11
+ 3D Layout, Maxwell, Icepak, Q3D, Circuit, or generic AEDT workflows.
12
+
13
+ ## Required Protocol
14
+
15
+ 1. Run `sim check hfss` before launching or editing anything.
16
+ 2. If `sim check hfss` reports `not_installed`, stop and ask the user for an
17
+ AEDT installation or `SIM_HFSS_AEDT_ROOT` path. Do not invent install paths.
18
+ 3. Prefer `--ui-mode no_gui` unless the user explicitly needs visual review.
19
+ 4. Before setup, solve, export, or result interpretation, inspect:
20
+
21
+ ```bash
22
+ sim inspect session.summary
23
+ sim inspect hfss.project.identity
24
+ sim inspect hfss.design.summary
25
+ ```
26
+
27
+ 5. Run one bounded PyAEDT snippet at a time.
28
+ 6. Inspect `last.result` and the relevant project/design state after each
29
+ mutation.
30
+ 7. Treat process success as transport success only. Engineering acceptance must
31
+ come from HFSS results, exported data, convergence, S-parameters, fields, or
32
+ another domain-specific criterion requested by the user.
33
+
34
+ ## Common Workflows
35
+
36
+ ### Connect to HFSS
37
+
38
+ ```bash
39
+ sim connect --solver hfss --ui-mode no_gui
40
+ sim inspect session.summary
41
+ sim inspect hfss.project.identity
42
+ sim inspect hfss.design.summary
43
+ ```
44
+
45
+ Use GUI mode only when the user needs to watch AEDT:
46
+
47
+ ```bash
48
+ sim connect --solver hfss --ui-mode gui
49
+ ```
50
+
51
+ ### Run a PyAEDT script
52
+
53
+ Use this for a complete script that constructs or opens an HFSS project:
54
+
55
+ ```bash
56
+ sim lint --solver hfss path/to/script.py
57
+ sim run --solver hfss path/to/script.py
58
+ ```
59
+
60
+ The script runs in the current Python environment. PyAEDT and AEDT must be
61
+ available there.
62
+
63
+ ### Execute a bounded snippet
64
+
65
+ After `sim connect`, snippets can use the live `hfss` object:
66
+
67
+ ```python
68
+ hfss.project_name
69
+ ```
70
+
71
+ Return JSON-serializable data from the last expression when possible:
72
+
73
+ ```python
74
+ {
75
+ "project": hfss.project_name,
76
+ "design": hfss.design_name,
77
+ "setups": list(hfss.setup_names),
78
+ }
79
+ ```
80
+
81
+ ## First-Version Limits
82
+
83
+ - Direct `.aedt` and `.aedtz` solving is not validated yet.
84
+ - Real HFSS release validation is opt-in and must be recorded separately from
85
+ ordinary no-AEDT unit tests.
86
+ - Do not claim solver correctness from plugin unit tests alone.
87
+
88
+ ## Troubleshooting
89
+
90
+ - Driver not discovered: reinstall the plugin in the same environment as
91
+ sim-cli and rerun `sim check hfss`.
92
+ - AEDT not detected: set `SIM_HFSS_AEDT_ROOT` to the directory containing
93
+ an AEDT launcher, or rely on default discovery for common install layouts. A
94
+ permanent global `PATH` change is optional, not required.
95
+ - PyAEDT import error: install `pyaedt>=0.26.3,<1` in the active environment.
96
+ - Script not detected: make sure it constructs HFSS through PyAEDT, for
97
+ example `from ansys.aedt.core.hfss import Hfss` followed by `Hfss(...)`.
@@ -0,0 +1,776 @@
1
+ """Ansys HFSS 3D driver for sim-cli.
2
+
3
+ The driver uses PyAEDT as the runtime control layer but keeps all PyAEDT imports
4
+ lazy. This lets ``sim check hfss`` and protocol tests run on machines that do
5
+ not have AEDT, HFSS, or PyAEDT importable.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import ast
10
+ import glob
11
+ import io
12
+ import json
13
+ import os
14
+ import re
15
+ import shutil
16
+ import sys
17
+ import time
18
+ import traceback
19
+ import uuid
20
+ from contextlib import redirect_stderr, redirect_stdout
21
+ from dataclasses import dataclass
22
+ from datetime import datetime, timezone
23
+ from pathlib import Path
24
+ from typing import Any
25
+
26
+ from sim.driver import ConnectionInfo, Diagnostic, LintResult, RunResult, SolverInstall
27
+ from sim.runner import run_subprocess
28
+
29
+
30
+ _HFSS_IMPORT_TEXT_RE = re.compile(
31
+ r"^\s*(?:"
32
+ r"from\s+ansys\.aedt\.core(?:\.hfss)?\s+import\s+.*\bHfss\b|"
33
+ r"from\s+pyaedt\s+import\s+.*\bHfss\b|"
34
+ r"import\s+pyaedt\b|"
35
+ r"import\s+ansys\.aedt\.core(?:\.hfss)?\b"
36
+ r")",
37
+ re.MULTILINE,
38
+ )
39
+
40
+ _HFSS_CALL_TEXT_RE = re.compile(
41
+ r"\b(?:Hfss|pyaedt\.Hfss|ansys\.aedt\.core\.Hfss)\s*\("
42
+ )
43
+
44
+ _AEDT_ENV_VARS = ("SIM_HFSS_AEDT_ROOT", "SIM_AEDT_ROOT")
45
+ _ANSYSEM_ENV_RE = re.compile(
46
+ r"^(ANSYSEM_ROOT|ANSYSEMSV_ROOT|ANSYSEM_PY_CLIENT_ROOT)(\d{3})$",
47
+ re.IGNORECASE,
48
+ )
49
+ _VERSION_CODE_RE = re.compile(r"v?(\d{3})", re.IGNORECASE)
50
+ _AEDT_EXECUTABLE_NAMES = ("ansysedt.exe", "ansysedt", "ansysedtsv.exe", "ansysedtsv")
51
+ _STUDENT_EXE_NAMES = ("ansysedtsv.exe", "ansysedtsv")
52
+ _DEFAULT_INSTALL_PATTERNS = [
53
+ "C:/Program Files/AnsysEM/v*",
54
+ "C:/Program Files/AnsysEM/v*/Win64",
55
+ "C:/Program Files/ANSYS Inc/v*",
56
+ "C:/Program Files/ANSYS Inc/v*/AnsysEM",
57
+ "C:/Program Files/ANSYS Inc/v*/AnsysEM/Win64",
58
+ "C:/Program Files/ANSYS Inc/ANSYS Student/v*",
59
+ "C:/Program Files/ANSYS Inc/ANSYS Student/v*/AnsysEM",
60
+ "D:/Program Files/AnsysEM/v*",
61
+ "D:/Program Files/AnsysEM/v*/Win64",
62
+ "D:/Program Files/ANSYS Inc/v*",
63
+ "D:/Program Files/ANSYS Inc/v*/AnsysEM",
64
+ "D:/Program Files/ANSYS Inc/v*/AnsysEM/Win64",
65
+ "D:/Program Files/ANSYS Inc/ANSYS Student/v*",
66
+ "D:/Program Files/ANSYS Inc/ANSYS Student/v*/AnsysEM",
67
+ "/opt/ansys_inc/v*",
68
+ "/opt/ansys_inc/v*/AnsysEM",
69
+ "/opt/ansys_inc/v*/AnsysEM/Linux64",
70
+ "/usr/ansys_inc/v*",
71
+ "/usr/ansys_inc/v*/AnsysEM",
72
+ "/usr/ansys_inc/v*/AnsysEM/Linux64",
73
+ "/opt/AnsysEM/v*",
74
+ "/opt/AnsysEM/v*/Linux64",
75
+ ]
76
+
77
+ _NOT_INSTALLED_HINT = (
78
+ "No Ansys Electronics Desktop installation detected on this host. "
79
+ "Set SIM_HFSS_AEDT_ROOT or SIM_AEDT_ROOT to the AEDT root, or expose an "
80
+ "AEDT launcher such as ansysedt or ansysedtsv on PATH."
81
+ )
82
+
83
+
84
+ @dataclass(frozen=True)
85
+ class _PyaedtApi:
86
+ Desktop: Any | None
87
+ Hfss: Any
88
+ version: str | None
89
+
90
+
91
+ def _importlib_version(dist_name: str) -> str | None:
92
+ try:
93
+ from importlib.metadata import version
94
+
95
+ return version(dist_name)
96
+ except Exception:
97
+ return None
98
+
99
+
100
+ def _try_import_pyaedt() -> _PyaedtApi | None:
101
+ """Import PyAEDT lazily, supporting the modern and legacy import paths."""
102
+ try:
103
+ import ansys.aedt.core as core # type: ignore
104
+
105
+ Desktop = getattr(core, "Desktop", None)
106
+ Hfss = getattr(core, "Hfss", None)
107
+ if Hfss is None:
108
+ from ansys.aedt.core.hfss import Hfss as HfssClass # type: ignore
109
+
110
+ Hfss = HfssClass
111
+ return _PyaedtApi(
112
+ Desktop=Desktop,
113
+ Hfss=Hfss,
114
+ version=getattr(core, "__version__", None) or _importlib_version("pyaedt"),
115
+ )
116
+ except Exception:
117
+ pass
118
+
119
+ try:
120
+ import pyaedt # type: ignore
121
+
122
+ return _PyaedtApi(
123
+ Desktop=getattr(pyaedt, "Desktop", None),
124
+ Hfss=getattr(pyaedt, "Hfss"),
125
+ version=getattr(pyaedt, "__version__", None) or _importlib_version("pyaedt"),
126
+ )
127
+ except Exception:
128
+ return None
129
+
130
+
131
+ def _patch_pyaedt_student_startup_check() -> None:
132
+ """Work around PyAEDT 0.26.x parsing ``2025.2SV`` as a float on Windows."""
133
+ try:
134
+ import ansys.aedt.core.desktop as desktop_mod # type: ignore
135
+
136
+ desktop_cls = desktop_mod.Desktop
137
+ original = desktop_cls.check_starting_mode
138
+ if getattr(original, "_sim_hfss_student_suffix_patch", False):
139
+ return
140
+
141
+ def patched_check_starting_mode(self):
142
+ version_id = getattr(self, "aedt_version_id", "")
143
+ if isinstance(version_id, str) and version_id.upper().endswith("SV"):
144
+ trimmed = version_id[:-2]
145
+ try:
146
+ self.aedt_version_id = trimmed
147
+ return original(self)
148
+ finally:
149
+ self.aedt_version_id = version_id
150
+ return original(self)
151
+
152
+ patched_check_starting_mode._sim_hfss_student_suffix_patch = True
153
+ desktop_cls.check_starting_mode = patched_check_starting_mode
154
+ except Exception:
155
+ return
156
+
157
+
158
+ def _read_text(path: Path) -> str | None:
159
+ try:
160
+ return path.read_text(encoding="utf-8")
161
+ except (OSError, UnicodeDecodeError):
162
+ return None
163
+
164
+
165
+ def _has_hfss_signature(text: str) -> bool:
166
+ """Return True when code appears to create or import a PyAEDT HFSS app."""
167
+ if _HFSS_IMPORT_TEXT_RE.search(text) and _HFSS_CALL_TEXT_RE.search(text):
168
+ return True
169
+
170
+ try:
171
+ tree = ast.parse(text)
172
+ except SyntaxError:
173
+ return bool(_HFSS_IMPORT_TEXT_RE.search(text) and "Hfss" in text)
174
+
175
+ hfss_names: set[str] = set()
176
+ module_aliases: set[str] = set()
177
+
178
+ for node in ast.walk(tree):
179
+ if isinstance(node, ast.ImportFrom):
180
+ if node.module in {"ansys.aedt.core", "ansys.aedt.core.hfss", "pyaedt"}:
181
+ for alias in node.names:
182
+ if alias.name == "Hfss":
183
+ hfss_names.add(alias.asname or alias.name)
184
+ elif isinstance(node, ast.Import):
185
+ for alias in node.names:
186
+ if alias.name in {"pyaedt", "ansys.aedt.core", "ansys.aedt.core.hfss"}:
187
+ module_aliases.add(alias.asname or alias.name.split(".")[0])
188
+
189
+ for node in ast.walk(tree):
190
+ if isinstance(node, ast.Call):
191
+ func = node.func
192
+ if isinstance(func, ast.Name) and func.id in hfss_names:
193
+ return True
194
+ if (
195
+ isinstance(func, ast.Attribute)
196
+ and func.attr == "Hfss"
197
+ and isinstance(func.value, ast.Name)
198
+ and func.value.id in module_aliases
199
+ ):
200
+ return True
201
+
202
+ return False
203
+
204
+
205
+ def _version_from_code(code: str | None) -> str | None:
206
+ if not code or not code.isdigit() or len(code) != 3:
207
+ return None
208
+ return f"20{code[:2]}.{code[2]}"
209
+
210
+
211
+ def _code_from_version(version: str | None) -> str | None:
212
+ if not version:
213
+ return None
214
+ m = re.match(r"^20(\d{2})\.(\d+)", version)
215
+ if not m:
216
+ return None
217
+ return f"{m.group(1)}{m.group(2)}"
218
+
219
+
220
+ def _version_from_path(path: Path) -> str:
221
+ for part in [path.name, *[p.name for p in path.parents[:3]]]:
222
+ m = _VERSION_CODE_RE.search(part)
223
+ if m:
224
+ version = _version_from_code(m.group(1))
225
+ if version:
226
+ return version
227
+ m = re.search(r"20(\d{2})[._ -]?R?([12])", part, re.IGNORECASE)
228
+ if m:
229
+ return f"20{m.group(1)}.{m.group(2)}"
230
+ return "unknown"
231
+
232
+
233
+ def _find_aedt_executable(root: Path) -> Path | None:
234
+ if root.is_file() and root.name.lower() in _AEDT_EXECUTABLE_NAMES:
235
+ return root
236
+ dirs = (
237
+ root,
238
+ root / "Win64",
239
+ root / "Linux64",
240
+ root / "AnsysEM",
241
+ root / "AnsysEM" / "Win64",
242
+ root / "AnsysEM" / "Linux64",
243
+ )
244
+ for directory in dirs:
245
+ for name in _AEDT_EXECUTABLE_NAMES:
246
+ candidate = directory / name
247
+ if candidate.is_file():
248
+ return candidate
249
+ return None
250
+
251
+
252
+ def _looks_like_student_install(root: Path, exe: Path) -> bool:
253
+ values = [exe.name, str(root), str(exe)]
254
+ return any("student" in value.lower() for value in values) or exe.name.lower() in _STUDENT_EXE_NAMES
255
+
256
+
257
+ def _install_from_root(
258
+ root: Path,
259
+ source: str,
260
+ version: str | None = None,
261
+ student_version: bool | None = None,
262
+ ) -> SolverInstall | None:
263
+ exe = _find_aedt_executable(root)
264
+ if exe is None:
265
+ return None
266
+ install_root = exe.parent
267
+ detected_version = version or _version_from_path(install_root)
268
+ detected_student = _looks_like_student_install(root, exe)
269
+ is_student = bool(student_version or detected_student)
270
+ return SolverInstall(
271
+ name="hfss",
272
+ version=detected_version,
273
+ path=str(install_root),
274
+ source=source,
275
+ extra={
276
+ "executable": str(exe),
277
+ "aedt_root": str(root),
278
+ "student_version": is_student,
279
+ },
280
+ )
281
+
282
+
283
+ def _candidates_from_env() -> list[SolverInstall]:
284
+ installs: list[SolverInstall] = []
285
+ for var in _AEDT_ENV_VARS:
286
+ value = os.environ.get(var)
287
+ if value:
288
+ install = _install_from_root(Path(value), f"env:{var}")
289
+ if install:
290
+ installs.append(install)
291
+
292
+ for key, value in sorted(os.environ.items()):
293
+ match = _ANSYSEM_ENV_RE.match(key)
294
+ if not match or not value:
295
+ continue
296
+ install = _install_from_root(
297
+ Path(value),
298
+ f"env:{key}",
299
+ version=_version_from_code(match.group(2)),
300
+ student_version=match.group(1).upper() == "ANSYSEMSV_ROOT",
301
+ )
302
+ if install:
303
+ installs.append(install)
304
+ return installs
305
+
306
+
307
+ def _candidates_from_path() -> list[SolverInstall]:
308
+ installs: list[SolverInstall] = []
309
+ for executable in _AEDT_EXECUTABLE_NAMES:
310
+ found = shutil.which(executable)
311
+ if not found:
312
+ continue
313
+ path = Path(found).resolve()
314
+ student_version = _looks_like_student_install(path.parent, path)
315
+ installs.append(
316
+ SolverInstall(
317
+ name="hfss",
318
+ version=_version_from_path(path),
319
+ path=str(path.parent),
320
+ source=f"which:{executable}",
321
+ extra={
322
+ "executable": str(path),
323
+ "aedt_root": str(path.parent),
324
+ "student_version": student_version,
325
+ },
326
+ )
327
+ )
328
+ return installs
329
+
330
+
331
+ def _candidates_from_defaults() -> list[SolverInstall]:
332
+ installs: list[SolverInstall] = []
333
+ for pattern in _DEFAULT_INSTALL_PATTERNS:
334
+ for raw in glob.glob(pattern):
335
+ install = _install_from_root(Path(raw), f"default-path:{raw}")
336
+ if install:
337
+ installs.append(install)
338
+ return installs
339
+
340
+
341
+ _INSTALL_FINDERS = [
342
+ _candidates_from_env,
343
+ _candidates_from_path,
344
+ _candidates_from_defaults,
345
+ ]
346
+
347
+
348
+ def _scan_aedt_installs() -> list[SolverInstall]:
349
+ found: dict[str, SolverInstall] = {}
350
+ for finder in _INSTALL_FINDERS:
351
+ try:
352
+ candidates = finder()
353
+ except Exception:
354
+ continue
355
+ for install in candidates:
356
+ exe = install.extra.get("executable") or install.path
357
+ try:
358
+ key = str(Path(exe).resolve())
359
+ except OSError:
360
+ key = str(exe)
361
+ found.setdefault(key, install)
362
+ return sorted(found.values(), key=_install_sort_key, reverse=True)
363
+
364
+
365
+ def _pyaedt_env_key(install: SolverInstall) -> str | None:
366
+ code = _code_from_version(install.version)
367
+ if not code:
368
+ return None
369
+ if install.extra.get("student_version"):
370
+ return f"ANSYSEMSV_ROOT{code}"
371
+ return f"ANSYSEM_ROOT{code}"
372
+
373
+
374
+ def _prepare_pyaedt_environment(install: SolverInstall | None) -> dict[str, str]:
375
+ """Expose a detected install through the process env shape PyAEDT expects."""
376
+ if install is None:
377
+ return {}
378
+ key = _pyaedt_env_key(install)
379
+ if key is None:
380
+ return {}
381
+ os.environ[key] = install.path
382
+ return {key: install.path}
383
+
384
+
385
+ def _install_sort_key(install: SolverInstall) -> tuple[int, int, str]:
386
+ match = re.match(r"^(\d{4})\.(\d+)$", install.version)
387
+ if match:
388
+ return (1, int(match.group(1)) * 10 + int(match.group(2)), install.path)
389
+ return (0, 0, install.path)
390
+
391
+
392
+ def _short_text(value: object, *, limit: int = 240) -> str:
393
+ text = "" if value is None else str(value)
394
+ text = "".join(ch if 32 <= ord(ch) < 127 else "?" for ch in text)
395
+ return text[:limit]
396
+
397
+
398
+ def _safe_attr(obj: object, name: str, default: object = None) -> object:
399
+ try:
400
+ value = getattr(obj, name)
401
+ return value() if callable(value) and name.startswith("get_") else value
402
+ except Exception:
403
+ return default
404
+
405
+
406
+ def _jsonable(value: object) -> object:
407
+ try:
408
+ json.dumps(value)
409
+ return value
410
+ except TypeError:
411
+ return repr(value)
412
+
413
+
414
+ class HfssDriver:
415
+ """Sim driver for Ansys HFSS 3D through PyAEDT."""
416
+
417
+ def __init__(self) -> None:
418
+ self._hfss: Any | None = None
419
+ self._desktop: Any | None = None
420
+ self._session_id: str | None = None
421
+ self._ui_mode: str | None = None
422
+ self._connected_at: str | None = None
423
+ self._run_count: int = 0
424
+ self._last_run: dict | None = None
425
+ self._pyaedt_version: str | None = None
426
+ self._launch_options: dict[str, object] = {}
427
+
428
+ @property
429
+ def name(self) -> str:
430
+ return "hfss"
431
+
432
+ @property
433
+ def supports_session(self) -> bool:
434
+ return True
435
+
436
+ def detect(self, script: Path) -> bool:
437
+ if script.suffix.lower() != ".py":
438
+ return False
439
+ text = _read_text(script)
440
+ if text is None:
441
+ return False
442
+ return _has_hfss_signature(text)
443
+
444
+ def lint(self, script: Path) -> LintResult:
445
+ diagnostics: list[Diagnostic] = []
446
+ if script.suffix.lower() != ".py":
447
+ return LintResult(
448
+ ok=False,
449
+ diagnostics=[Diagnostic("error", "HFSS v0.1.0 only lints PyAEDT Python scripts")],
450
+ )
451
+
452
+ text = _read_text(script)
453
+ if text is None:
454
+ return LintResult(
455
+ ok=False,
456
+ diagnostics=[Diagnostic("error", f"cannot read file: {script}")],
457
+ )
458
+
459
+ try:
460
+ ast.parse(text)
461
+ except SyntaxError as e:
462
+ diagnostics.append(Diagnostic("error", f"syntax error: {e}", e.lineno))
463
+
464
+ if not _has_hfss_signature(text):
465
+ diagnostics.append(
466
+ Diagnostic(
467
+ "error",
468
+ "no PyAEDT HFSS construction found; expected ansys.aedt.core.hfss.Hfss or Hfss",
469
+ )
470
+ )
471
+
472
+ ok = not any(d.level == "error" for d in diagnostics)
473
+ return LintResult(ok=ok, diagnostics=diagnostics)
474
+
475
+ def detect_installed(self) -> list[SolverInstall]:
476
+ return _scan_aedt_installs()
477
+
478
+ def connect(self) -> ConnectionInfo:
479
+ installs = self.detect_installed()
480
+ if not installs:
481
+ return ConnectionInfo(
482
+ solver=self.name,
483
+ version=None,
484
+ status="not_installed",
485
+ message=_NOT_INSTALLED_HINT,
486
+ )
487
+
488
+ top = installs[0]
489
+ _prepare_pyaedt_environment(top)
490
+ api = _try_import_pyaedt()
491
+ if api is None:
492
+ return ConnectionInfo(
493
+ solver=self.name,
494
+ version=top.version,
495
+ status="error",
496
+ message=(
497
+ f"AEDT {top.version} was found, but PyAEDT is not importable. "
498
+ "Install with: uv pip install 'pyaedt>=0.26.3,<1'."
499
+ ),
500
+ solver_version=top.version,
501
+ )
502
+
503
+ return ConnectionInfo(
504
+ solver=self.name,
505
+ version=top.version,
506
+ status="ok",
507
+ message=f"AEDT {top.version} with PyAEDT {api.version or 'unknown'}",
508
+ solver_version=top.version,
509
+ )
510
+
511
+ def parse_output(self, stdout: str) -> dict:
512
+ if not stdout or not stdout.strip():
513
+ return {}
514
+ for line in reversed(stdout.strip().splitlines()):
515
+ line = line.strip()
516
+ if line.startswith("{") and line.endswith("}"):
517
+ try:
518
+ return json.loads(line)
519
+ except json.JSONDecodeError:
520
+ continue
521
+ return {}
522
+
523
+ def run_file(self, script: Path) -> RunResult:
524
+ if script.suffix.lower() != ".py":
525
+ raise RuntimeError(
526
+ "HFSS v0.1.0 only runs PyAEDT Python scripts. Direct .aedt/.aedtz "
527
+ "solve support is deferred until real HFSS validation is available."
528
+ )
529
+ return run_subprocess([sys.executable, str(script)], script=script, solver=self.name)
530
+
531
+ def launch(
532
+ self,
533
+ *,
534
+ ui_mode: str | None = "no_gui",
535
+ mode: str | None = None,
536
+ version: str | int | float | None = None,
537
+ project: str | None = None,
538
+ design: str | None = None,
539
+ solution_type: str | None = None,
540
+ setup: str | None = None,
541
+ machine: str = "",
542
+ port: int = 0,
543
+ new_desktop: bool = True,
544
+ close_on_exit: bool = False,
545
+ student_version: bool | None = None,
546
+ **kwargs: object,
547
+ ) -> dict:
548
+ installs = self.detect_installed()
549
+ if not installs and not machine:
550
+ return {
551
+ "ok": False,
552
+ "error_code": "SOLVER_NOT_INSTALLED",
553
+ "message": _short_text(_NOT_INSTALLED_HINT),
554
+ }
555
+
556
+ selected_install = installs[0] if installs else None
557
+ prepared_env = _prepare_pyaedt_environment(selected_install)
558
+ api = _try_import_pyaedt()
559
+ if api is None:
560
+ return {
561
+ "ok": False,
562
+ "error_code": "RUN_FAILED",
563
+ "message": "PyAEDT is not importable; install pyaedt>=0.26.3,<1.",
564
+ }
565
+
566
+ normalized_ui = (ui_mode or "no_gui").replace("-", "_").lower()
567
+ if normalized_ui in {"no_gui", "nogui", "headless", "batch"}:
568
+ non_graphical = True
569
+ normalized_ui = "no_gui"
570
+ elif normalized_ui in {"gui", "visible", "desktop"}:
571
+ non_graphical = False
572
+ normalized_ui = "gui"
573
+ else:
574
+ return {
575
+ "ok": False,
576
+ "error_code": "RUN_FAILED",
577
+ "message": f"unsupported HFSS ui_mode: {ui_mode}",
578
+ }
579
+
580
+ if student_version is None:
581
+ student_version = bool(selected_install and selected_install.extra.get("student_version"))
582
+ if student_version:
583
+ _patch_pyaedt_student_startup_check()
584
+
585
+ launch_kwargs = {
586
+ "project": project,
587
+ "design": design,
588
+ "solution_type": solution_type,
589
+ "setup": setup,
590
+ "version": version,
591
+ "non_graphical": non_graphical,
592
+ "new_desktop": new_desktop,
593
+ "close_on_exit": close_on_exit,
594
+ "student_version": student_version,
595
+ "machine": machine,
596
+ "port": port,
597
+ }
598
+ launch_kwargs = {k: v for k, v in launch_kwargs.items() if v not in {None, ""}}
599
+
600
+ try:
601
+ hfss = api.Hfss(**launch_kwargs)
602
+ except Exception as e:
603
+ return {
604
+ "ok": False,
605
+ "error_code": "RUN_FAILED",
606
+ "message": _short_text(f"HFSS launch failed: {type(e).__name__}: {e}"),
607
+ "details": {"traceback": traceback.format_exc(limit=5)},
608
+ }
609
+
610
+ self._hfss = hfss
611
+ self._desktop = getattr(hfss, "desktop_class", None) or getattr(hfss, "desktop", None)
612
+ self._session_id = f"hfss-{uuid.uuid4().hex[:12]}"
613
+ self._ui_mode = normalized_ui
614
+ self._connected_at = datetime.now(timezone.utc).isoformat()
615
+ self._run_count = 0
616
+ self._last_run = None
617
+ self._pyaedt_version = api.version
618
+ self._launch_options = {
619
+ **launch_kwargs,
620
+ "ui_mode": normalized_ui,
621
+ "mode": mode,
622
+ "prepared_env": prepared_env,
623
+ **kwargs,
624
+ }
625
+ return {
626
+ "ok": True,
627
+ "session_id": self._session_id,
628
+ "solver": self.name,
629
+ "ui_mode": normalized_ui,
630
+ "non_graphical": non_graphical,
631
+ "student_version": student_version,
632
+ "pyaedt_version": api.version,
633
+ "launch_options": dict(self._launch_options),
634
+ }
635
+
636
+ def run(self, code: str, label: str = "") -> dict:
637
+ if self._hfss is None:
638
+ return {
639
+ "ok": False,
640
+ "error_code": "SESSION_NOT_FOUND",
641
+ "message": "HFSS session is not launched.",
642
+ }
643
+
644
+ stdout_buf = io.StringIO()
645
+ stderr_buf = io.StringIO()
646
+ start = time.monotonic()
647
+ result: object = None
648
+ ok = True
649
+ error: str | None = None
650
+
651
+ namespace = {
652
+ "hfss": self._hfss,
653
+ "desktop": self._desktop,
654
+ "json": json,
655
+ }
656
+ try:
657
+ with redirect_stdout(stdout_buf), redirect_stderr(stderr_buf):
658
+ result = self._execute_code(code, namespace)
659
+ except Exception as e:
660
+ ok = False
661
+ error = f"{type(e).__name__}: {e}"
662
+ stderr_buf.write(traceback.format_exc(limit=5))
663
+
664
+ duration = round(time.monotonic() - start, 4)
665
+ self._run_count += 1
666
+ payload = {
667
+ "ok": ok,
668
+ "stdout": stdout_buf.getvalue(),
669
+ "stderr": stderr_buf.getvalue(),
670
+ "duration_s": duration,
671
+ "label": label,
672
+ "result": _jsonable(result),
673
+ }
674
+ if not ok:
675
+ payload.update(
676
+ {
677
+ "error_code": "RUN_FAILED",
678
+ "message": _short_text(error),
679
+ }
680
+ )
681
+ self._last_run = payload
682
+ return payload
683
+
684
+ def query(self, name: str) -> dict:
685
+ if name == "session.summary":
686
+ return {
687
+ "ok": True,
688
+ "connected": self._hfss is not None,
689
+ "session_id": self._session_id,
690
+ "solver": self.name,
691
+ "ui_mode": self._ui_mode,
692
+ "run_count": self._run_count,
693
+ "connected_at": self._connected_at,
694
+ "pyaedt_version": self._pyaedt_version,
695
+ }
696
+ if name == "last.result":
697
+ return {"ok": True, "result": self._last_run}
698
+ if self._hfss is None:
699
+ return {
700
+ "ok": False,
701
+ "error_code": "SESSION_NOT_FOUND",
702
+ "message": "HFSS session is not launched.",
703
+ }
704
+ if name == "hfss.project.identity":
705
+ return {"ok": True, **self._project_identity()}
706
+ if name == "hfss.design.summary":
707
+ return {"ok": True, **self._design_summary()}
708
+ return {
709
+ "ok": False,
710
+ "error_code": "RUN_FAILED",
711
+ "message": f"unknown HFSS query: {name}",
712
+ }
713
+
714
+ def disconnect(self) -> dict:
715
+ if self._hfss is None:
716
+ return {"ok": True, "disconnected": True}
717
+
718
+ errors: list[str] = []
719
+ try:
720
+ release = getattr(self._hfss, "release_desktop", None)
721
+ if callable(release):
722
+ release(close_projects=False, close_desktop=True)
723
+ elif self._desktop is not None:
724
+ desktop_release = getattr(self._desktop, "release_desktop", None)
725
+ if callable(desktop_release):
726
+ desktop_release(close_projects=False, close_desktop=True)
727
+ except Exception as e:
728
+ errors.append(f"{type(e).__name__}: {e}")
729
+ finally:
730
+ self._hfss = None
731
+ self._desktop = None
732
+ self._session_id = None
733
+
734
+ if errors:
735
+ return {
736
+ "ok": False,
737
+ "disconnected": True,
738
+ "error_code": "RUN_FAILED",
739
+ "message": _short_text("; ".join(errors)),
740
+ }
741
+ return {"ok": True, "disconnected": True}
742
+
743
+ def _execute_code(self, code: str, namespace: dict[str, object]) -> object:
744
+ tree = ast.parse(code, filename="<hfss-exec>", mode="exec")
745
+ if tree.body and isinstance(tree.body[-1], ast.Expr):
746
+ prefix = ast.Module(body=tree.body[:-1], type_ignores=[])
747
+ ast.fix_missing_locations(prefix)
748
+ exec(compile(prefix, "<hfss-exec>", "exec"), namespace)
749
+ expr = ast.Expression(tree.body[-1].value)
750
+ ast.fix_missing_locations(expr)
751
+ return eval(compile(expr, "<hfss-exec>", "eval"), namespace)
752
+ exec(compile(tree, "<hfss-exec>", "exec"), namespace)
753
+ return namespace.get("result")
754
+
755
+ def _project_identity(self) -> dict:
756
+ hfss = self._hfss
757
+ assert hfss is not None
758
+ return {
759
+ "project_name": _jsonable(_safe_attr(hfss, "project_name")),
760
+ "project_file": _jsonable(_safe_attr(hfss, "project_file")),
761
+ "project_path": _jsonable(_safe_attr(hfss, "project_path")),
762
+ "working_directory": _jsonable(_safe_attr(hfss, "working_directory")),
763
+ "aedt_version_id": _jsonable(_safe_attr(hfss, "aedt_version_id")),
764
+ }
765
+
766
+ def _design_summary(self) -> dict:
767
+ hfss = self._hfss
768
+ assert hfss is not None
769
+ return {
770
+ "design_name": _jsonable(_safe_attr(hfss, "design_name")),
771
+ "design_type": _jsonable(_safe_attr(hfss, "design_type")),
772
+ "solution_type": _jsonable(_safe_attr(hfss, "solution_type")),
773
+ "setup_names": _jsonable(_safe_attr(hfss, "setup_names", [])),
774
+ "excitation_names": _jsonable(_safe_attr(hfss, "excitation_names", [])),
775
+ "valid_design": _jsonable(_safe_attr(hfss, "valid_design")),
776
+ }
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: sim-plugin-hfss
3
+ Version: 0.1.0
4
+ Summary: Ansys HFSS driver for sim-cli, distributed as a plugin
5
+ Project-URL: Homepage, https://github.com/svd-ai-lab/sim-plugin-hfss
6
+ Project-URL: Repository, https://github.com/svd-ai-lab/sim-plugin-hfss
7
+ Project-URL: Issues, https://github.com/svd-ai-lab/sim-plugin-hfss/issues
8
+ Project-URL: Changelog, https://github.com/svd-ai-lab/sim-plugin-hfss/blob/main/CHANGELOG.md
9
+ Author: svd-ai-lab
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ License-File: LICENSE-NOTICE.md
13
+ Keywords: aedt,em,hfss,plugin,pyaedt,pyansys,sim-cli,simulation
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
24
+ Requires-Python: >=3.10
25
+ Requires-Dist: pyaedt<1,>=0.26.3
26
+ Requires-Dist: sim-cli-core>=0.3.4
27
+ Provides-Extra: test
28
+ Requires-Dist: build>=1.0; extra == 'test'
29
+ Requires-Dist: pytest>=8; extra == 'test'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # sim-plugin-hfss
33
+
34
+ Use Codex, Claude Code, or another AI agent to work with
35
+ [Ansys HFSS](https://www.ansys.com/products/electronics/ansys-hfss) 3D
36
+ projects through [sim-cli](https://github.com/svd-ai-lab/sim-cli).
37
+
38
+ `sim-plugin-hfss` is an initial HFSS 3D driver plugin for sim-cli. It uses
39
+ PyAEDT as the Python control layer for Ansys Electronics Desktop (AEDT), keeps
40
+ the driver import-safe on machines without AEDT, and bundles an HFSS agent
41
+ skill so an agent has solver-specific workflow guidance after installation.
42
+
43
+ The HFSS/AEDT application is not bundled. See
44
+ [LICENSE-NOTICE.md](LICENSE-NOTICE.md).
45
+
46
+ ## Current maturity
47
+
48
+ This is an initial alpha release. It has unit coverage, protocol conformance
49
+ coverage, simulated PyAEDT session coverage, packaging checks, and opt-in real
50
+ HFSS smoke coverage for hosts with AEDT available.
51
+
52
+ Use it as an integration starting point, not as proof that a production HFSS
53
+ workflow has been validated end to end.
54
+
55
+ ## Scope
56
+
57
+ Version 0.1.0 targets HFSS 3D through PyAEDT's `ansys.aedt.core.hfss.Hfss`
58
+ interface.
59
+
60
+ Out of scope for this first version:
61
+
62
+ - HFSS 3D Layout
63
+ - Maxwell, Icepak, Q3D, Circuit, or generic AEDT workflows
64
+ - Direct `.aedt` or `.aedtz` batch solve without a PyAEDT script
65
+ - Plugin-index catalogue entry before the package is published and smoke-tested
66
+
67
+ ## What an agent can do with HFSS
68
+
69
+ - Detect PyAEDT Python scripts that instantiate HFSS.
70
+ - Check whether AEDT appears to be installed on the host.
71
+ - Start a PyAEDT-backed HFSS session in graphical or non-graphical mode when
72
+ AEDT is available.
73
+ - Execute bounded Python snippets against the active `hfss` object.
74
+ - Inspect session, project, and design summaries before continuing.
75
+ - Run complete PyAEDT Python scripts through `sim run --solver hfss`.
76
+
77
+ ## Install
78
+
79
+ Install from PyPI:
80
+
81
+ ```bash
82
+ uv pip install "sim-plugin-hfss==0.1.0"
83
+ ```
84
+
85
+ For source testing against the current main branch:
86
+
87
+ ```bash
88
+ uv pip install "git+https://github.com/svd-ai-lab/sim-plugin-hfss.git@main"
89
+ ```
90
+
91
+ After installation, sim-cli should auto-discover the driver and bundled skill:
92
+
93
+ ```bash
94
+ sim check hfss
95
+ sim run --solver hfss path/to/script.py
96
+ ```
97
+
98
+ If `sim check hfss` reports that AEDT itself is unavailable, first confirm the
99
+ Python package installed correctly, then fix the local AEDT installation,
100
+ environment variables, or runtime prerequisites.
101
+
102
+ ## AEDT discovery
103
+
104
+ The driver looks for AEDT using:
105
+
106
+ - `SIM_HFSS_AEDT_ROOT`
107
+ - `SIM_AEDT_ROOT`
108
+ - `ANSYSEM_ROOT*`
109
+ - AEDT launchers such as `ansysedt`, `ansysedt.exe`, or `ansysedtsv.exe` on
110
+ `PATH`
111
+ - conservative default Windows and Linux install roots
112
+
113
+ If AEDT is installed in a nonstandard location, set an explicit root:
114
+
115
+ ```powershell
116
+ $env:SIM_HFSS_AEDT_ROOT = 'C:\path\to\AnsysEM'
117
+ sim check hfss
118
+ ```
119
+
120
+ You do not need to add AEDT to the global system `PATH` when default discovery
121
+ or one of the explicit environment variables works.
122
+
123
+ ## Common agent workflow
124
+
125
+ 1. Run `sim check hfss`.
126
+ 2. Choose GUI mode only when visual review is required; otherwise prefer
127
+ non-graphical mode.
128
+ 3. Connect and inspect the active project/design before mutating anything:
129
+
130
+ ```bash
131
+ sim connect --solver hfss --ui-mode no_gui
132
+ sim inspect session.summary
133
+ sim inspect hfss.project.identity
134
+ sim inspect hfss.design.summary
135
+ ```
136
+
137
+ 4. Run one bounded PyAEDT snippet at a time.
138
+ 5. Inspect `last.result` and design state before solving or exporting.
139
+ 6. Validate engineering results from HFSS artifacts and domain criteria, not
140
+ from process success alone.
141
+
142
+ ## Develop
143
+
144
+ ```bash
145
+ git clone https://github.com/svd-ai-lab/sim-plugin-hfss
146
+ cd sim-plugin-hfss
147
+ uv sync --extra test
148
+ uv run pytest -q
149
+ uv build
150
+ ```
151
+
152
+ The test suite is designed to pass on machines without AEDT/HFSS. Real solver
153
+ smoke testing is opt-in:
154
+
155
+ ```bash
156
+ SIM_HFSS_RUN_INTEGRATION=1 uv run pytest tests/test_hfss_real_smoke.py -q
157
+ ```
158
+
159
+ On PowerShell:
160
+
161
+ ```powershell
162
+ $env:SIM_HFSS_RUN_INTEGRATION = '1'
163
+ uv run pytest tests/test_hfss_real_smoke.py -q
164
+ ```
165
+
166
+ ## License
167
+
168
+ Apache-2.0. See [LICENSE](LICENSE) and [LICENSE-NOTICE.md](LICENSE-NOTICE.md).
@@ -0,0 +1,9 @@
1
+ sim_plugin_hfss/__init__.py,sha256=bDoiNLlNavh4CTUo5xgb66uwfLNTMt6UhYBJDpW_9ME,635
2
+ sim_plugin_hfss/driver.py,sha256=T-krJ1s86QTAaXThGO6lHxACXlOVbJFHa6NBOVRC_Ls,25945
3
+ sim_plugin_hfss/_skills/hfss/SKILL.md,sha256=A4OWy03nwJFIgzkPMsCqf0YQAPNEP_c1gQoV8qQOXMo,2991
4
+ sim_plugin_hfss-0.1.0.dist-info/METADATA,sha256=KNbNVHuhM687s4wpste_hGAX5he8HZC3wwK3sdyoUkw,5407
5
+ sim_plugin_hfss-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
6
+ sim_plugin_hfss-0.1.0.dist-info/entry_points.txt,sha256=bTRUUKueORoCaRY2GdE5GUDRD94gD0i6JLNqVCPMNBo,146
7
+ sim_plugin_hfss-0.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
+ sim_plugin_hfss-0.1.0.dist-info/licenses/LICENSE-NOTICE.md,sha256=9tQWNY5yY7AvIQ0oSQ1owMkMR0bdAzICXS8qgG1-2NU,542
9
+ sim_plugin_hfss-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,8 @@
1
+ [sim.drivers]
2
+ hfss = sim_plugin_hfss:HfssDriver
3
+
4
+ [sim.plugins]
5
+ hfss = sim_plugin_hfss:plugin_info
6
+
7
+ [sim.skills]
8
+ hfss = sim_plugin_hfss:skills_dir
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,14 @@
1
+ # Notice
2
+
3
+ This plugin is licensed under Apache-2.0 (see [LICENSE](LICENSE)).
4
+
5
+ This plugin does not bundle, embed, or redistribute Ansys HFSS, Ansys
6
+ Electronics Desktop, vendor binaries, vendor examples, or vendor license
7
+ files. It is a Python adapter that:
8
+
9
+ - depends on the PyAEDT Python package, and
10
+ - launches or attaches to an AEDT process that the user has installed and
11
+ licensed separately.
12
+
13
+ Users are responsible for satisfying all Ansys software, license, and local
14
+ environment prerequisites before using this plugin to drive HFSS.