Skip to content

Commit c2fb1dc

Browse files
committed
v0.2.38 updates:
* Lectures notebooks CLI test. * Version string without exec in setup.py. * Development sections in README.
1 parent fea71eb commit c2fb1dc

File tree

9 files changed

+71
-10
lines changed

9 files changed

+71
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,4 @@ Icon[]
119119
Network Trash Folder
120120
Temporary Items
121121
.apdisk
122+
lecturePy

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v0.2.38
2+
3+
* `runlectures.sh` is added for running lectures notebooks on CLI for testing.
4+
* Update in README, new section about developments.
5+
* Update how version is updated in `setup.py` dropping `exec` like practice.
6+
17
v0.2.33
28

39
* `mean_adjacent_gap_ratio`, return ratios matrix as well.

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ specific release.
2626

2727
## Approach and features
2828

29-
The package provides tools and utilities for randomness based research with `High-Entropy Random Number Generation (HE-RNG)`. It means generation iss performed with non-deterministic seeds every time a random
29+
The package provides tools and utilities for randomness based research with `High-Entropy Random Number Generation (HE-RNG)`. It means generation is performed with non-deterministic seeds every time a random
3030
library function is called.
3131

32-
There is a common misconception in computational sciences that speed is the ultimate goal, however primary objective is scientific correctness first. For this reasons, scientific correctness is taken precedence over speed in the development of the package. For proven methods being a baseline, we might implement faster versions.
33-
3432
### High-entropy random number utilities
3533

3634
The core package is providing strong randomness improving the simulation quality. We use NumPy grammar and as a backend.
@@ -69,6 +67,16 @@ Lectures notes that introduce randomization concepts with the usage of `Leymosun
6967
* [he_rng_nist.ipynb](https://github.com/msuzen/leymosun/blob/main/lectures/he_rng_nist.ipynb): `Lecture on Understanding High-Entropy RNGs with NIST benchmark`. This lecture provides a way to test different RNGs or usage of RNGs via standard quality
7068
tests.
7169

70+
## Development notes
71+
* Philosophy
72+
There is a common misconception in computational sciences that speed is the ultimate goal, however primary objective is scientific correctness first. For this reasons, scientific correctness is taken precedence over speed in the development of the package. For proven methods being a baseline, we might implement faster versions.
73+
* Testing
74+
* `tests` and `nbconvert` should be present as recommended dependency.
75+
* Test script should pass before any release.
76+
Unit tests `runtests.sh` and lectures `runlectures.sh`. (`lecturePy` directory is needed but this is ignored in the repo via `.gitignore`).
77+
* Add unit tests for each new method and features.
78+
* Add run portion for the new lecture in `runlecture.sh`.
79+
7280
## Publications
7381

7482
Papers, datasets and other material that used `leymosun`.

lectures/wigner_cats.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"import numpy as np\n",
4343
"import matplotlib.pyplot as plt\n",
4444
"from leymosun.gaussian import goe, wigner\n",
45-
"from leymosun.matrix import mixed_ensemble \n",
45+
"from leymosun.matrix import mixed_ensemble\n",
4646
"from leymosun.spectral import empirical_spectral_density\n",
4747
"from leymosun.stats import bootstrap_observed_matrix_ci\n",
4848
"import leymosun\n",

lectures/wigner_semicircle.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
"metadata": {},
191191
"outputs": [],
192192
"source": [
193-
"dwigner = wigner(locations, domasigmin_boundary=2.0)"
193+
"dwigner = wigner(locations, domain_boundary=2.0)"
194194
]
195195
},
196196
{

leymosun/gaussian.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def goe(matrix_order: int, scale: float = 1.0, loc: float= 0.0, bitget: BitGener
2525
return 0.50 * (A + A.transpose())
2626

2727

28-
def wigner(locations: np.array, domasigmin_boundary=2.0):
28+
def wigner(locations: np.array, domain_boundary=2.0):
2929
"""Wigner semi-circle density for GOE
3030
3131
Density is defined as
@@ -39,7 +39,7 @@ def wigner(locations: np.array, domasigmin_boundary=2.0):
3939
The density at the locations, list.
4040
4141
"""
42-
domain_boundary_sqr = domasigmin_boundary**2
42+
domain_boundary_sqr = domain_boundary**2
4343
return [
4444
2.0
4545
* np.sqrt(np.abs(domain_boundary_sqr - x**2))

leymosun/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__="0.2.33"
1+
__version__="0.2.38"

runlectures.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
#
3+
# Run notebooks after nbconvert
4+
#
5+
# Set -e: exit immediately if any command fails
6+
set -e
7+
8+
# Set -u: error if undefined variable used
9+
set -u
10+
11+
# Set -o pipefail: fail on pipeline failure (e.g., command fails in pipe)
12+
set -o pipefail
13+
14+
# wigner_cats.ipynb
15+
echo " "
16+
echo " Running wigner_cats.ipynb"
17+
echo " "
18+
rm -f lecturePy/wigner_cats.py
19+
jupyter nbconvert --to python lectures/wigner_cats.ipynb --output-dir=./lecturePy --log-level=ERROR
20+
python lecturePy/wigner_cats.py
21+
echo " "
22+
echo " Success running wigner_cats.ipynb"
23+
echo " "
24+
25+
# wigner_dyson_spacing.ipynb
26+
echo " "
27+
echo " Running wigner_dyson_spacing.ipynb"
28+
echo " "
29+
rm -f lecturePy/wigner_dyson_spacing.py
30+
jupyter nbconvert --to python lectures/wigner_dyson_spacing.ipynb --output-dir=./lecturePy --log-level=ERROR
31+
python lecturePy/wigner_dyson_spacing.py
32+
echo " "
33+
echo " Success running wigner_dyson_spacing.ipynb"
34+
echo " "
35+
36+
# wigner_semicircle.ipynb
37+
echo " "
38+
echo " Running wigner_semicircle.ipynb"
39+
echo " "
40+
rm -f lecturePy/wigner_semicircle.py
41+
jupyter nbconvert --to python lectures/wigner_semicircle.ipynb --output-dir=./lecturePy --log-level=ERROR
42+
python lecturePy/wigner_semicircle.py
43+
echo " "
44+
echo " Success running wigner_semicircle.ipynb"
45+
echo " "

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from setuptools import setup
22

33
fp = open("./leymosun/version.py")
4-
exec(fp.read())
4+
sversion = fp.read()
5+
__version__ = sversion.split('=')[1][1:-1]
56

67
with open("README.md") as f:
78
long_description = f.read()
@@ -34,7 +35,7 @@
3435
],
3536
test_suite="tests",
3637
extras_require={
37-
"test":["pytest==8.4.2", "coverage==7.10.7", "pytest-cov==7.0.0"]
38+
"test":["pytest==8.4.2", "coverage==7.10.7", "pytest-cov==7.0.0", "nbconvert==7.16.6"]
3839
},
3940
zip_safe=False,
4041
)

0 commit comments

Comments
 (0)