{ "info": { "author": "Bruno Beltran", "author_email": "brunobeltran0@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Topic :: Utilities" ], "description": "PScan.Scan\n==========\n\nA module whose sole purpose is to facilitate parameter scans via a\ngeneric framework for specifying parameter values to scan.\n\nCombinatorial parameter sweeps, joint parameter sweeps, \"scientific\"\nparameter sweeps, and advanced options for how many times to repeat\nsimulations are available.\n\nThis module was written after the author got tired of writing the same\nboiler plate code every time he wanted to sweep parameters in his\nsimulations.\n\nThe impetus for the design of the module was the realization that there\nare basically only four types of \"parameter sweeps\" that ever really\nneed to be done.\n\n1. run the same parameters many times (e.g. stoch simulation)\n2. vary certain parameters jointly (e.g. (i,j) = (1,2), (2,3), (3,4),\n ... )\n3. vary parameters combinatorially (e.g. (i,j) = (1,1), (1,2), (2,1),\n (2,2))\n4. vary \"scientifically\" (e.g. (i0,j),(i,j0) for fixed i0,j0, varying\n i,j)\n\nAll three of these can be specified declaratively (e.g. in English\nsentences) relatively easily, but usually each requires coding an\neasy-to-goof up nested for loop. This module turns a simple listing of\nwhich parameters into an iterable you can query to get the next set of\nparameters in your scan. If a Scan is stopped midway, it will remember\nits state, allowing you to load it back up, change the scan parameters,\nand continue the run. A Scan is *not* useful if your code needs to\nregularly generate the next parameters based on previous simulations.\n\nIf you have several \"jointly\" varying parameters, each \"group\" of them\nwill interact combinatorially. More abstractly, you should think of each\nset of jointly varying parameters as being the same as a \"single\"\nparameter.\n\nHere's an example that uses all of the features of the package. Say we\nhave two parameters, ``a`` and ``b``, that we want to vary jointly, and\nanother parameter, ``c``, that we want to to vary for each value of\n``(a,b)``. To further complicate things, we want to run the simulation 2\ntimes for each set of ``(a,b,c)``, except that if 'c' is too big, we run\nless repeats to save time. This would normally involve a lot of\ncarefully-coded boilerplate, but instead we can just tell ``PScan.Scan``\nwhat we want:\n\n::\n\n >>> from pscan import Scan\n >>> import numpy as np\n >>> def f(a,b,c):\n >>> print('a = ', a, ', b = ', b, ', c = ', c)\n >>> p = {}\n >>> p['a'] = np.linspace(0, 10, 5)\n >>> p['b'] = np.linspace(0.1, -0.5, 5)\n >>> p['c'] = np.linspace(10, 20, 3)\n >>> default_count = lambda p: 2\n >>> # None specifies to default to previous value\n >>> big_c_count = lambda p: 1 if p['c'] >= 14 else None\n >>>\n >>> s = Scan.from_dict(p, joint_lists=[['a','b']])\n >>> s.add_count(default_count) # these will be called\n >>> s.add_count(big_c_count) # in the order they were added\n >>> s.run_scan(f) # verify scan validity and run\n\n a = 0.0 , b = 0.1 , c = 10.0\n a = 0.0 , b = 0.1 , c = 10.0\n a = 2.5 , b = -0.05 , c = 10.0\n a = 2.5 , b = -0.05 , c = 10.0\n a = 5.0 , b = -0.2 , c = 10.0\n a = 5.0 , b = -0.2 , c = 10.0\n a = 7.5 , b = -0.35 , c = 10.0\n a = 7.5 , b = -0.35 , c = 10.0\n a = 10.0 , b = -0.5 , c = 10.0\n a = 10.0 , b = -0.5 , c = 10.0\n a = 0.0 , b = 0.1 , c = 15.0\n a = 2.5 , b = -0.05 , c = 15.0\n a = 5.0 , b = -0.2 , c = 15.0\n a = 7.5 , b = -0.35 , c = 15.0\n a = 10.0 , b = -0.5 , c = 15.0\n a = 0.0 , b = 0.1 , c = 20.0\n a = 2.5 , b = -0.05 , c = 20.0\n a = 5.0 , b = -0.2 , c = 20.0\n a = 7.5 , b = -0.35 , c = 20.0\n a = 10.0 , b = -0.5 , c = 20.0", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/brunobeltran/pscan", "keywords": "parameter scanning scientific search testing", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pscan", "package_url": "https://pypi.org/project/pscan/", "platform": "", "project_url": "https://pypi.org/project/pscan/", "project_urls": { "Homepage": "https://github.com/brunobeltran/pscan" }, "release_url": "https://pypi.org/project/pscan/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "Micro-DSL for specifying parameter scans easily", "version": "1.0.1" }, "last_serial": 5223667, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "aa6179307539529a121325bd6b5019d1", "sha256": "e709d7efaeb36ccb287a88713927eafa67cc900a9c384379d058f0204d4fe985" }, "downloads": -1, "filename": "pscan-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "aa6179307539529a121325bd6b5019d1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8275, "upload_time": "2017-11-02T02:40:37", "url": "https://files.pythonhosted.org/packages/84/c1/017fc203e8add3a0838baebc037ce44fa04bc8d5c3d99226550b9403d606/pscan-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9484f29e6c218b0779f2972d7912697f", "sha256": "e3701af81d7aadb81880cad5ec25c09c2bdd17ded708b16a9568fd477ca74e1a" }, "downloads": -1, "filename": "pscan-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9484f29e6c218b0779f2972d7912697f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5107, "upload_time": "2017-11-02T02:40:38", "url": "https://files.pythonhosted.org/packages/28/57/ea6feb008a2cfa20f450bcf0ed199562ed856c77315e7ec6ed09daaf17fc/pscan-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "ba148f6462f75149f638d9d566ea6879", "sha256": "550e834c643f86b8ef7d77620f13a53b95f86243da02b7f1d24bc6c2b4bde5f3" }, "downloads": -1, "filename": "pscan-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ba148f6462f75149f638d9d566ea6879", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6085, "upload_time": "2019-05-03T20:55:44", "url": "https://files.pythonhosted.org/packages/e2/4e/4c3f7da53714d0a6df994b7ed4e5dc5a1261d539289f8faf4235892f76b0/pscan-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ba148f6462f75149f638d9d566ea6879", "sha256": "550e834c643f86b8ef7d77620f13a53b95f86243da02b7f1d24bc6c2b4bde5f3" }, "downloads": -1, "filename": "pscan-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ba148f6462f75149f638d9d566ea6879", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6085, "upload_time": "2019-05-03T20:55:44", "url": "https://files.pythonhosted.org/packages/e2/4e/4c3f7da53714d0a6df994b7ed4e5dc5a1261d539289f8faf4235892f76b0/pscan-1.0.1.tar.gz" } ] }