gm.get_meep_adjoint_optimizer function
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
The warning points to meep_adjoint_optimization.py at line 148 in the installed gplugins package; the issue does not identify the repository source path or a test. Read the block around that line and check how its center coordinates are passed into the gmeep flow. Reproduce with the supplied waveguide and design region; done means the warning is gone and the design is produced with the intended size.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
/path/to/miniconda3/envs/mp/lib/python3.11/site-packages/gplugins/gmeep/meep_adjoint_optimization.py:148: UserWarning: Setting rectangle_S5_5_LWG_CFal_d89a89d8_2500_2500.centerin um is deprecated and will change to DataBaseUnits in gdsfactory9. Please userectangle_S5_5_LWG_CFal_d89a89d8_2500_2500.dcenterinstead.
To Reproduce
import gdsfactory as gf
import gplugins as gp
import gplugins.gmeep as gm
import numpy as np
import meep as mp
from meep import MaterialGrid, Medium, Vector3, Volume
from meep.adjoint import (
conic_filter,
DesignRegion,
get_conic_radius_from_eta_e,
tanh_projection,
)
#### Demo to reproduce bug
Nx = 50
Ny = 50
c = gf.Component()
wg = c << gf.components.straight(layer=(1,0),width=0.5,length=10)
design_variables = mp.MaterialGrid(mp.Vector3(Nx, Ny), mp.Medium(index=1.444), mp.Medium(index=3.45), grid_type="U_MEAN")
design_region = \
DesignRegion(
design_variables,
volume=Volume(
center=Vector3(),
size=Vector3(5, 5, 0),
),
)
seed = 240
np.random.seed(seed)
x0 = np.random.rand(
Nx * Ny,
)
c.add_port("o1", port=wg.ports["o1"]) # assign ports to component
c.add_port("o2", port=wg.ports["o2"]) # assign ports to component
def J1(o1, o2):
criterion = npa.abs(o2/o1)
return criterion
gm.get_meep_adjoint_optimizer(
c,
J1,
[design_region],
[design_variables],
x0,
resolution=10,
cell_size=(
10,
10,
),
tpml=1.0,
extend_ports_length=0,
port_margin=1,
port_source_name=f"o1",
port_source_offset=-1.5,
port_monitor_offset=-1.5,
distance_source_to_monitors=1,
)
Expected behavior
Warning should not occur and design with a waveguide and design region (properly sized) should be produced.
Suggested fix
Potentially, Change block.center to block.dcenter on line 148 of path/to/site-packages/gplugins/gmeep/meep_adjoint_optimization.py
I haven't updated this as I'm not sure how changes will propagate through the gmeep library, given the new units update.
- Ngôn ngữ chính
- Python
- Star
- 62
- Fork
- 66
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gdsfactory/gplugins
-
RCE via pickle.loads on poisoned modes cache in find_modes_waveguide and find_modes_cross_sectionĐang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
gdsfactory/gplugins#790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
s22 in write_sparameters_grating is a numerical floor, not the fibre-port reflection coefficientĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
gdsfactory/gplugins#777 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bib not properly renderingĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
gdsfactory/gplugins#749 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Pin sax with compatible release ~=0.18.2Có thể đã có người làm @jackgdsf đã nhận 91 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 25/100
gdsfactory/gplugins#738 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 50/100
gdsfactory/gplugins#699 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của gdsfactory/gplugins
Issue tương tự
-
Project submission:Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
slavakurilyak/awesome-ai-agents#845 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởdifficulty:2 enhancement good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
MakazhanAlpamys/Soup#2178 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
scverse/rapids-singlecell#854 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLCó thể đã có người làm @ninglinLiu đã nhận hôm nay. Đang mởarea:frontend backend:slang bug direction:input
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalseCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 13 ngày