exppy - module that automates numerical experiments
This module is intended for performing numerical experiments with continuous parameters. Currently, parameters of the model can be randomized with uniform or log-uniform distributions in the given range. Simple random, latin hypercube or generalized subset designs can be used (supported by pyDOE2 package).
Example:
from exppy import LHSDesign, Experiment
from math import sin, cos
import pylab
class MyDesign(LHSDesign):
spec = (('x', (0, 6.28, 'uniform', 10)),
('y', (0, 6.28, 'uniform', 10)))
samples = 50
class MyModel:
# model can be any class, but it is required to have 'solve' method
# which takes sample `d` as argument and returns dict of results `res`
def solve(self, d):
x, y = d.x, d.y
res = {'F': sin(x)*cos(y), 'G': x*y}
return res
# Evaluate experiments and dump everything to 'test' directory:
ex = Experiment(MyDesign(), MyModel(), dirname='test')
ex.run()
# Plot 'F'
x = ex.design.x
y = ex.design.y
F = ex.result.F
pylab.tricontour(x, y, F, levels=14, linewidths=0.5, colors='k')
cntr = pylab.tricontourf(x, y, F, levels=14, cmap="RdBu_r")
pylab.colorbar(cntr)
pylab.plot(x, y, 'ko', ms=3)
pylab.title('$\sin(x)\cos(y)$\n (%d LHS samples)' % ex.design.samples)
The resulting figure looks like this:
For more hints look into the test_exppy.py file. Docs are in plans...
Metadata
Release files for exppy 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| exppy-0.1.3.tar.gz | 7.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| exppy-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.6 kB
Release files / exppy-0.1.3.tar.gz
| Download URL | exppy-0.1.3.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f5628e816619d3a6e046bcc7143861aeddc462f1c7f022dd9fe914a620b73e6
|
|
BLAKE2b-256 checksum How to use checksums |
551ea272f4218fb15ff5e3046446e882eb7a58f89992b8a19ca3f11cf7b5beaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / exppy-0.1.3-py3-none-any.whl
| Download URL | exppy-0.1.3-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3de7dc154dc510b2568f43f02eba5b4366347b2aadf66358c8c5026510005cd8
|
|
BLAKE2b-256 checksum How to use checksums |
6b88d7848f2997732f0256e8a35d1d8eb42608cd8a5a48bfa6a568a860c01b6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for exppy 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.