Skip to content

Commit

Permalink
Merge pull request #30 from invrs-io/compile2
Browse files Browse the repository at this point in the history
Fix compile time scope
  • Loading branch information
mfschubert authored Feb 23, 2024
2 parents ceabae5 + d8d0264 commit faa5c1f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 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.6.2"
current_version = "v0.6.3"
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 @@
# totypes - Custom types for topology optimization
`v0.6.2`
`v0.6.3`

## Overview

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 = "totypes"
version = "v0.6.2"
version = "v0.6.3"
description = "Custom datatypes useful in a topology optimization context"
keywords = ["topology", "optimization", "jax", "inverse design"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/totypes/__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.6.2"
__version__ = "v0.6.3"
__author__ = "Martin F. Schubert <[email protected]>"

__all__ = ["json_utils", "symmetry", "types"]
Expand Down
4 changes: 2 additions & 2 deletions src/totypes/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def __post_init__(self) -> None:
)

if self.upper_bound is not None and self.lower_bound is not None:
invalid_bounds = self.lower_bound >= self.upper_bound
is_array = isinstance(invalid_bounds, (jnp.ndarray, onp.ndarray))
with jax.ensure_compile_time_eval():
invalid_bounds = self.lower_bound >= self.upper_bound
is_array = isinstance(invalid_bounds, (jnp.ndarray, onp.ndarray))
if (
is_array
and invalid_bounds.any() # type: ignore[union-attr]
Expand Down

0 comments on commit faa5c1f

Please sign in to comment.