feat(tidy3d): FXC-1539 implement spatially varying heat conductivity#3333
Open
damiano-flex wants to merge 1 commit intodevelopfrom
Open
feat(tidy3d): FXC-1539 implement spatially varying heat conductivity#3333damiano-flex wants to merge 1 commit intodevelopfrom
damiano-flex wants to merge 1 commit intodevelopfrom
Conversation
Contributor
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/components/scene.pyLines 1238-1246 1238 ax=ax,
1239 norm=norm,
1240 )
1241 elif property == "electric_conductivity":
! 1242 Scene._add_cbar(
1243 vmin=property_min,
1244 vmax=property_max,
1245 label=f"Electric conductivity ({CONDUCTIVITY})",
1246 cmap=STRUCTURE_HEAT_COND_CMAP,Lines 1851-1860 1851 cond_list = []
1852 for medium in cond_mediums:
1853 cond = medium.charge.conductivity
1854 if isinstance(cond, SpatialDataArray):
! 1855 cond_list.append(float(np.min(cond.values)))
! 1856 cond_list.append(float(np.max(cond.values)))
1857 else:
1858 cond_list.append(float(cond))
1859
1860 if len(cond_list) == 0:Lines 1966-1974 1966 elif property == "electric_conductivity":
1967 if isinstance(medium.charge, ChargeConductorMedium):
1968 cond = medium.charge.conductivity
1969 if isinstance(cond, SpatialDataArray):
! 1970 return cond
1971 return None
1972
1973 def _plot_spatial_conductivity_on_shape(
1974 self, |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
3d7aca8 to
68ce9a2
Compare
68ce9a2 to
5756c58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Frontend implementation of spatially varying conductivity.
Note
Medium Risk
Expands core simulation/material validation and plotting paths to support non-scalar conductivities; risk is mainly in schema/serialization compatibility and potential plotting regressions (norm/overlays), plus a new unsupported-case guard for semiconductor mixes.
Overview
Adds support for spatially varying thermal conductivity by allowing
SolidMedium/SolidSpec.conductivityto acceptSpatialDataArray(includingfrom_si_unitsscaling) and updating JSON schemas to allow non-numericconductivityvalues.Extends
Scene.plot_structures_propertyto plotheat_conductivity/electric_conductivitywith updated bounds handling for spatial data and an optionalpcolormeshoverlay clipped to each structure; includes tests covering acceptance, unit scaling, overlay rendering, and log-scale norm behavior.Also allows
ChargeConductorMedium.conductivityto be aSpatialDataArray, and adds aHeatChargeSimulationsetup check that rejects spatial conductor conductivity when semiconductor structures are present (with a corresponding test).Written by Cursor Bugbot for commit 5756c58. This will update automatically on new commits. Configure here.