invrs-opt 0.5.0__py3-none-any.whl → 0.5.2__py3-none-any.whl

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.
invrs_opt/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  Copyright (c) 2023 The INVRS-IO authors.
4
4
  """
5
5
 
6
- __version__ = "v0.5.0"
6
+ __version__ = "v0.5.2"
7
7
  __author__ = "Martin F. Schubert <mfschubert@gmail.com>"
8
8
 
9
9
  from invrs_opt.lbfgsb.lbfgsb import density_lbfgsb as density_lbfgsb
@@ -258,7 +258,7 @@ def transformed_lbfgsb(
258
258
  (
259
259
  latent_params,
260
260
  jax_lbfgsb_state,
261
- ) = jax.pure_callback( # type: ignore[attr-defined]
261
+ ) = jax.pure_callback(
262
262
  _init_pure,
263
263
  _example_state(params, maxcor),
264
264
  initialize_latent_fn(params),
@@ -288,8 +288,8 @@ def transformed_lbfgsb(
288
288
  assert onp.size(value) == 1
289
289
  scipy_lbfgsb_state = ScipyLbfgsbState.from_jax(jax_lbfgsb_state)
290
290
  scipy_lbfgsb_state.update(
291
- grad=onp.asarray(flat_latent_grad, dtype=onp.float64),
292
- value=onp.asarray(value, dtype=onp.float64),
291
+ grad=onp.array(flat_latent_grad, dtype=onp.float64),
292
+ value=onp.array(value, dtype=onp.float64),
293
293
  )
294
294
  flat_latent_params = jnp.asarray(scipy_lbfgsb_state.x)
295
295
  return flat_latent_params, scipy_lbfgsb_state.to_jax()
@@ -304,7 +304,7 @@ def transformed_lbfgsb(
304
304
  (
305
305
  flat_latent_params,
306
306
  jax_lbfgsb_state,
307
- ) = jax.pure_callback( # type: ignore[attr-defined]
307
+ ) = jax.pure_callback(
308
308
  _update_pure,
309
309
  (flat_latent_grad, jax_lbfgsb_state),
310
310
  flat_latent_grad,
@@ -542,19 +542,19 @@ class ScipyLbfgsbState:
542
542
  """Converts a dictionary of jax arrays to a `ScipyLbfgsbState`."""
543
543
  state_dict = copy.deepcopy(state_dict)
544
544
  return ScipyLbfgsbState(
545
- x=onp.asarray(state_dict["x"], dtype=onp.float64),
545
+ x=onp.array(state_dict["x"], dtype=onp.float64),
546
546
  converged=onp.asarray(state_dict["converged"], dtype=bool),
547
547
  _maxcor=int(state_dict["_maxcor"]),
548
548
  _line_search_max_steps=int(state_dict["_line_search_max_steps"]),
549
549
  _ftol=onp.asarray(state_dict["_ftol"], dtype=onp.float64),
550
550
  _gtol=onp.asarray(state_dict["_gtol"], dtype=onp.float64),
551
- _wa=onp.asarray(state_dict["_wa"], onp.float64),
552
- _iwa=onp.asarray(state_dict["_iwa"], dtype=FORTRAN_INT),
551
+ _wa=onp.array(state_dict["_wa"], onp.float64),
552
+ _iwa=onp.array(state_dict["_iwa"], dtype=FORTRAN_INT),
553
553
  _task=_s60_str_from_array(state_dict["_task"]),
554
554
  _csave=_s60_str_from_array(state_dict["_csave"]),
555
- _lsave=onp.asarray(state_dict["_lsave"], dtype=FORTRAN_INT),
556
- _isave=onp.asarray(state_dict["_isave"], dtype=FORTRAN_INT),
557
- _dsave=onp.asarray(state_dict["_dsave"], dtype=onp.float64),
555
+ _lsave=onp.array(state_dict["_lsave"], dtype=FORTRAN_INT),
556
+ _isave=onp.array(state_dict["_isave"], dtype=FORTRAN_INT),
557
+ _dsave=onp.array(state_dict["_dsave"], dtype=onp.float64),
558
558
  _lower_bound=onp.asarray(state_dict["_lower_bound"], dtype=onp.float64),
559
559
  _upper_bound=onp.asarray(state_dict["_upper_bound"], dtype=onp.float64),
560
560
  _bound_type=onp.asarray(state_dict["_bound_type"], dtype=int),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: invrs_opt
3
- Version: 0.5.0
3
+ Version: 0.5.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>
@@ -49,7 +49,7 @@ Requires-Dist: pytest-cov ; extra == 'tests'
49
49
  Requires-Dist: pytest-subtests ; extra == 'tests'
50
50
 
51
51
  # invrs-opt - Optimization algorithms for inverse design
52
- `v0.5.0`
52
+ `v0.5.2`
53
53
 
54
54
  ## Overview
55
55
 
@@ -1,14 +1,14 @@
1
- invrs_opt/__init__.py,sha256=SK2nHKhwT60br9D6W8gfJ5Kj11BR3fIdGAEVAJBgH1I,309
1
+ invrs_opt/__init__.py,sha256=TPyc9kznbXNbM67XmXpnFIGTmGFQmYzPojKRueSZelU,309
2
2
  invrs_opt/base.py,sha256=dSX9QkMPzI8ROxy2cFNmMwk_89eQbk0rw94CzvLPQoY,907
3
3
  invrs_opt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  invrs_opt/experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  invrs_opt/experimental/client.py,sha256=td5o_YqqbcSypDrWCVrHGSoF8UxEdOLtKU0z9Dth9lA,4842
6
6
  invrs_opt/experimental/labels.py,sha256=dQDAMPyFMV6mXnMy295z8Ap205DRdVzysXny_Be8FmY,562
7
7
  invrs_opt/lbfgsb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- invrs_opt/lbfgsb/lbfgsb.py,sha256=59OpEYmGH3ofDv6m8KQQob5mQJei2vTcm1COh7SAbgA,27896
8
+ invrs_opt/lbfgsb/lbfgsb.py,sha256=EKNTDTwEHcO_JeOIckMHVer5hxYcaNuqq9EZgnFnWJk,27820
9
9
  invrs_opt/lbfgsb/transform.py,sha256=a_Saj9Wq4lvqCJBrg5L2Z9DZ2NVs1xqrHLqha90a9Ws,5971
10
- invrs_opt-0.5.0.dist-info/LICENSE,sha256=ty6jHPvpyjHy6dbhnu6aDSY05bbl2jQTjnq9u1sBCfM,1078
11
- invrs_opt-0.5.0.dist-info/METADATA,sha256=kV8T1uAmMnr0IDaNjq1SK8btKa_XlyHjapKOfti_MbY,3326
12
- invrs_opt-0.5.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
13
- invrs_opt-0.5.0.dist-info/top_level.txt,sha256=hOziS2uJ_NgwaW9yhtOfeuYnm1X7vobPBcp_6eVWKfM,10
14
- invrs_opt-0.5.0.dist-info/RECORD,,
10
+ invrs_opt-0.5.2.dist-info/LICENSE,sha256=ty6jHPvpyjHy6dbhnu6aDSY05bbl2jQTjnq9u1sBCfM,1078
11
+ invrs_opt-0.5.2.dist-info/METADATA,sha256=SgIEqMR9ybcipS1NnHi-KSVTSZ3BzWKrv1ctw4jfqcE,3326
12
+ invrs_opt-0.5.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
13
+ invrs_opt-0.5.2.dist-info/top_level.txt,sha256=hOziS2uJ_NgwaW9yhtOfeuYnm1X7vobPBcp_6eVWKfM,10
14
+ invrs_opt-0.5.2.dist-info/RECORD,,