Skip to content

Conversation

@momchil-flex
Copy link
Collaborator

@momchil-flex momchil-flex commented Nov 24, 2025

Opening a new PR to pass the linting.

Also piggy-backing a small update to the notebook test script.

Greptile Overview

Greptile Summary

This PR reclassifies simulation divergence from an error state to a completed state, reflecting that diverged simulations still produce usable data and complete execution.

Key Changes

  • Moved diverge and diverged from ERROR_STATES to COMPLETED_STATES in tidy3d/web/api/states.py
  • Updated progress percentage for diverged states from 0% to 100%
  • Added several notebooks to the skip list for testing
  • Updated date comment from "Dec 12 2024" to "Nov 23 2025"

Impact

The reclassification is semantically correct since diverged simulations:

  • Complete execution (fields grow unboundedly but solver finishes)
  • Return data that can be inspected
  • Trigger warnings rather than errors (see tidy3d/web/api/tidy3d_stub.py:221-222)

The change affects display logic in container.py where diverged states will now show as green (completed) instead of red (error).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is well-scoped and semantically correct. Diverged simulations are not errors - they complete execution and return data. The state reclassification correctly reflects this behavior, and display logic properly handles the change.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
tidy3d/web/api/states.py 5/5 Moved diverge and diverged states from ERROR_STATES to COMPLETED_STATES and updated progress percentage to 100%
tests/_test_notebooks/full_test_notebooks.py 5/5 Added notebooks to skip list, updated comment text, and refreshed tested notebook list

Sequence Diagram

sequenceDiagram
    participant User
    participant WebAPI
    participant Container
    participant States
    participant SimData
    
    User->>WebAPI: Submit simulation
    WebAPI->>States: Check state progression
    
    alt Simulation diverges
        States->>States: Set status = "diverged"
        Note over States: Previously in ERROR_STATES<br/>Now in COMPLETED_STATES
        States->>States: Progress = 100%
        States-->>Container: Return status
        Container->>Container: Check status in COMPLETED_STATES
        Container->>User: Display green (completed)
        WebAPI->>SimData: Retrieve data
        SimData->>SimData: diverged=True flag set
        SimData-->>User: Return data with warning
    else Normal completion
        States->>States: Set status = "success"
        States-->>Container: Return status
        Container->>User: Display green (completed)
        WebAPI->>SimData: Retrieve data
        SimData-->>User: Return data
    end
Loading

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reclassifies the "diverge" and "diverged" simulation states from error states to completed states, treating diverged simulations as successfully completed runs rather than errors.

Key Changes

  • Moved "diverge" and "diverged" from ERROR_STATES to COMPLETED_STATES in the state management system
  • Updated progress percentage for diverged states from 0% to 100% to reflect completion
  • Added new notebooks to the exclusion list and updated the notebook inventory comment date

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tidy3d/web/api/states.py Reclassifies "diverge" and "diverged" states from ERROR_STATES to COMPLETED_STATES and updates their progress percentage from 0 to 100
tests/_test_notebooks/full_test_notebooks.py Adds notebooks to skip list, updates comment date, and expands the notebook inventory list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@github-actions
Copy link
Contributor

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/web/api/states.py (100%)

Summary

  • Total: 1 line
  • Missing: 0 lines
  • Coverage: 100%

@momchil-flex momchil-flex added this pull request to the merge queue Nov 25, 2025
@daquinteroflex daquinteroflex removed this pull request from the merge queue due to a manual request Nov 25, 2025
@daquinteroflex daquinteroflex merged commit 6a105b1 into develop Nov 25, 2025
19 checks passed
@daquinteroflex daquinteroflex deleted the chore/diverged_state branch November 25, 2025 21:13
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

Successfully merging this pull request may close these issues.

3 participants