bs-python-utils 0.9.3__tar.gz → 1.0__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 (85) hide show
  1. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/PKG-INFO +12 -7
  2. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/README.md +9 -4
  3. bs_python_utils-1.0/bs_python_utils/Timer.py +1 -0
  4. bs_python_utils-1.0/bs_python_utils/bivariate_quantiles.py +1 -0
  5. bs_python_utils-1.0/bs_python_utils/bs_altair.py +1 -0
  6. bs_python_utils-1.0/bs_python_utils/bs_logging.py +1 -0
  7. bs_python_utils-1.0/bs_python_utils/bs_mathstr.py +1 -0
  8. bs_python_utils-1.0/bs_python_utils/bs_mem.py +1 -0
  9. bs_python_utils-1.0/bs_python_utils/bs_opt.py +1 -0
  10. bs_python_utils-1.0/bs_python_utils/bs_plots.py +1 -0
  11. bs_python_utils-1.0/bs_python_utils/bs_seaborn.py +1 -0
  12. bs_python_utils-1.0/bs_python_utils/bs_sparse_gaussian.py +1 -0
  13. bs_python_utils-1.0/bs_python_utils/bsmplutils.py +1 -0
  14. bs_python_utils-1.0/bs_python_utils/bsnputils.py +1 -0
  15. bs_python_utils-1.0/bs_python_utils/bssputils.py +1 -0
  16. bs_python_utils-1.0/bs_python_utils/bsstats.py +1 -0
  17. bs_python_utils-1.0/bs_python_utils/bsutils.py +1 -0
  18. bs_python_utils-1.0/bs_python_utils/chebyshev.py +1 -0
  19. bs_python_utils-1.0/bs_python_utils/distance_covariances.py +1 -0
  20. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/examples/examples_altair.py +1 -1
  21. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/examples/examples_distance_covariances.py +5 -1
  22. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/examples/examples_mem.py +1 -1
  23. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/examples/examples_mpl.py +1 -1
  24. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/examples/examples_opt.py +3 -3
  25. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/examples/examples_seaborn.py +5 -1
  26. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/examples/examples_sklearn.py +1 -1
  27. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/examples/examples_sparse_gaussian.py +2 -1
  28. bs_python_utils-1.0/bs_python_utils/pandas_utils.py +1 -0
  29. bs_python_utils-1.0/bs_python_utils/sklearn_utils.py +1 -0
  30. bs_python_utils-1.0/bs_python_utils/streamlit_utils.py +1 -0
  31. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils.egg-info/PKG-INFO +12 -7
  32. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils.egg-info/requires.txt +2 -2
  33. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/pyproject.toml +3 -3
  34. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_bivariate_quantiles.py +3 -3
  35. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_bs_opt.py +1 -1
  36. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_bs_sparse_gaussian.py +1 -1
  37. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_bsnputils.py +2 -2
  38. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_bssputils.py +1 -1
  39. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_bsstats.py +1 -1
  40. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_bsutils.py +1 -1
  41. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_chebyshev.py +3 -3
  42. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_nptri.py +1 -1
  43. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_random_draws.py +1 -1
  44. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/tests/test_sklearn_utils.py +4 -3
  45. bs_python_utils-0.9.3/bs_python_utils/Timer.py +0 -81
  46. bs_python_utils-0.9.3/bs_python_utils/bivariate_quantiles.py +0 -231
  47. bs_python_utils-0.9.3/bs_python_utils/bs_altair.py +0 -1111
  48. bs_python_utils-0.9.3/bs_python_utils/bs_logging.py +0 -168
  49. bs_python_utils-0.9.3/bs_python_utils/bs_mathstr.py +0 -121
  50. bs_python_utils-0.9.3/bs_python_utils/bs_mem.py +0 -157
  51. bs_python_utils-0.9.3/bs_python_utils/bs_opt.py +0 -576
  52. bs_python_utils-0.9.3/bs_python_utils/bs_plots.py +0 -62
  53. bs_python_utils-0.9.3/bs_python_utils/bs_seaborn.py +0 -210
  54. bs_python_utils-0.9.3/bs_python_utils/bs_sparse_gaussian.py +0 -74
  55. bs_python_utils-0.9.3/bs_python_utils/bsmplutils.py +0 -95
  56. bs_python_utils-0.9.3/bs_python_utils/bsnputils.py +0 -1221
  57. bs_python_utils-0.9.3/bs_python_utils/bssputils.py +0 -82
  58. bs_python_utils-0.9.3/bs_python_utils/bsstats.py +0 -498
  59. bs_python_utils-0.9.3/bs_python_utils/bsutils.py +0 -410
  60. bs_python_utils-0.9.3/bs_python_utils/chebyshev.py +0 -550
  61. bs_python_utils-0.9.3/bs_python_utils/distance_covariances.py +0 -263
  62. bs_python_utils-0.9.3/bs_python_utils/pandas_utils.py +0 -245
  63. bs_python_utils-0.9.3/bs_python_utils/sklearn_utils.py +0 -123
  64. bs_python_utils-0.9.3/bs_python_utils/streamlit_utils.py +0 -100
  65. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/LICENSE +0 -0
  66. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid1prec13.txt +0 -0
  67. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid1prec17.txt +0 -0
  68. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid1prec9.txt +0 -0
  69. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid2prec13.txt +0 -0
  70. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid2prec17.txt +0 -0
  71. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid2prec9.txt +0 -0
  72. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid3prec13.txt +0 -0
  73. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid3prec17.txt +0 -0
  74. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid3prec9.txt +0 -0
  75. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid4prec13.txt +0 -0
  76. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid4prec17.txt +0 -0
  77. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid4prec9.txt +0 -0
  78. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid5prec13.txt +0 -0
  79. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid5prec17.txt +0 -0
  80. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/GaussHermiteSparseGrids/GHsparseGrid5prec9.txt +0 -0
  81. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils/__init__.py +0 -0
  82. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils.egg-info/SOURCES.txt +0 -0
  83. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils.egg-info/dependency_links.txt +0 -0
  84. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/bs_python_utils.egg-info/top_level.txt +0 -0
  85. {bs_python_utils-0.9.3 → bs_python_utils-1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bs-python-utils
3
- Version: 0.9.3
3
+ Version: 1.0
4
4
  Summary: Utilities programs for my Python code
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -16,7 +16,7 @@ Requires-Dist: numpy>=2.3.3
16
16
  Requires-Dist: pandas>=2.3.2
17
17
  Requires-Dist: pre-commit>=4.3.0
18
18
  Requires-Dist: pytest>=8.4.2
19
- Requires-Dist: mypy
19
+ Requires-Dist: mypy>=1.18
20
20
  Requires-Dist: ruff>=0.14.0
21
21
  Requires-Dist: scikit-learn>=1.7.2
22
22
  Requires-Dist: scipy>=1.16.2
@@ -25,16 +25,18 @@ Requires-Dist: statsmodels>=0.14.5
25
25
  Requires-Dist: streamlit>=1.49.1
26
26
  Requires-Dist: vega-datasets>=0.9.0
27
27
  Requires-Dist: colorama>=0.4.6
28
- Requires-Dist: pyarrow>=21.0.0
28
+ Requires-Dist: pyarrow>=23.0.0
29
29
  Dynamic: license-file
30
30
 
31
31
  ## bs-python-utils
32
32
 
33
+ [![PyPI version](https://img.shields.io/pypi/v/bs-python-utils)](https://pypi.org/project/bs-python-utils/)
34
+ [![Release](https://img.shields.io/github/v/release/bsalanie/bs-python-utils)](https://github.com/bsalanie/bs-python-utils/releases)
35
+ [![Build status](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/main.yml?branch=main)](https://github.com/bsalanie/bs-python-utils/actions/workflows/main.yml?query=branch%3Amain)
36
+ [![Tests](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/tests.yml?branch=main&label=tests)](https://github.com/bsalanie/bs-python-utils/actions/workflows/tests.yml?query=branch%3Amain)
37
+ [![Commit activity](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils)](https://github.com/bsalanie/bs-python-utils/commits/main)
33
38
  ![GitHub last commit](https://img.shields.io/github/last-commit/bsalanie/bs-python-utils)
34
-
35
- <!-- [![Release](https://img.shields.io/github/v/release/bsalanie/bs-python-utils)](https://img.shields.io/github/v/release/bsalanie/bs-python-utils) -->
36
-
37
- [![Build status](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/main.yml?branch=main)](https://github.com/bsalanie/bs-python-utils/actions/workflows/main.yml?query=branch%3Amain) <!-- [![codecov](https://codecov.io/gh/bsalanie/bs-python-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/bsalanie/bs-python-utils) --> <!-- [![Commit activity](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils)](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils) --> [![License](https://img.shields.io/github/license/bsalanie/bs-python-utils)](https://img.shields.io/github/license/bsalanie/bs-python-utils)
39
+ [![License](https://img.shields.io/github/license/bsalanie/bs-python-utils)](https://img.shields.io/github/license/bsalanie/bs-python-utils)
38
40
 
39
41
  **My Python utilities**.
40
42
 
@@ -43,6 +45,9 @@ Dynamic: license-file
43
45
 
44
46
  ### Release notes
45
47
 
48
+ #### 1.0 (May 9, 2026)
49
+ Created subpackages (no change in the API).
50
+
46
51
  #### 0.9 (March 18, 2026)
47
52
  Improved bivariate quantiles.
48
53
 
@@ -1,10 +1,12 @@
1
1
  ## bs-python-utils
2
2
 
3
+ [![PyPI version](https://img.shields.io/pypi/v/bs-python-utils)](https://pypi.org/project/bs-python-utils/)
4
+ [![Release](https://img.shields.io/github/v/release/bsalanie/bs-python-utils)](https://github.com/bsalanie/bs-python-utils/releases)
5
+ [![Build status](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/main.yml?branch=main)](https://github.com/bsalanie/bs-python-utils/actions/workflows/main.yml?query=branch%3Amain)
6
+ [![Tests](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/tests.yml?branch=main&label=tests)](https://github.com/bsalanie/bs-python-utils/actions/workflows/tests.yml?query=branch%3Amain)
7
+ [![Commit activity](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils)](https://github.com/bsalanie/bs-python-utils/commits/main)
3
8
  ![GitHub last commit](https://img.shields.io/github/last-commit/bsalanie/bs-python-utils)
4
-
5
- <!-- [![Release](https://img.shields.io/github/v/release/bsalanie/bs-python-utils)](https://img.shields.io/github/v/release/bsalanie/bs-python-utils) -->
6
-
7
- [![Build status](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/main.yml?branch=main)](https://github.com/bsalanie/bs-python-utils/actions/workflows/main.yml?query=branch%3Amain) <!-- [![codecov](https://codecov.io/gh/bsalanie/bs-python-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/bsalanie/bs-python-utils) --> <!-- [![Commit activity](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils)](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils) --> [![License](https://img.shields.io/github/license/bsalanie/bs-python-utils)](https://img.shields.io/github/license/bsalanie/bs-python-utils)
9
+ [![License](https://img.shields.io/github/license/bsalanie/bs-python-utils)](https://img.shields.io/github/license/bsalanie/bs-python-utils)
8
10
 
9
11
  **My Python utilities**.
10
12
 
@@ -13,6 +15,9 @@
13
15
 
14
16
  ### Release notes
15
17
 
18
+ #### 1.0 (May 9, 2026)
19
+ Created subpackages (no change in the API).
20
+
16
21
  #### 0.9 (March 18, 2026)
17
22
  Improved bivariate quantiles.
18
23
 
@@ -0,0 +1 @@
1
+ from bs_python_utils.core.Timer import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.stats.bivariate_quantiles import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.viz.bs_altair import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.core.bs_logging import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.core.bs_mathstr import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.core.bs_mem import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.opt.bs_opt import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.viz.bs_plots import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.viz.bs_seaborn import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.numerical.bs_sparse_gaussian import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.viz.bsmplutils import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.numerical.bsnputils import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.numerical.bssputils import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.stats.bsstats import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.core.bsutils import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.numerical.chebyshev import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.stats.distance_covariances import * # noqa: F401, F403
@@ -5,7 +5,7 @@ import numpy as np
5
5
  from vega_datasets import data
6
6
 
7
7
 
8
- from bs_python_utils.bs_altair import (
8
+ from bs_python_utils.viz.bs_altair import (
9
9
  alt_boxes,
10
10
  alt_density,
11
11
  alt_faceted_densities,
@@ -2,7 +2,11 @@
2
2
 
3
3
  import numpy as np
4
4
 
5
- from bs_python_utils.distance_covariances import dcov_dcor, pdcov_pdcor, pvalue_pdcov
5
+ from bs_python_utils.stats.distance_covariances import (
6
+ dcov_dcor,
7
+ pdcov_pdcor,
8
+ pvalue_pdcov,
9
+ )
6
10
 
7
11
  # example page 2396 of Szekely and Rizzo 2014
8
12
  n = 2000
@@ -4,7 +4,7 @@ import tracemalloc
4
4
 
5
5
  import numpy as np
6
6
 
7
- from bs_python_utils.bs_mem import (
7
+ from bs_python_utils.core.bs_mem import (
8
8
  memory_display_top,
9
9
  memory_display_top_diffs,
10
10
  memory_usage,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import numpy as np
4
4
 
5
- from bs_python_utils.bsmplutils import bs_mpl_plot_dcm_fit
5
+ from bs_python_utils.viz.bsmplutils import bs_mpl_plot_dcm_fit
6
6
 
7
7
  n_obs = 100
8
8
  n_y = 4
@@ -2,14 +2,14 @@
2
2
 
3
3
  import numpy as np
4
4
 
5
- from bs_python_utils.bs_opt import (
5
+ from bs_python_utils.core.bsutils import print_stars
6
+ from bs_python_utils.numerical.bssputils import describe_array
7
+ from bs_python_utils.opt.bs_opt import (
6
8
  acc_grad_descent,
7
9
  armijo_alpha,
8
10
  barzilai_borwein_alpha,
9
11
  minimize_some_fixed,
10
12
  )
11
- from bs_python_utils.bssputils import describe_array
12
- from bs_python_utils.bsutils import print_stars
13
13
 
14
14
  print_stars("Testing acc_grad_descent")
15
15
 
@@ -3,7 +3,11 @@
3
3
  import matplotlib.pyplot as plt
4
4
  import seaborn as sns
5
5
 
6
- from bs_python_utils.bs_seaborn import bs_regplot, bs_sns_bar_x_byf, bs_sns_bar_x_byfg
6
+ from bs_python_utils.viz.bs_seaborn import (
7
+ bs_regplot,
8
+ bs_sns_bar_x_byf,
9
+ bs_sns_bar_x_byfg,
10
+ )
7
11
 
8
12
  cars = sns.load_dataset("mpg")
9
13
 
@@ -4,7 +4,7 @@ import matplotlib.pyplot as plt
4
4
  import numpy as np
5
5
  from sklearn.preprocessing import PolynomialFeatures, StandardScaler
6
6
 
7
- from bs_python_utils.sklearn_utils import skl_npreg_lasso
7
+ from bs_python_utils.data_anal.sklearn_utils import skl_npreg_lasso
8
8
 
9
9
  n_obs = 10000
10
10
  X1 = -2.0 + 3.0 * np.random.uniform(size=n_obs)
@@ -1,9 +1,10 @@
1
1
  """Integrate x -> x**4 over N(0, 1) using the sparse Gaussian grids."""
2
2
 
3
3
  from typing import cast
4
+
4
5
  import numpy as np
5
6
 
6
- from bs_python_utils.bs_sparse_gaussian import setup_sparse_gaussian
7
+ from bs_python_utils.numerical.bs_sparse_gaussian import setup_sparse_gaussian
7
8
 
8
9
 
9
10
  def sum_x_to_the_fourth(x: np.ndarray) -> np.ndarray:
@@ -0,0 +1 @@
1
+ from bs_python_utils.data_anal.pandas_utils import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.data_anal.sklearn_utils import * # noqa: F401, F403
@@ -0,0 +1 @@
1
+ from bs_python_utils.viz.streamlit_utils import * # noqa: F401, F403
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bs-python-utils
3
- Version: 0.9.3
3
+ Version: 1.0
4
4
  Summary: Utilities programs for my Python code
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -16,7 +16,7 @@ Requires-Dist: numpy>=2.3.3
16
16
  Requires-Dist: pandas>=2.3.2
17
17
  Requires-Dist: pre-commit>=4.3.0
18
18
  Requires-Dist: pytest>=8.4.2
19
- Requires-Dist: mypy
19
+ Requires-Dist: mypy>=1.18
20
20
  Requires-Dist: ruff>=0.14.0
21
21
  Requires-Dist: scikit-learn>=1.7.2
22
22
  Requires-Dist: scipy>=1.16.2
@@ -25,16 +25,18 @@ Requires-Dist: statsmodels>=0.14.5
25
25
  Requires-Dist: streamlit>=1.49.1
26
26
  Requires-Dist: vega-datasets>=0.9.0
27
27
  Requires-Dist: colorama>=0.4.6
28
- Requires-Dist: pyarrow>=21.0.0
28
+ Requires-Dist: pyarrow>=23.0.0
29
29
  Dynamic: license-file
30
30
 
31
31
  ## bs-python-utils
32
32
 
33
+ [![PyPI version](https://img.shields.io/pypi/v/bs-python-utils)](https://pypi.org/project/bs-python-utils/)
34
+ [![Release](https://img.shields.io/github/v/release/bsalanie/bs-python-utils)](https://github.com/bsalanie/bs-python-utils/releases)
35
+ [![Build status](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/main.yml?branch=main)](https://github.com/bsalanie/bs-python-utils/actions/workflows/main.yml?query=branch%3Amain)
36
+ [![Tests](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/tests.yml?branch=main&label=tests)](https://github.com/bsalanie/bs-python-utils/actions/workflows/tests.yml?query=branch%3Amain)
37
+ [![Commit activity](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils)](https://github.com/bsalanie/bs-python-utils/commits/main)
33
38
  ![GitHub last commit](https://img.shields.io/github/last-commit/bsalanie/bs-python-utils)
34
-
35
- <!-- [![Release](https://img.shields.io/github/v/release/bsalanie/bs-python-utils)](https://img.shields.io/github/v/release/bsalanie/bs-python-utils) -->
36
-
37
- [![Build status](https://img.shields.io/github/actions/workflow/status/bsalanie/bs-python-utils/main.yml?branch=main)](https://github.com/bsalanie/bs-python-utils/actions/workflows/main.yml?query=branch%3Amain) <!-- [![codecov](https://codecov.io/gh/bsalanie/bs-python-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/bsalanie/bs-python-utils) --> <!-- [![Commit activity](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils)](https://img.shields.io/github/commit-activity/m/bsalanie/bs-python-utils) --> [![License](https://img.shields.io/github/license/bsalanie/bs-python-utils)](https://img.shields.io/github/license/bsalanie/bs-python-utils)
39
+ [![License](https://img.shields.io/github/license/bsalanie/bs-python-utils)](https://img.shields.io/github/license/bsalanie/bs-python-utils)
38
40
 
39
41
  **My Python utilities**.
40
42
 
@@ -43,6 +45,9 @@ Dynamic: license-file
43
45
 
44
46
  ### Release notes
45
47
 
48
+ #### 1.0 (May 9, 2026)
49
+ Created subpackages (no change in the API).
50
+
46
51
  #### 0.9 (March 18, 2026)
47
52
  Improved bivariate quantiles.
48
53
 
@@ -9,7 +9,7 @@ numpy>=2.3.3
9
9
  pandas>=2.3.2
10
10
  pre-commit>=4.3.0
11
11
  pytest>=8.4.2
12
- mypy
12
+ mypy>=1.18
13
13
  ruff>=0.14.0
14
14
  scikit-learn>=1.7.2
15
15
  scipy>=1.16.2
@@ -18,4 +18,4 @@ statsmodels>=0.14.5
18
18
  streamlit>=1.49.1
19
19
  vega-datasets>=0.9.0
20
20
  colorama>=0.4.6
21
- pyarrow>=21.0.0
21
+ pyarrow>=23.0.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "bs-python-utils"
3
- version = "0.9.3"
3
+ version = "1.0"
4
4
  description = "Utilities programs for my Python code"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -16,7 +16,7 @@ dependencies = [
16
16
  "pandas>=2.3.2",
17
17
  "pre-commit>=4.3.0",
18
18
  "pytest>=8.4.2",
19
- "mypy",
19
+ "mypy>=1.18",
20
20
  "ruff>=0.14.0",
21
21
  "scikit-learn>=1.7.2",
22
22
  "scipy>=1.16.2",
@@ -25,7 +25,7 @@ dependencies = [
25
25
  "streamlit>=1.49.1",
26
26
  "vega-datasets>=0.9.0",
27
27
  "colorama>=0.4.6",
28
- "pyarrow>=21.0.0",
28
+ "pyarrow>=23.0.0",
29
29
  ]
30
30
 
31
31
  [tool.setuptools]
@@ -1,10 +1,10 @@
1
1
  import numpy as np
2
2
 
3
- from bs_python_utils.bivariate_quantiles import (
3
+ from bs_python_utils.numerical.bsnputils import npmaxabs
4
+ from bs_python_utils.stats.bivariate_quantiles import (
4
5
  _compute_ad,
5
6
  _solve_for_v,
6
7
  )
7
- from bs_python_utils.bsnputils import npmaxabs
8
8
 
9
9
 
10
10
  def test_bivariate_ranks():
@@ -24,7 +24,7 @@ def test_bivariate_ranks():
24
24
  y[:, 1] == y[k, 1]
25
25
  )
26
26
 
27
- assert npmaxabs(bivranks - bivranks_th) < 0.01
27
+ assert npmaxabs(bivranks - bivranks_th) < 0.1
28
28
 
29
29
 
30
30
  def test_compute_ad():
@@ -1,6 +1,6 @@
1
1
  import numpy as np
2
2
 
3
- from bs_python_utils import bs_opt
3
+ from bs_python_utils.opt import bs_opt
4
4
 
5
5
 
6
6
  def quadratic_objective(x, args):
@@ -2,7 +2,7 @@ from math import isclose
2
2
 
3
3
  import numpy as np
4
4
 
5
- from bs_python_utils.bs_sparse_gaussian import setup_sparse_gaussian
5
+ from bs_python_utils.numerical.bs_sparse_gaussian import setup_sparse_gaussian
6
6
 
7
7
 
8
8
  def test_sparse_gaussian():
@@ -2,7 +2,8 @@ from math import exp, isclose, log, pi, sqrt
2
2
 
3
3
  import numpy as np
4
4
 
5
- from bs_python_utils.bsnputils import (
5
+ from bs_python_utils.core.bsutils import bsexp, bslog
6
+ from bs_python_utils.numerical.bsnputils import (
6
7
  bs_sqrt_pdmatrix,
7
8
  bsgrid,
8
9
  ecdf,
@@ -23,7 +24,6 @@ from bs_python_utils.bsnputils import (
23
24
  print_quantiles,
24
25
  rice_stderr,
25
26
  )
26
- from bs_python_utils.bsutils import bsexp, bslog
27
27
 
28
28
 
29
29
  def test_print_quantiles_vec():
@@ -1,7 +1,7 @@
1
1
  import numpy as np
2
2
  import scipy.stats as sts
3
3
 
4
- from bs_python_utils import bssputils
4
+ from bs_python_utils.numerical import bssputils
5
5
 
6
6
 
7
7
  def test_describe_array_reports_std_deviation(capsys):
@@ -1,6 +1,6 @@
1
1
  import numpy as np
2
2
 
3
- from bs_python_utils import bsstats
3
+ from bs_python_utils.stats import bsstats
4
4
 
5
5
 
6
6
  def test_proj_Z_multivariate_degree_two():
@@ -2,7 +2,7 @@ from math import exp, isclose, log, sqrt
2
2
 
3
3
  import numpy as np
4
4
 
5
- from bs_python_utils.bsutils import (
5
+ from bs_python_utils.core.bsutils import (
6
6
  bs_projection_point,
7
7
  bs_switch,
8
8
  bscomb,
@@ -3,9 +3,9 @@ from math import exp, isclose, sqrt
3
3
  import numpy as np
4
4
  import pytest
5
5
 
6
- from bs_python_utils.bsnputils import FloatOrArray, bsgrid
7
- from bs_python_utils.bsutils import bs_error_abort
8
- from bs_python_utils.chebyshev import (
6
+ from bs_python_utils.core.bsutils import bs_error_abort
7
+ from bs_python_utils.numerical.bsnputils import FloatOrArray, bsgrid
8
+ from bs_python_utils.numerical.chebyshev import (
9
9
  Interval,
10
10
  Rectangle,
11
11
  cheb_eval_fun_at_nodes_1d,
@@ -1,6 +1,6 @@
1
1
  import numpy as np
2
2
 
3
- from bs_python_utils.bsnputils import set_elements_abovebelow_diagonal
3
+ from bs_python_utils.numerical.bsnputils import set_elements_abovebelow_diagonal
4
4
 
5
5
 
6
6
  def test_nptril():
@@ -1,6 +1,6 @@
1
1
  import numpy as np
2
2
 
3
- from bs_python_utils.bsstats import emcee_draw, kde_resample
3
+ from bs_python_utils.stats.bsstats import emcee_draw, kde_resample
4
4
 
5
5
 
6
6
  def log_gauss2(x, *args):
@@ -1,8 +1,9 @@
1
- import numpy as np
1
+ from typing import cast
2
2
 
3
3
  import matplotlib.pyplot as plt
4
+ import numpy as np
4
5
 
5
- from bs_python_utils import sklearn_utils
6
+ from bs_python_utils.data_anal import sklearn_utils
6
7
 
7
8
 
8
9
  def test_skl_npreg_lasso_returns_predictions_and_model():
@@ -29,7 +30,7 @@ def test_skl_npreg_lasso_returns_predictions_and_model():
29
30
  assert model.named_steps["lasso"].fit_intercept is False
30
31
 
31
32
  # ensure pipeline can predict out-of-sample without errors
32
- preds_new = model.predict(X[:5])
33
+ preds_new = cast(np.ndarray, model.predict(X[:5]))
33
34
  assert preds_new.shape == (5,)
34
35
 
35
36
 
@@ -1,81 +0,0 @@
1
- """
2
- Utilities to time code:
3
-
4
- * a `Timer` class that can be used as a context manager
5
- * a `timeit` decorator for functions.
6
- """
7
-
8
- import time
9
- from functools import wraps
10
- from typing import Any, Callable, Iterable
11
-
12
-
13
- def timeit(func: Callable) -> Callable:
14
- """
15
- Decorator to time a function
16
- """
17
-
18
- @wraps(func)
19
- def wrapper(*args: Iterable, **kwargs: dict) -> Any:
20
- start = time.perf_counter()
21
- result = func(*args, **kwargs)
22
- end = time.perf_counter()
23
- print(f"{func.__name__} executed in {end - start:.3f} seconds")
24
- return result
25
-
26
- return wrapper
27
-
28
-
29
- class Timer:
30
- """
31
- A timer that can be started, stopped, and reset as needed by the user.
32
- It keeps track of the total elapsed time in the `elapsed` attribute::
33
-
34
- Examples:
35
- >>> with Timer() as t:
36
- >>> ....
37
- >>> print(f"... took {t.elapsed} seconds")
38
-
39
- use `Timer(time.process_time)` to get only CPU time.
40
-
41
- can also do:
42
-
43
- Examples:
44
- >>> t = Timer()
45
- >>> t.start()
46
- >>> t.stop()
47
- >>> t.start() # will add to the same counter
48
- >>> t.stop()
49
- >>> print(f"{t.elapsed} seconds total")
50
- """
51
-
52
- def __init__(self, func: Callable = time.perf_counter) -> None:
53
- self.elapsed = 0.0
54
- self._func = func
55
- self._start = None
56
-
57
- def start(self) -> None:
58
- if self._start is not None:
59
- raise RuntimeError("Already started")
60
- self._start = self._func()
61
-
62
- def stop(self) -> None:
63
- if self._start is None:
64
- raise RuntimeError("Not started")
65
- end = self._func()
66
- self.elapsed += end - self._start
67
- self._start = None
68
-
69
- def reset(self) -> None:
70
- self.elapsed = 0.0
71
-
72
- @property
73
- def running(self) -> bool:
74
- return self._start is not None
75
-
76
- def __enter__(self) -> Any:
77
- self.start()
78
- return self
79
-
80
- def __exit__(self, *args: Iterable) -> None:
81
- self.stop()