bs-python-utils 1.1__tar.gz → 1.1.1__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.
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/PKG-INFO +4 -1
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/README.md +3 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/numerical/bsnputils.py +1 -3
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/opt/bs_opt.py +8 -8
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/stats/bivariate_quantiles.py +7 -6
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/stats/bsstats.py +1 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils.egg-info/PKG-INFO +4 -1
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/pyproject.toml +1 -1
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/LICENSE +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid1prec13.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid1prec17.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid1prec9.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid2prec13.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid2prec17.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid2prec9.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid3prec13.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid3prec17.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid3prec9.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid4prec13.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid4prec17.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid4prec9.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid5prec13.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid5prec17.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid5prec9.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/Timer.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/__init__.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bivariate_quantiles.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bs_altair.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bs_logging.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bs_mathstr.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bs_mem.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bs_opt.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bs_plots.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bs_seaborn.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bs_sparse_gaussian.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bsmplutils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bsnputils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bssputils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bsstats.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/bsutils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/chebyshev.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/core/Timer.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/core/__init__.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/core/bs_logging.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/core/bs_mathstr.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/core/bs_mem.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/core/bsutils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/data_anal/__init__.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/data_anal/pandas_utils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/data_anal/sklearn_utils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/distance_covariances.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_altair.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_distance_covariances.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_mem.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_mpl.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_opt.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_seaborn.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_sklearn.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_sparse_gaussian.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/numerical/__init__.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/numerical/bs_sparse_gaussian.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/numerical/bssputils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/numerical/chebyshev.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/opt/__init__.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/pandas_utils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/sklearn_utils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/stats/__init__.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/stats/distance_covariances.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/streamlit_utils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/viz/__init__.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/viz/bs_altair.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/viz/bs_plots.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/viz/bs_seaborn.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/viz/bsmplutils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/viz/streamlit_utils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils.egg-info/SOURCES.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils.egg-info/dependency_links.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils.egg-info/requires.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils.egg-info/top_level.txt +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/setup.cfg +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_bivariate_quantiles.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_bs_opt.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_bs_sparse_gaussian.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_bsnputils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_bssputils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_bsstats.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_bsutils.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_chebyshev.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_nptri.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_random_draws.py +0 -0
- {bs_python_utils-1.1 → bs_python_utils-1.1.1}/tests/test_sklearn_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bs-python-utils
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Utilities programs for my Python code
|
|
5
5
|
Requires-Python: >=3.13
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -50,6 +50,9 @@ Dynamic: license-file
|
|
|
50
50
|
|
|
51
51
|
### Release notes
|
|
52
52
|
|
|
53
|
+
#### 1.1.1 (September 04, 2026)
|
|
54
|
+
Added simulation-based bivariate ranks.
|
|
55
|
+
|
|
53
56
|
#### 1.0.1 (May 9, 2026)
|
|
54
57
|
Fixed badges.
|
|
55
58
|
|
|
@@ -300,9 +300,7 @@ def npmaxabs(arr: np.ndarray) -> float:
|
|
|
300
300
|
return cast(float, np.max(np.abs(arr)))
|
|
301
301
|
|
|
302
302
|
|
|
303
|
-
def rice_stderr(
|
|
304
|
-
y: np.ndarray, x: np.ndarray, is_sorted: bool = False
|
|
305
|
-
) -> np.ndarray | float:
|
|
303
|
+
def rice_stderr(y: np.ndarray, x: np.ndarray, is_sorted: bool = False) -> np.ndarray:
|
|
306
304
|
"""
|
|
307
305
|
computes the Rice local estimators of the standard error of y | x
|
|
308
306
|
|
|
@@ -420,8 +420,8 @@ def minimize_some_fixed(
|
|
|
420
420
|
obj,
|
|
421
421
|
x_init,
|
|
422
422
|
method="L-BFGS-B",
|
|
423
|
-
args=args,
|
|
424
|
-
options=options,
|
|
423
|
+
args=(args,),
|
|
424
|
+
options=cast(Any, options),
|
|
425
425
|
jac=grad_obj,
|
|
426
426
|
bounds=bounds,
|
|
427
427
|
)
|
|
@@ -453,8 +453,8 @@ def minimize_some_fixed(
|
|
|
453
453
|
fixed_obj,
|
|
454
454
|
t_init,
|
|
455
455
|
method="L-BFGS-B",
|
|
456
|
-
args=args,
|
|
457
|
-
options=options,
|
|
456
|
+
args=(args,),
|
|
457
|
+
options=cast(Any, options),
|
|
458
458
|
jac=fixed_grad_obj,
|
|
459
459
|
bounds=t_bounds,
|
|
460
460
|
)
|
|
@@ -508,8 +508,8 @@ def minimize_free(
|
|
|
508
508
|
obj,
|
|
509
509
|
x_init,
|
|
510
510
|
method="BFGS",
|
|
511
|
-
args=args,
|
|
512
|
-
options=options,
|
|
511
|
+
args=(args,),
|
|
512
|
+
options=cast(Any, options),
|
|
513
513
|
jac=grad_obj,
|
|
514
514
|
)
|
|
515
515
|
else:
|
|
@@ -517,8 +517,8 @@ def minimize_free(
|
|
|
517
517
|
obj,
|
|
518
518
|
x_init,
|
|
519
519
|
method="L-BFGS-B",
|
|
520
|
-
args=args,
|
|
521
|
-
options=options,
|
|
520
|
+
args=(args,),
|
|
521
|
+
options=cast(Any, options),
|
|
522
522
|
jac=grad_obj,
|
|
523
523
|
bounds=bounds,
|
|
524
524
|
)
|
|
@@ -66,25 +66,25 @@ def bivariate_ranks_simul(
|
|
|
66
66
|
probs = np.exp(psi_vals / h - lse_vals.reshape((-1, 1)))
|
|
67
67
|
mean_probs = np.mean(probs, axis=0)
|
|
68
68
|
if ret == 0:
|
|
69
|
-
return obj_val
|
|
69
|
+
return cast(float, obj_val)
|
|
70
70
|
elif ret == 1:
|
|
71
71
|
grad = -mean_probs[:-1] + mean_probs[-1]
|
|
72
|
-
return grad
|
|
72
|
+
return cast(np.ndarray, grad)
|
|
73
73
|
elif ret == 2:
|
|
74
74
|
ranks = (probs.T @ tau_draws / n_draws) / mean_probs.reshape((-1, 1))
|
|
75
|
-
return ranks
|
|
75
|
+
return cast(np.ndarray, ranks)
|
|
76
76
|
else:
|
|
77
77
|
bs_error_abort("Invalid value for ret. Must be 0, 1, or 2.")
|
|
78
78
|
return None
|
|
79
79
|
|
|
80
80
|
def objv(v: np.ndarray, args: list) -> float:
|
|
81
|
-
return objv_and_grad(v, ret=0)
|
|
81
|
+
return cast(float, objv_and_grad(v, ret=0))
|
|
82
82
|
|
|
83
83
|
def grad_objv(v: np.ndarray, args: list) -> np.ndarray:
|
|
84
|
-
return objv_and_grad(v, ret=1)
|
|
84
|
+
return cast(np.ndarray, objv_and_grad(v, ret=1))
|
|
85
85
|
|
|
86
86
|
def ranks(v: np.ndarray, args: list) -> np.ndarray:
|
|
87
|
-
return objv_and_grad(v, ret=2)
|
|
87
|
+
return cast(np.ndarray, objv_and_grad(v, ret=2))
|
|
88
88
|
|
|
89
89
|
resv = minimize_free(objv, grad_objv, v_init, args=[])
|
|
90
90
|
if not resv.success:
|
|
@@ -319,6 +319,7 @@ def bivariate_ranks(
|
|
|
319
319
|
bs_error_abort(f"only works for 2-dimensional y, not for {d}")
|
|
320
320
|
|
|
321
321
|
_, bivranks = _solve_for_v(y, n_nodes, verbose)
|
|
322
|
+
return bivranks
|
|
322
323
|
|
|
323
324
|
|
|
324
325
|
def bivariate_quantiles(
|
|
@@ -342,6 +342,7 @@ def bs_multivariate_normal_pdf(
|
|
|
342
342
|
bs_error_abort(
|
|
343
343
|
f"cov_mat should be a matrix ({nvars}, {nvars}) not ({nrows}, {ncols})"
|
|
344
344
|
)
|
|
345
|
+
cov_mat = cast(np.ndarray, cov_mat)
|
|
345
346
|
resid = values_x - means_x
|
|
346
347
|
argresid = spla.solve(cov_mat, resid.T)
|
|
347
348
|
argexp = np.zeros(n)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bs-python-utils
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Utilities programs for my Python code
|
|
5
5
|
Requires-Python: >=3.13
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -50,6 +50,9 @@ Dynamic: license-file
|
|
|
50
50
|
|
|
51
51
|
### Release notes
|
|
52
52
|
|
|
53
|
+
#### 1.1.1 (September 04, 2026)
|
|
54
|
+
Added simulation-based bivariate ranks.
|
|
55
|
+
|
|
53
56
|
#### 1.0.1 (May 9, 2026)
|
|
54
57
|
Fixed badges.
|
|
55
58
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/examples/examples_sparse_gaussian.py
RENAMED
|
File without changes
|
|
File without changes
|
{bs_python_utils-1.1 → bs_python_utils-1.1.1}/bs_python_utils/numerical/bs_sparse_gaussian.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|