chore: improve error message for tidy3d-extras #2879
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greptile Overview
Updated On: 2025-10-08 19:17:32 UTC
Summary
This PR improves the error message displayed when the 'tidy3d-extras' package fails to initialize, typically due to authentication issues with an invalid API key. The change is focused on enhancing user experience by providing clear, actionable guidance.The modification occurs in the
packaging.py
file within thesupports_local_subpixel
decorator context. When the extras package cannot be properly initialized, users previously received a generic error message indicating an API key issue but no clear resolution path. The enhanced error message now explicitly tells users they can suppress the error by settingconfig.use_local_subpixel=False
, which allows them to continue using the main tidy3d functionality without the extras features.This change fits naturally into the existing error handling infrastructure and maintains the same control flow - it simply extends the existing
Tidy3dImportError
with more helpful guidance. The improvement addresses a common user pain point where authentication failures would block usage even when the extras functionality wasn't strictly needed.Important Files Changed
Changed Files
Confidence score: 5/5
Sequence Diagram