Skip to content

Commit

Permalink
fixed bug in CustomMedium.grids, which was giving incorrect grid bo…
Browse files Browse the repository at this point in the history
…undaries at edges.
  • Loading branch information
tylerflex committed Jul 21, 2023
1 parent b84cb6c commit 170cb35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Properly handle sign flip in `ModeMonitor` outputs with `direction="-"` in adjoint plugin.
- Bug in `CustomMedium.grids`, which was giving incorrect grid boundaries at edges.
- Out of date endpoint in `migrate` option of webapi.

## [2.3.1] - 2023-7-14
Expand Down
2 changes: 1 addition & 1 deletion tidy3d/components/medium.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ def make_bound_coords(coords: np.ndarray, pt_min: float, pt_max: float) -> List[
"""Convert user supplied coords into boundary coords to use in :class:`.Grid`."""

# get coordinates of the bondaries halfway between user-supplied data
coord_bounds = (coords[1:] + coords[:1]) / 2.0
coord_bounds = (coords[1:] + coords[:-1]) / 2.0

# res-set coord boundaries that lie outside geometry bounds to the boundary (0 vol.)
coord_bounds[coord_bounds <= pt_min] = pt_min
Expand Down

0 comments on commit 170cb35

Please sign in to comment.