Skip to content

Commit 22c7b2a

Browse files
authored
Release 1.2.0 modifications
1 parent e71b4bf commit 22c7b2a

1 file changed

Lines changed: 51 additions & 3 deletions

File tree

README.md

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,59 @@ implemented in PyRabdLib, as provided in [1].
106106

107107

108108
## Implementation
109-
Current implementation of PyRandLib uses Python 3.x with no Cython version.
109+
Current implementation of PyRandLib uses Python 3.x with no Cython version.
110+
It has been tested with Python 3.8 but should run with all of Python 3.
110111

111-
Python 2.7 could be later available, if asked for. Cython implementations
112-
could also be later available.
112+
Note 1: PyRandLib version 1.1 and below should work with all versions of
113+
Python 3. In version 1.2, we have added underscores in numerical constants
114+
for the better readability of the code. This feature has been introduced in
115+
Python 3.6. If you want to use PyRandLib version 1.2 or above with Python
116+
3.5 or below, removing these underscores should be sufficient to have the
117+
library running correctly.
113118

119+
Note 2: no version or PyRandLib will ever be provided for Python 2 which is
120+
a no more maintained version of the Python language.
121+
122+
Note 3: a Cython version of PyRandLib might be delivered in a next release.
123+
Up today, no date is planned for this.
124+
125+
126+
## New in release 1.2
127+
This is available starting at version 1.2 of PyRandLib. The call operator
128+
(i.e., '()') gets a new signature which is still backward compatible with
129+
previous versions of this library. Its new use is described here below. The
130+
implementation code can be found in class `BaseRandom`, in module
131+
`baserandom.py`.
132+
133+
from fastrand63 import FastRand63
134+
135+
rand = FastRand63()
136+
137+
# prints a float random value ranging in [0.0, 1.0]
138+
print( rand() )
139+
140+
# prints an integer random value ranging in [0, 5]
141+
print( rand(5) )
142+
143+
# prints a float random value ranging in [0.0, 20.0]
144+
print( rand(20.0)
145+
146+
# prints a list of 10 integer values each ranging in [0, 5]
147+
print( rand(5, 10) )
148+
149+
# prints a list of 10 float values each ranging in [0.0, 1.0]
150+
print( rand(times=10) )
151+
152+
# prints a list of 4 random values ranging respectively in
153+
# [0, 5], [0.0, 50.0], [0.0, 500.0] and [0, 5000]
154+
print( rand(5, 50.0, 500.0, 5000) )
155+
156+
# a more complex call which prints something like:
157+
# [ [3, 11.64307079016269, 127.65395855782158, 4206, [2, 0, 1, 4, 4, 1, 2, 0]],
158+
# [2, 34.22526698212995, 242.54183578253426, 2204, [5, 3, 5, 4, 2, 0, 1, 3]],
159+
# [0, 17.77303802057933, 417.70662295909983, 559, [4, 1, 5, 0, 5, 3, 0, 5]] ]
160+
print( rand( (5, 50.0, 500.0, 5000, [5]*8), times=3 ) )
161+
114162

115163

116164
## Architecture overview

0 commit comments

Comments
 (0)