{ "info": { "author": "Ben Moews", "author_email": "ben.moews@protonmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only" ], "description": "# Smurves\n\n### The triple-random constrainable curve generator for smooth function perturbation\n\nSmurves is a tool for random smooth curve generation that allows for several constraints to be put on the generation process. If offers a more constrainable alternative to using, for example, Gaussian processes for that purpose. The method is based on Newtonian [projectile motion](https://en.wikipedia.org/wiki/Projectile_motion) and takes its inspiration from Brandon Sanderson's book series [The Stormlight Archive](https://brandonsanderson.com/books/the-stormlight-archive/) and the books' magic system called \"surgebinding\". More specifically, this approach makes note of the parts that deal with the change in direction and magnitude of gravity for an in-flight object, which provided the initial concept.\n\nWith this idea in mind, Smurves generates smooth curves by randomly sampling the gravitational force, as well as locations and the number of gradient sign changes, for one projectile per curve path and making sure that all constraints are adhered to, with velocity and flight angle being retained after gravitational direction switches.\n\nIn essence, the code's inner workings can be imagined as firing a bullet at either zero angle or a random angle, from a specified or random point at either the left or the right side of the x-axis interval, depending on the user preferences. At a random number of random points, gravity gets turned upside down with a new random magnitude while the bullet continues its flight, all subject to the constraints set by the user for the properties of the required curves.\n\nThe motivation for this approach was to find a novel way* of generating utterly random curves with certain constraints to smoothly perturbate functions, for example the [matter power spectrum](https://en.wikipedia.org/wiki/Matter_power_spectrum) in cosmology. A more detailed description of the methodology, as well as the first application of the tool to scientific inquiry, can be found in [this paper](https://arxiv.org/abs/1812.09786) on the viability of type SN Ia supernova data to test the standard model of cosmology.\n\n* Because it's from a novel. This documentation comes fully equipped with bad jokes.\n\n### Installation\n\nSmurves can be installed via [PyPI](https://pypi.org/), with a single command in the terminal:\n\n```\npip install smurves\n```\n\nAlternatively, the file `smurves.py` can be downloaded from the folder `smurves` in this repository and used locally by placing the file into the working directory for a given project. An installation via the terminal is, however, highly recommended, as the installation process will check for the package requirements and automatically update or install any missing dependencies, thus sparing the user the effort of troubleshooting and installing them themselves.\n\n### Quickstart guide\n\nThe descriptions and example usage below provide a quick tutorial on Smurves. In addition, the `examples.ipynb` Jupyter Notebook in the `examples` folder in this repository show the use of the tool for various constraints and with explanations for each parameter set, and with the code necessary to plot the curves.\n\nIn addition to the number of curves and interval constraints for both x-axis and y-axis beyond which the curves shouldn't stray, the tool requires the number of measurement points amd the maximum number of directional changes per curve.\n\nSix optional parameters include the placement of a point in which the curves should converge, the choice of a logarithmic scale for the x-axis, the choice to launch the curve trajectories at random instead of zero angles, the choice to let the curves converge on the right instead of the left side if a convergence point is provided, the percentiles along the x-axis before and which no directional gravity changes should be implemented, and the placing of a threshold point before which no deviation from the convergence point's x-axis value should take place. These parameters are described in the table below.\n\n

\n\n| Variables | Explanations | Default |\n|:-----------------------------|:------------------------------------------------|:-----------|\n| n_curves | The number of curves you want to generate | |\n| x_interval | The allowed x-axis interval for the curves | |\n| y_interval | The allowed y-axis interval for the curves | |\n| n_measure | The number of equally-spaced measurement points | |\n| direction_maximum | The maximum number of allowed gradient changes | |\n| convergence_point (optional) | The left-side point of convergence for curves | |\n| log_scale (optional) | Whether measurements should be on a log-scale | False |\n| random_launch (optional) | Whether the first launch angle should be random | False |\n| right_convergence (optional) | Whether convergence should be on the right side | False |\n| change_range (optional) | The x-axis percentiles before and after which no
gradient changes should take place for curves | [0.1, 0.9] |\n| change_spacing (optional) | The minimum space in measurement points between
the different points of a gravitational force change | None |\n|change_ratio (optional) | The multiplier for the last partial trajectory to get
the upper limit for the next partial trajectory's force | None |\n| start_force (optional) | The point of the first deviation from unity | None |\n\n

\n\nAfter the installation via [PyPI](https://pypi.org), or using the `smurves.py` file locally, an exemplary call without optional parameters looks like this:\n\n```python\nfrom smurves import surgebinder\n\ncurves = surgebinder(n_curves = 10,\n x_interval = [0.1, 10.0],\n y_interval = [0.0, 1.0],\n n_measure = 100,\n direction_maximum = 1)\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/moews/smurves", "keywords": "astronomy,astrophysics,cosmology,randomized algorithms,function perturbation", "license": "", "maintainer": "", "maintainer_email": "", "name": "smurves", "package_url": "https://pypi.org/project/smurves/", "platform": "", "project_url": "https://pypi.org/project/smurves/", "project_urls": { "Homepage": "https://github.com/moews/smurves" }, "release_url": "https://pypi.org/project/smurves/1.0.1/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "The triple-random constrainable curve generator for smooth function perturbation", "version": "1.0.1" }, "last_serial": 4637604, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "7acc500d8a71093fc1707d0c072f96a0", "sha256": "3b2d19fd9849dbc2abee37c960f6a1446d68a686f2081e5d7d834f7c29f5c45c" }, "downloads": -1, "filename": "smurves-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7acc500d8a71093fc1707d0c072f96a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15413, "upload_time": "2018-12-25T17:56:18", "url": "https://files.pythonhosted.org/packages/77/00/c6a736f566349aee88c9aae0ca87b798a8d12c296fc8a5128ba7a9a0c8fb/smurves-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31b90af8d206effd9f4cae304f5b4327", "sha256": "a61fadaaf9bdeaca78d3a7dea336e08672da2951e0306b8a7caa7035b9cc8cff" }, "downloads": -1, "filename": "smurves-1.0.0.tar.gz", "has_sig": false, "md5_digest": "31b90af8d206effd9f4cae304f5b4327", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15844, "upload_time": "2018-12-25T17:56:20", "url": "https://files.pythonhosted.org/packages/25/e4/a801ea110a26b235170f2d84c4cdcd0cb0703cc657fae713ed98d33069df/smurves-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f9414865af9e213c54b0a46b5e9e4862", "sha256": "8b4c4471eea8f2ca112e1f78c18197ac238ded5e9c704f848c7cb28732695277" }, "downloads": -1, "filename": "smurves-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f9414865af9e213c54b0a46b5e9e4862", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15443, "upload_time": "2018-12-27T11:20:55", "url": "https://files.pythonhosted.org/packages/0d/4d/f7960e9dba908bb97bdc1c5b4c378591a46b6fb584429136005086da02d7/smurves-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0d477ac316d792878b41a023a1ba9a8", "sha256": "32afd7c4fc50d4a6d5f4206ca32b8c5e30cebd787455db9b84e84b08acf51ef8" }, "downloads": -1, "filename": "smurves-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e0d477ac316d792878b41a023a1ba9a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15929, "upload_time": "2018-12-27T11:20:57", "url": "https://files.pythonhosted.org/packages/53/27/fd05bf475c7ec0475bf90ec3a2dba38c3ffc2fcc73cc404ebc2ff6b3f0f3/smurves-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f9414865af9e213c54b0a46b5e9e4862", "sha256": "8b4c4471eea8f2ca112e1f78c18197ac238ded5e9c704f848c7cb28732695277" }, "downloads": -1, "filename": "smurves-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f9414865af9e213c54b0a46b5e9e4862", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15443, "upload_time": "2018-12-27T11:20:55", "url": "https://files.pythonhosted.org/packages/0d/4d/f7960e9dba908bb97bdc1c5b4c378591a46b6fb584429136005086da02d7/smurves-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0d477ac316d792878b41a023a1ba9a8", "sha256": "32afd7c4fc50d4a6d5f4206ca32b8c5e30cebd787455db9b84e84b08acf51ef8" }, "downloads": -1, "filename": "smurves-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e0d477ac316d792878b41a023a1ba9a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15929, "upload_time": "2018-12-27T11:20:57", "url": "https://files.pythonhosted.org/packages/53/27/fd05bf475c7ec0475bf90ec3a2dba38c3ffc2fcc73cc404ebc2ff6b3f0f3/smurves-1.0.1.tar.gz" } ] }