LumAPI 1.1.2__tar.gz → 1.1.3__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.
- lumapi-1.1.3/LumAPI/__init__.py +21 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI/lumapi.py +4 -0
- lumapi-1.1.3/LumAPI/lumapi.pyi +1103 -0
- lumapi-1.1.3/LumAPI/lumgenstubs.py +137 -0
- {lumapi-1.1.2 → lumapi-1.1.3/LumAPI.egg-info}/PKG-INFO +4 -2
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI.egg-info/SOURCES.txt +2 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI.egg-info/entry_points.txt +1 -0
- {lumapi-1.1.2/LumAPI.egg-info → lumapi-1.1.3}/PKG-INFO +4 -2
- {lumapi-1.1.2 → lumapi-1.1.3}/README.md +3 -1
- {lumapi-1.1.2 → lumapi-1.1.3}/pyproject.toml +3 -2
- lumapi-1.1.2/LumAPI/__init__.py +0 -3
- {lumapi-1.1.2 → lumapi-1.1.3}/LICENSE +0 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI/cli.py +0 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI/config.json +0 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI/gui.py +0 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI.egg-info/dependency_links.txt +0 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI.egg-info/requires.txt +0 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/LumAPI.egg-info/top_level.txt +0 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/setup.cfg +0 -0
- {lumapi-1.1.2 → lumapi-1.1.3}/test/test.py +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# LumAPI/__init__.py
|
|
2
|
+
|
|
3
|
+
# 显式导入所有需要对外暴露的类和函数
|
|
4
|
+
from .lumapi import (
|
|
5
|
+
lumapi, lumerical, LumFuncBase,
|
|
6
|
+
FDTD, MODE, DEVICE, INTERCONNECT,
|
|
7
|
+
savemat, loadmat,
|
|
8
|
+
create_cmap, set_colorbar_range,
|
|
9
|
+
Estimate_focal, Kirchhoff,
|
|
10
|
+
RayleighSommerfeld_Scalar, RayleighSommerfeld_Vector, AngularSpectrum_Vector
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
# 定义 import * 时对外暴露的接口白名单(这是静态检查器识别 import * 的关键)
|
|
14
|
+
__all__ = [
|
|
15
|
+
'lumapi', 'lumerical', 'LumFuncBase',
|
|
16
|
+
'FDTD', 'MODE', 'DEVICE', 'INTERCONNECT',
|
|
17
|
+
'savemat', 'loadmat',
|
|
18
|
+
'create_cmap', 'set_colorbar_range',
|
|
19
|
+
'Estimate_focal', 'Kirchhoff',
|
|
20
|
+
'RayleighSommerfeld_Scalar', 'RayleighSommerfeld_Vector', 'AngularSpectrum_Vector'
|
|
21
|
+
]
|
|
@@ -1081,6 +1081,10 @@ class lumerical:
|
|
|
1081
1081
|
except Exception:
|
|
1082
1082
|
self.lumapi = None
|
|
1083
1083
|
|
|
1084
|
+
def __bool__(self):
|
|
1085
|
+
"""判断配置是否成功,允许直接使用 if lumapi: 来判断"""
|
|
1086
|
+
return self.lumapi is not None
|
|
1087
|
+
|
|
1084
1088
|
def _check_config_and_prompt(self):
|
|
1085
1089
|
"""核心逻辑:检查配置状态,若无效则引导用户使用 LumAPI 命令"""
|
|
1086
1090
|
if self.lumapi is None:
|