Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to import gmeep #439

Closed
joreb opened this issue Jul 12, 2024 · 1 comment
Closed

unable to import gmeep #439

joreb opened this issue Jul 12, 2024 · 1 comment

Comments

@joreb
Copy link

joreb commented Jul 12, 2024

Dear Sir ,

I posting this because I am encountering difficulties while attempting to import the gmeep library for a scattering parameter simulation using Gdsfactory and Meep.

I have included the relevant code snippet below:

import gdsfactory as gf
import matplotlib.pyplot as plt
import numpy as np
from autograd import tensor_jacobian_product
from gdsfactory.generic_tech import get_generic_pdk
from meep import MaterialGrid, Medium, Vector3, Volume
from meep.adjoint import (
    DesignRegion,
    get_conic_radius_from_eta_e,
)


import gplugins
import gplugins.gmeep as gm
gf.config.rich_output()
PDK = get_generic_pdk()
PDK.activate()

The issue arises during the import statement: there seems to be a recursive call here.

----> [2] import gplugins.gmeep as gm
---> [18] from gplugins.gmeep.write_sparameters_grating import (
       [19] write_sparameters_grating,
       [20] write_sparameters_grating_batch,
       [21] write_sparameters_grating_mpi,
       [22])

PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'kfactory.kcell.KCell'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.

If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion

I am unable to successfully import the gmeep library. I would greatly appreciate any suggestions or guidance you could offer to resolve this import error.

Thank you for your time and assistance.

@joreb joreb changed the title unable to import gmeep to unable to import gmeep Jul 12, 2024
@joreb joreb closed this as completed Jul 12, 2024
@joreb
Copy link
Author

joreb commented Jul 12, 2024

This is addressed in #437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant