gm.get_meep_adjoint_optimizer function
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 62
- Forks
- 66
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de gdsfactory/gplugins
-
RCE via pickle.loads on poisoned modes cache in find_modes_waveguide and find_modes_cross_sectionAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
gdsfactory/gplugins#790 ·
Los mantenedores suelen responder en 1 día
-
s22 in write_sparameters_grating is a numerical floor, not the fibre-port reflection coefficientAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
gdsfactory/gplugins#777 ·
Los mantenedores suelen responder en 1 día
-
bib not properly renderingAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
gdsfactory/gplugins#749 ·
Los mantenedores suelen responder en 1 día
-
Pin sax with compatible release ~=0.18.2Posiblemente ocupada @jackgdsf la tomó hace 100 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
gdsfactory/gplugins#738 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 50/100
gdsfactory/gplugins#699 ·
Los mantenedores suelen responder en 1 día
Todos los issues de gdsfactory/gplugins
Issues similares
-
cost:cheap practicality:seen-in-the-wild severity:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
Los mantenedores suelen responder en 1 día
-
area:security effort:S priority:P2 provider:local-libvirt status:ready type:docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
randomparity/kdive#3495 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/markitdown#2820 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días