Skip to main content

Gwydion

Gwydion allows users to generate pseudo-random scientific data easily.

In the spirit of Faker, Gwydion allows you to generate pseudo-random data using a simple, clean, and customisable API.

Gwydion is named after a trickster from Welsh mythology.

Installation

You can install from PyPI with

pip install gwydion

Examples

Some basic examples of Gwydion objects are given below.

In the first example, we create a simple Linear object, given by the mathematical relationship y = mx + c. When parameters are not set by the user, Gwydion objects will default to suitable random values. Objects will also, by default, add some random noise to the y-data. In the example below we allow the Linear object to generate all of the parameters, but set the number of data points N manually.

from gwydion import Linear

lin = Linear(N=6)

x, y = lin.data
print(x, y, sep='\n')
# [  0.   2.   4.   6.   8.  10.]
# [ -0.17387604   5.59216341  11.77162695  17.70041889  23.55609025  28.67617757]

In this second example, an Exponential function is created with various manually selected parameters. Exponential functions are given by y = I * base**(k*x). In the example below we have set:

  • The number of data points N = 3,

  • The intensity I = 10,

  • The exponent multiplier k = -1,

  • The x-limits xlim = (0, 10),

  • And chosen to not add any random noise to the data add_rand = False.

For the Exponential object the default base is not random, but is instead to Euler’s number e = 2.71828.... This fact, combined with k = -1, means that our object below is effectively giving us exponential decay.

from gwydion import Exponential

exp = Exponential(N=3, I=10, k=-1, xlim=(0,10), add_rand=False)

x, y = exp.data
print(x, y, sep='\n')
# [  0.   5.  10.]
# [  1.00000000e+01   6.73794700e-02   4.53999298e-04]

Finally, let’s look at how Gwydion objects work with matplotlib. In the example below, we generate 5 Sine objects using a list comprehension. We can then use the plot function to plot each data set easily.

from gwydion import Sine
import matplotlib.pyplot as plt

sines = [Sine(xlim=(0,5)) for _ in range(5)]

fig, ax = plt.subplots()

for sine in sines:
    sine.plot(ax=ax)

ax.set_xlabel('Time')
ax.set_ylabel('Intensity')

plt.show()
http://i.imgur.com/oG6zDBC.png

Metadata

Release files for Gwydion 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Gwydion 0.1
File Size Uploaded Provenance Actions
gwydion-0.1.zip 14.0 kB Without provenance Details for gwydion-0.1.zip

Built distribution (wheel)

Table of built distributions (wheels) for Gwydion 0.1
File Interpreter ABI Platform Actions
gwydion-0.1.win-amd64.exe Details for gwydion-0.1.win-amd64.exe

Total release size: 247.8 kB

Release files / gwydion-0.1.zip

Download URL gwydion-0.1.zip
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
678214f8db98b8d22c06d5a4033cba7ea7c8f28cec956d3f10a4e6f41bd7cd7c
BLAKE2b-256 checksum
How to use checksums
f9365081420e531dd70abe61bd438c6c0ecfe4a5acca7b2693b26a8b0163349e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gwydion-0.1.win-amd64.exe

Download URL gwydion-0.1.win-amd64.exe
Size 233.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cd3f4cb5a83ae778dffb9fbb3cbc6fb1a969a97da87961b09983bd83e2427a9f
BLAKE2b-256 checksum
How to use checksums
ea066c0ac8074c728b4a294b86ee067e4b41e7507ac996466fdc01fa661e8372
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Gwydion 0.1

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.

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page