Skip to content

Commit

Permalink
Explicitly cast dimensionless quantities as int (#49)
Browse files Browse the repository at this point in the history
* Explicitly cast dimensionless quantities as int

* Version updated from v0.2.0 to v0.2.1
  • Loading branch information
mfschubert authored Nov 2, 2023
1 parent 9424e71 commit eb2a44a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "v0.2.0"
current_version = "v0.2.1"
commit = true
commit_args = "--no-verify"
tag = true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# invrs-gym - A collection of inverse design challenges
`v0.2.0`
`v0.2.1`

## Overview
The `invrs_gym` package is an open-source gym containing a diverse set of photonic design challenges, which are relevant for a wide range of applications such as AR/VR, optical networking, LIDAR, and others.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]

name = "invrs_gym"
version = "v0.2.0"
version = "v0.2.1"
description = "A collection of inverse design challenges"
keywords = ["topology", "optimization", "jax", "inverse design"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/invrs_gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (c) 2023 The INVRS-IO authors.
"""

__version__ = "v0.2.0"
__version__ = "v0.2.1"
__author__ = "Martin F. Schubert <[email protected]>"

from invrs_gym import challenges as challenges
Expand Down
18 changes: 9 additions & 9 deletions src/invrs_gym/challenges/ceviche/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,19 @@ def _make_wdm_spec(
"""

design_extent_i, design_extent_j = design_extent_ij
design_extent_i_nm: int = u.resolve(design_extent_i, 1 * u.nm)
design_extent_j_nm: int = u.resolve(design_extent_j, 1 * u.nm)
design_extent_i_nm: int = int(u.resolve(design_extent_i, 1 * u.nm))
design_extent_j_nm: int = int(u.resolve(design_extent_j, 1 * u.nm))

wg_width_nm: int = u.resolve(WG_WIDTH, 1 * u.nm)
wg_length_nm: int = u.resolve(WG_LENGTH, 1 * u.nm)
wg_width_nm: int = int(u.resolve(WG_WIDTH, 1 * u.nm))
wg_length_nm: int = int(u.resolve(WG_LENGTH, 1 * u.nm))

pad_width_nm: int = u.resolve(PADDING, 1 * u.nm)
pml_width_nm: int = u.resolve(
PML_WIDTH_GRIDPOINTS * intended_sim_resolution, 1 * u.nm
pad_width_nm: int = int(u.resolve(PADDING, 1 * u.nm))
pml_width_nm: int = int(
u.resolve(PML_WIDTH_GRIDPOINTS * intended_sim_resolution, 1 * u.nm)
)

extent_i_nm: int = design_extent_i_nm + 2 * wg_length_nm + 2 * pml_width_nm
extent_j_nm: int = design_extent_j_nm + 2 * pad_width_nm + 2 * pml_width_nm
extent_i_nm: int = int(design_extent_i_nm + 2 * wg_length_nm + 2 * pml_width_nm)
extent_j_nm: int = int(design_extent_j_nm + 2 * pad_width_nm + 2 * pml_width_nm)

return wdm.spec.WdmSpec(
extent_ij=u.Array([extent_i_nm, extent_j_nm], u.nm),
Expand Down

0 comments on commit eb2a44a

Please sign in to comment.