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

Update class config for pydanticv2 #28

Merged
merged 1 commit into from
Jan 19, 2025
Merged

Update class config for pydanticv2 #28

merged 1 commit into from
Jan 19, 2025

Conversation

MatthewMckee4
Copy link
Member

@MatthewMckee4 MatthewMckee4 commented Jan 19, 2025

Summary by Sourcery

Chores:

  • Migrate pydantic.BaseModel config to use ConfigDict.

Copy link
Contributor

sourcery-ai bot commented Jan 19, 2025

Reviewer's Guide by Sourcery

This pull request updates the pydantic configuration for the SimulationSettingsLumericalFdtd class to be compatible with pydantic v2. It replaces the nested Config class with a model_config attribute.

Class diagram showing the updated SimulationSettingsLumericalFdtd configuration

classDiagram
    class SimulationSettingsLumericalFdtd {
        +float background_material_index
        +float port_margin
        +float port_height
        +float port_width
        +float mesh_accuracy
        +float zmargin
        +float ymargin
        +float xmargin
        +float wavelength_start
        +float wavelength_stop
        +float wavelength_points
        +float simulation_time
        +float simulation_temperature
        +float frequency_points_monitor
        +float distance_source_to_monitors
        +float distance_monitors_to_pml
        +dict material_name_to_lumerical
        +ConfigDict model_config
    }
    note for SimulationSettingsLumericalFdtd "Updated to use pydantic v2 ConfigDict
instead of nested Config class"
Loading

File-Level Changes

Change Details Files
Updated pydantic configuration to be compatible with pydantic v2.
  • Removed the nested Config class.
  • Added a model_config attribute with the same configuration.
gdsfactory/generic_tech/simulation_settings.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

@github-actions github-actions bot added the bug Something isn't working label Jan 19, 2025
@joamatab joamatab merged commit a356ddd into main Jan 19, 2025
12 checks passed
@joamatab joamatab deleted the fix-pydantic-config branch January 19, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants