invrs-opt 0.7.1__tar.gz → 0.7.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/PKG-INFO +2 -2
  2. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/README.md +1 -1
  3. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/pyproject.toml +1 -1
  4. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/__init__.py +1 -1
  5. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/parameterization/gaussian_levelset.py +9 -5
  6. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt.egg-info/PKG-INFO +2 -2
  7. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/LICENSE +0 -0
  8. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/setup.cfg +0 -0
  9. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/experimental/__init__.py +0 -0
  10. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/experimental/client.py +0 -0
  11. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/experimental/labels.py +0 -0
  12. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/optimizers/__init__.py +0 -0
  13. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/optimizers/base.py +0 -0
  14. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/optimizers/lbfgsb.py +0 -0
  15. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/optimizers/wrapped_optax.py +0 -0
  16. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/parameterization/__init__.py +0 -0
  17. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/parameterization/base.py +0 -0
  18. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/parameterization/filter_project.py +0 -0
  19. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/parameterization/pixel.py +0 -0
  20. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/parameterization/transforms.py +0 -0
  21. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt/py.typed +0 -0
  22. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt.egg-info/SOURCES.txt +0 -0
  23. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt.egg-info/dependency_links.txt +0 -0
  24. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt.egg-info/requires.txt +0 -0
  25. {invrs_opt-0.7.1 → invrs_opt-0.7.2}/src/invrs_opt.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: invrs_opt
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Algorithms for inverse design
5
5
  Author-email: "Martin F. Schubert" <mfschubert@gmail.com>
6
6
  Maintainer-email: "Martin F. Schubert" <mfschubert@gmail.com>
@@ -533,7 +533,7 @@ Requires-Dist: mypy; extra == "dev"
533
533
  Requires-Dist: pre-commit; extra == "dev"
534
534
 
535
535
  # invrs-opt - Optimization algorithms for inverse design
536
- `v0.7.1`
536
+ `v0.7.2`
537
537
 
538
538
  ## Overview
539
539
 
@@ -1,5 +1,5 @@
1
1
  # invrs-opt - Optimization algorithms for inverse design
2
- `v0.7.1`
2
+ `v0.7.2`
3
3
 
4
4
  ## Overview
5
5
 
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
 
3
3
  name = "invrs_opt"
4
- version = "v0.7.1"
4
+ version = "v0.7.2"
5
5
  description = "Algorithms for inverse design"
6
6
  keywords = ["topology", "optimization", "jax", "inverse design"]
7
7
  readme = "README.md"
@@ -3,7 +3,7 @@
3
3
  Copyright (c) 2023 The INVRS-IO authors.
4
4
  """
5
5
 
6
- __version__ = "v0.7.1"
6
+ __version__ = "v0.7.2"
7
7
  __author__ = "Martin F. Schubert <mfschubert@gmail.com>"
8
8
 
9
9
  from invrs_opt import parameterization as parameterization
@@ -438,19 +438,23 @@ def _fixed_pixel_constraint(
438
438
  array = _to_array(params, mask_gradient=mask_gradient, pad_pixels=pad_pixels)
439
439
 
440
440
  example_density = params.example_density()
441
- fixed_solid = jnp.zeros(example_density.shape, dtype=bool)
442
- fixed_void = jnp.zeros(example_density.shape, dtype=bool)
441
+ fixed_solid = jnp.zeros(example_density.shape[-2:], dtype=bool)
442
+ fixed_void = jnp.zeros(example_density.shape[-2:], dtype=bool)
443
443
  if example_density.fixed_solid is not None:
444
444
  fixed_solid = jnp.asarray(example_density.fixed_solid)
445
445
  if example_density.fixed_void is not None:
446
446
  fixed_void = jnp.asarray(example_density.fixed_void)
447
447
 
448
- pad_width = ((0, 0),) * (fixed_solid.ndim - 2) + (
448
+ pad_width_solid = ((0, 0),) * (fixed_solid.ndim - 2) + (
449
449
  (pad_pixels, pad_pixels),
450
450
  (pad_pixels, pad_pixels),
451
451
  )
452
- fixed_solid = jnp.pad(fixed_solid, pad_width, mode="edge")
453
- fixed_void = jnp.pad(fixed_void, pad_width, mode="edge")
452
+ pad_width_void = ((0, 0),) * (fixed_void.ndim - 2) + (
453
+ (pad_pixels, pad_pixels),
454
+ (pad_pixels, pad_pixels),
455
+ )
456
+ fixed_solid = jnp.pad(fixed_solid, pad_width_solid, mode="edge")
457
+ fixed_void = jnp.pad(fixed_void, pad_width_void, mode="edge")
454
458
  fixed = fixed_solid | fixed_void
455
459
  target = jnp.where(fixed_solid, 1, 0)
456
460
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: invrs_opt
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Algorithms for inverse design
5
5
  Author-email: "Martin F. Schubert" <mfschubert@gmail.com>
6
6
  Maintainer-email: "Martin F. Schubert" <mfschubert@gmail.com>
@@ -533,7 +533,7 @@ Requires-Dist: mypy; extra == "dev"
533
533
  Requires-Dist: pre-commit; extra == "dev"
534
534
 
535
535
  # invrs-opt - Optimization algorithms for inverse design
536
- `v0.7.1`
536
+ `v0.7.2`
537
537
 
538
538
  ## Overview
539
539
 
File without changes
File without changes