{ "info": { "author": "Toon Verstraelen", "author_email": "Toon.Verstraelen@UGent.be", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": ".. image:: https://travis-ci.org/theochem/derivcheck.svg?branch=master\n :target: https://travis-ci.org/theochem/derivcheck\n.. image:: https://anaconda.org/theochem/derivcheck/badges/version.svg\n :target: https://anaconda.org/theochem/derivcheck\n.. image:: https://codecov.io/gh/theochem/derivcheck/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/theochem/derivcheck\n\nDerivcheck provides a robust and very sensitive checker of analytic partial\nderivates. It is intended to be used in unit tests of other projects. See\n``deriv_check/basic_example.py`` for a basic example.\n\n\nInstallation\n============\n\nDerivcheck can be installed with pip (system wide or in a virtual environment):\n\n.. code:: bash\n\n pip install derivcheck\n\nAlternatively, you can install derivcheck in your home directory:\n\n.. code:: bash\n\n pip install derivcheck --user\n\nLastly, you can also install derivcheck with conda. (See\nhttps://www.continuum.io/downloads)\n\n.. code:: bash\n\n conda install -c theochem derivcheck\n\n\nTesting\n=======\n\nThe tests can be executed as follows:\n\n.. code:: bash\n\n pytest derivcheck\n\n\nBackground and usage\n====================\n\nThis module implements a function ``assert_deriv``, which uses Ridders' numerical finite\ndifference scheme to test the implementation of analytic finite differences. Ridders'\nmethod automatically finds the step size (given an initial upper estimate) and the\npolynomial order that result in the best approximation. In practice, this means that 14\ndigits of precision can be reached with 6 to 12 evaluations of the function of interest.\n\nThe implementation of Ridders' method is based on the one from the book \"Numerical\nRecipes\" (http://numerical.recipes/), which is in turn a slight rendition of the original\nmethod as proposed by Ridders. (Ridders, C.J.F. 1982, Advances in Engineering Software,\nvol. 4, no. 2, pp. 75\u201376. https://doi.org/10.1016/S0141-1195(82)80057-0)\n\nIt is assumed that you have implemented two functions: ``f`` and its derivative or\ngradient ``g``. The function ``f`` takes one argument: a scalar or array with shape\n``shape_in``. It returns a scalar or an array with shape ``shape_out``. The function ``g``\nhas the same input but returns a scalar or an array with shape (``shape_out + shape_in``).\n\nThe consistency of ``f`` and ``g``, can then be tested around a input value ``origin``\nwith the following code:\n\n.. code:: python\n\n assert_deriv(f, g, origin)\n\nwhere ``origin`` is a scalar or array with shape ``shape_in``, depending on what ``f`` and\n``g`` expect as input. An ``AssertionError`` is raised when the gradient function ``g`` is\nnot consistent with numerical derivatives of ``f``. If Ridders' method does not converge\nto sufficiently accurate estimates of a derivative, a ``FloatingPointError`` is raised.\n\nThe function ``assert_deriv`` takes several optional arguments to tune its behavior:\n\n\n* ``widths`` : ``float`` or ``np.ndarray`` (default ``1e-4``)\n\n The initial (maximal) step size for the finite difference method. Do not take a value\n that is too small. When an array is given, each matrix element of the input of the\n function gets a different step size. When a matrix element is set to zero, the\n derivative towards that element is not tested. The function will not be sampled beyond\n [origin-widths, origin+widths].\n\n* ``output_mask`` : ``np.ndarray`` or ``None`` (default)\n\n This option is useful when the function returns an array output: it allows the caller to\n select which components of the output need to be tested. When not given, all components\n are tested.\n\n* ``rtol`` : ``float``\n\n The allowed relative error on the derivative.\n\n* ``atol`` : ``float``\n\n The allowed absolute error on the derivative.\n\n\nRelease history\n===============\n\n- **2019-06-20** 1.1.5\n\n Fix a bug related to sharing references to the origin argument of OneDumWrapper.\n Start using Roberto to drive the CI.\n\n- **2017-09-21** 1.1.4\n\n New template for travis.yml, only affects testing\n\n- **2017-08-22** 1.1.3\n\n Switch to theochem channel on anaconda.\n\n- **2017-08-01** 1.1.2\n\n Remove unused dependency on future.\n\n- **2017-08-01** 1.1.1\n\n Fix dependencies to simplify testing.\n\n- **2017-08-01** 1.1.0\n\n - Tests are now included with the installed module.\n - Experimental: deployment to github, pypi and anaconda.\n\n- **2017-07-30** 1.0.2\n\n Updated README and install recipe for Conda\n\n- **2017-07-30** 1.0.1\n\n Fix some missing files and extend README\n\n- **2017-07-28** 1.0.0\n\n - Ridders' finite difference scheme for testing analytic derivatives.\n - Fully deterministic procedure.\n - More intuitive API\n\n- **2017-07-27** 0.1.0\n\n Code is made Python 3 compatible and still works with 2.7. Some packaging\n improvements.\n\n- **2017-07-27** 0.0.0\n\n Initial version: code taken from the Romin project (with contributions and\n ideas from Michael Richer and Paul W. Ayers). Some bugs were fixed through QA\n and CI (pylint, pycodestyle, pydocstyle, nosetests and coverage).\n\n\nHow to make a release (Github, PyPI and anaconda.org)\n=====================================================\n\nBefore you do this, make sure everything is OK. The PyPI releases cannot be undone. If you\ndelete a file from PyPI (because of a mistake), you cannot upload the fixed file with the\nsame filename! See https://github.com/pypa/packaging-problems/issues/74\n\n1. Update the release history.\n2. Commit the final changes to master and push to github.\n3. Wait for the CI tests to pass. Check if the README looks ok, etc. If needed, fix things\n and repeat step 2.\n4. Make a git version tag: ``git tag `` Follow the semantic versioning\n guidelines: http://semver.org\n5. Push the tag to github: ``git push origin master --tags``", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/theochem/derivcheck", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "derivcheck", "package_url": "https://pypi.org/project/derivcheck/", "platform": "", "project_url": "https://pypi.org/project/derivcheck/", "project_urls": { "Homepage": "https://github.com/theochem/derivcheck" }, "release_url": "https://pypi.org/project/derivcheck/1.1.5/", "requires_dist": null, "requires_python": ">=2.7", "summary": "A robust and very sensitive tester for analytic derivatives.", "version": "1.1.5" }, "last_serial": 5426232, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "c45e028b6c35d09ba79e8f3720bd9cd1", "sha256": "4cf933ff01f8c6cf7e91765a03a6331d30a2b393562567af551c6ff92549c101" }, "downloads": -1, "filename": "derivcheck-0.0.0.tar.gz", "has_sig": false, "md5_digest": "c45e028b6c35d09ba79e8f3720bd9cd1", "packagetype": "sdist", "python_version": "source", "requires_python": "==2.7.*", "size": 11744, "upload_time": "2017-07-27T14:54:07", "url": "https://files.pythonhosted.org/packages/80/8f/d8dbb1e898753c211bc29fcdf95533fa4f0b7b0350ce3965809beccb87c1/derivcheck-0.0.0.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "973fa719af798a96b9e55c84726d69d4", "sha256": "8da25e2a80b0d31ae8137e39ecff84428c2ea002fb6f080819afc4e0609d2d5b" }, "downloads": -1, "filename": "derivcheck-0.1.0.tar.gz", "has_sig": false, "md5_digest": "973fa719af798a96b9e55c84726d69d4", "packagetype": "sdist", "python_version": "source", "requires_python": "==2.7.*", "size": 11988, "upload_time": "2017-07-27T17:22:16", "url": "https://files.pythonhosted.org/packages/e8/8c/5783aa375ce9cd2f9b3162f87b79b6da2859eafa0746d322eb480f349ec0/derivcheck-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "2f4423192b772b46209059963006f427", "sha256": "780ec0669651656c94860b9ed1b2f16a127427461dd8d674cfcd4fb2c7fc677a" }, "downloads": -1, "filename": "derivcheck-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2f4423192b772b46209059963006f427", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 12583, "upload_time": "2017-07-28T14:29:30", "url": "https://files.pythonhosted.org/packages/41/19/8c58a1ad7f12f2bf724a6551b6728784e772053e3fa50c39747617dd9ab9/derivcheck-1.0.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "557dd0a7dc8e3ecfa0d50820473a0f52", "sha256": "cea365161fa49e68ac897a7c0662949db06e354fe84dbe4dddc47bfe7ca911be" }, "downloads": -1, "filename": "derivcheck-1.0.2.tar.gz", "has_sig": false, "md5_digest": "557dd0a7dc8e3ecfa0d50820473a0f52", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 25162, "upload_time": "2017-07-30T07:51:09", "url": "https://files.pythonhosted.org/packages/bc/73/ba005daffb28155dc6d259da6cca4aa3b47491a0fbe3be97e6cbca15164f/derivcheck-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "5b89a9df46bcabcf0ac7663a74a5c3d0", "sha256": "0c84954283e54f7c307ae7ba38a08105dc3649838de9885486d358261da52f70" }, "downloads": -1, "filename": "derivcheck-1.1.0.tar.gz", "has_sig": false, "md5_digest": "5b89a9df46bcabcf0ac7663a74a5c3d0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 25903, "upload_time": "2017-07-31T23:13:35", "url": "https://files.pythonhosted.org/packages/87/61/0d4fe9859424b00ef8d29f63ca1bab1e7c091c5b83129ca70836c2bc6bc1/derivcheck-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "31f02b0b19b641e7ebc790d76cb23bb4", "sha256": "a1d714db9e7063afe0df687667796d52645727b1d4d736120292e84f997042e9" }, "downloads": -1, "filename": "derivcheck-1.1.1.tar.gz", "has_sig": false, "md5_digest": "31f02b0b19b641e7ebc790d76cb23bb4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 26249, "upload_time": "2017-08-01T11:23:47", "url": "https://files.pythonhosted.org/packages/af/77/a7494fcf41a2fb173c0ca3367387d3cf3f82177d3cee745b65a3052fb369/derivcheck-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "35c7f9cc9f33321ede4be142e0f43ccb", "sha256": "27839a96c6970eb54418c325fde792e6846dab2d2a20ee14bfb466d12ea42104" }, "downloads": -1, "filename": "derivcheck-1.1.2.tar.gz", "has_sig": false, "md5_digest": "35c7f9cc9f33321ede4be142e0f43ccb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 26211, "upload_time": "2017-08-01T13:12:33", "url": "https://files.pythonhosted.org/packages/35/3a/214b82c6b99919e48767c1568282fb49809f14084afcb3cb429b23c1e020/derivcheck-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "7d707362486a9e6e058fddb72f9255e9", "sha256": "27dadb855db02367a3da9d162f0134b3cfd24bd9b00076ee51660fd3ed1862f2" }, "downloads": -1, "filename": "derivcheck-1.1.3.tar.gz", "has_sig": false, "md5_digest": "7d707362486a9e6e058fddb72f9255e9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 28485, "upload_time": "2017-08-23T05:58:18", "url": "https://files.pythonhosted.org/packages/7b/e1/194fcb5ced3930b569eb1315991768b9242dba465d8799470141e95aaf43/derivcheck-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "d998502987fdf2896a498c0470f8b134", "sha256": "4a33b5712336da5a6eda1ca498208468cb3cab3f74de611c8410b49efd0a9600" }, "downloads": -1, "filename": "derivcheck-1.1.4.tar.gz", "has_sig": false, "md5_digest": "d998502987fdf2896a498c0470f8b134", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 23526, "upload_time": "2017-09-21T23:27:55", "url": "https://files.pythonhosted.org/packages/64/66/1065cbc2d150896e25a7d47797c3dac6e020f98b698afa0c6076c8bc4444/derivcheck-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "1763c635e660aa666ff2ed1f0fa14c59", "sha256": "099cf8485dd875ff5d904280db6057e3fbca67dad1e8b378fb9cb2ba3777e978" }, "downloads": -1, "filename": "derivcheck-1.1.5.tar.gz", "has_sig": false, "md5_digest": "1763c635e660aa666ff2ed1f0fa14c59", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 21142, "upload_time": "2019-06-20T14:44:24", "url": "https://files.pythonhosted.org/packages/bd/54/54bf733f42e59cce973923333815887ffb5ba59e835ea4d1340bd14dd3e6/derivcheck-1.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1763c635e660aa666ff2ed1f0fa14c59", "sha256": "099cf8485dd875ff5d904280db6057e3fbca67dad1e8b378fb9cb2ba3777e978" }, "downloads": -1, "filename": "derivcheck-1.1.5.tar.gz", "has_sig": false, "md5_digest": "1763c635e660aa666ff2ed1f0fa14c59", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 21142, "upload_time": "2019-06-20T14:44:24", "url": "https://files.pythonhosted.org/packages/bd/54/54bf733f42e59cce973923333815887ffb5ba59e835ea4d1340bd14dd3e6/derivcheck-1.1.5.tar.gz" } ] }