hdrpy
Advanced tools
+65
| sudo: false | ||
| language: python | ||
| cache: pip | ||
| branches: | ||
| only: | ||
| - master | ||
| os: linux | ||
| python: | ||
| - "2.7" | ||
| - "3.6" | ||
| env: | ||
| - PIPENV_SHELL_COMPAT=true PIPENV_COLORBLIND=true PIPENV_NOSPIN=true | ||
| matrix: | ||
| include: | ||
| - os: osx | ||
| language: generic | ||
| env: PYTHON=2.7.14 | ||
| - os: osx | ||
| language: generic | ||
| env: PYTHON=3.6.4 | ||
| before_install: | | ||
| if [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
| brew update | ||
| # Per the `pyenv homebrew recommendations <https://github.com/yyuu/pyenv/wiki#suggested-build-environment>`_. | ||
| brew install openssl readline | ||
| # See https://docs.travis-ci.com/user/osx-ci-environment/#A-note-on-upgrading-packages. | ||
| # I didn't do this above because it works and I'm lazy. | ||
| brew outdated pyenv || brew upgrade pyenv | ||
| # virtualenv doesn't work without pyenv knowledge. venv in Python 3.3 | ||
| # doesn't provide Pip by default. So, use `pyenv-virtualenv <https://github.com/yyuu/pyenv-virtualenv/blob/master/README.md>`_. | ||
| brew install pyenv-virtualenv | ||
| pyenv install $PYTHON | ||
| # I would expect something like ``pyenv init; pyenv local $PYTHON`` or | ||
| # ``pyenv shell $PYTHON`` would work, but ``pyenv init`` doesn't seem to | ||
| # modify the Bash environment. ??? So, I hand-set the variables instead. | ||
| export PYENV_VERSION=$PYTHON | ||
| export PATH="/Users/travis/.pyenv/shims:${PATH}" | ||
| pyenv-virtualenv venv | ||
| source venv/bin/activate | ||
| # A manual check that the correct version of Python is running. | ||
| python --version | ||
| fi | ||
| install: | ||
| - python -m pip install -U pip | ||
| - python -m easy_install -U setuptools | ||
| - pip install --upgrade setuptools pip wheel pipenv | ||
| - pipenv install --dev --system | ||
| script: | ||
| - python -m pytest --cov=./ | ||
| after_success: | ||
| - codecov | ||
| notifications: | ||
| email: | ||
| on_success: never | ||
| on_failure: change |
+34
| # Do not build feature branch with open Pull Requests | ||
| skip_branch_with_pr: true | ||
| environment: | ||
| SHELL: "windows" | ||
| matrix: | ||
| - PYTHON: "C:\\Python35" | ||
| PYTHON_VERSION: "3.5.x" | ||
| PYTHON_ARCH: "64" | ||
| - PYTHON: "C:\\Python27" | ||
| PYTHON_VERSION: "2.7.x" | ||
| PYTHON_ARCH: "64" | ||
| platform: | ||
| - x64 | ||
| install: | ||
| - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" | ||
| - "set PYTHONIOENCODING=utf-8" | ||
| - "python --version" | ||
| - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" | ||
| - "python -m pip install --upgrade pip wheel pipenv" | ||
| - "pipenv install --dev" | ||
| build: off | ||
| test_script: | ||
| - "pipenv run pytest" | ||
| # enable one day when pipenv works | ||
| # after_test: | ||
| # - "codecov" |
+1
| Dmitri Pribysh <dmand@yandex.ru> |
+34
| # Changelog | ||
| All notable changes to this project will be documented in this file. | ||
| The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
| and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
| ## [Unreleased] | ||
| ## 0.3.3 2018-08-06 | ||
| ### Added | ||
| - `get_stddev()` method now accepts `mean` argument (contributed by @undera) | ||
| ## 0.3.2 2018-07-07 | ||
| ### Fixed | ||
| - Performance improvements for `RecordedIterator` (contributed by @undera) | ||
| ## 0.3.1 2018-02-15 | ||
| ### Added | ||
| - Added `get_value_counts()` method to histogram API | ||
| ## 0.3 — 2018-02-12 | ||
| ### Fixed | ||
| - Fixed dependencies for PyPI package as they were missing | ||
| ## 0.2 — 2018-02-09 | ||
| ### Added | ||
| - Unit tests for HDR Histogram | ||
| ## 0.1 — 2018-02-08 | ||
| ### Added | ||
| - Initial fork of HDRHistogram_py | ||
| - C code is replaced with `numpy` dependency | ||
| import sys | ||
| from os.path import dirname as d | ||
| from os.path import abspath, join | ||
| root_dir = d(d(abspath(__file__))) | ||
| sys.path.append(root_dir) |
| {"is_release": false, "git_version": "c50b919"} |
+203
| Apache License | ||
| Version 2.0, January 2004 | ||
| http://www.apache.org/licenses/ | ||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | ||
| 1. Definitions. | ||
| "License" shall mean the terms and conditions for use, reproduction, | ||
| and distribution as defined by Sections 1 through 9 of this document. | ||
| "Licensor" shall mean the copyright owner or entity authorized by | ||
| the copyright owner that is granting the License. | ||
| "Legal Entity" shall mean the union of the acting entity and all | ||
| other entities that control, are controlled by, or are under common | ||
| control with that entity. For the purposes of this definition, | ||
| "control" means (i) the power, direct or indirect, to cause the | ||
| direction or management of such entity, whether by contract or | ||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | ||
| outstanding shares, or (iii) beneficial ownership of such entity. | ||
| "You" (or "Your") shall mean an individual or Legal Entity | ||
| exercising permissions granted by this License. | ||
| "Source" form shall mean the preferred form for making modifications, | ||
| including but not limited to software source code, documentation | ||
| source, and configuration files. | ||
| "Object" form shall mean any form resulting from mechanical | ||
| transformation or translation of a Source form, including but | ||
| not limited to compiled object code, generated documentation, | ||
| and conversions to other media types. | ||
| "Work" shall mean the work of authorship, whether in Source or | ||
| Object form, made available under the License, as indicated by a | ||
| copyright notice that is included in or attached to the work | ||
| (an example is provided in the Appendix below). | ||
| "Derivative Works" shall mean any work, whether in Source or Object | ||
| form, that is based on (or derived from) the Work and for which the | ||
| editorial revisions, annotations, elaborations, or other modifications | ||
| represent, as a whole, an original work of authorship. For the purposes | ||
| of this License, Derivative Works shall not include works that remain | ||
| separable from, or merely link (or bind by name) to the interfaces of, | ||
| the Work and Derivative Works thereof. | ||
| "Contribution" shall mean any work of authorship, including | ||
| the original version of the Work and any modifications or additions | ||
| to that Work or Derivative Works thereof, that is intentionally | ||
| submitted to Licensor for inclusion in the Work by the copyright owner | ||
| or by an individual or Legal Entity authorized to submit on behalf of | ||
| the copyright owner. For the purposes of this definition, "submitted" | ||
| means any form of electronic, verbal, or written communication sent | ||
| to the Licensor or its representatives, including but not limited to | ||
| communication on electronic mailing lists, source code control systems, | ||
| and issue tracking systems that are managed by, or on behalf of, the | ||
| Licensor for the purpose of discussing and improving the Work, but | ||
| excluding communication that is conspicuously marked or otherwise | ||
| designated in writing by the copyright owner as "Not a Contribution." | ||
| "Contributor" shall mean Licensor and any individual or Legal Entity | ||
| on behalf of whom a Contribution has been received by Licensor and | ||
| subsequently incorporated within the Work. | ||
| 2. Grant of Copyright License. Subject to the terms and conditions of | ||
| this License, each Contributor hereby grants to You a perpetual, | ||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
| copyright license to reproduce, prepare Derivative Works of, | ||
| publicly display, publicly perform, sublicense, and distribute the | ||
| Work and such Derivative Works in Source or Object form. | ||
| 3. Grant of Patent License. Subject to the terms and conditions of | ||
| this License, each Contributor hereby grants to You a perpetual, | ||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
| (except as stated in this section) patent license to make, have made, | ||
| use, offer to sell, sell, import, and otherwise transfer the Work, | ||
| where such license applies only to those patent claims licensable | ||
| by such Contributor that are necessarily infringed by their | ||
| Contribution(s) alone or by combination of their Contribution(s) | ||
| with the Work to which such Contribution(s) was submitted. If You | ||
| institute patent litigation against any entity (including a | ||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | ||
| or a Contribution incorporated within the Work constitutes direct | ||
| or contributory patent infringement, then any patent licenses | ||
| granted to You under this License for that Work shall terminate | ||
| as of the date such litigation is filed. | ||
| 4. Redistribution. You may reproduce and distribute copies of the | ||
| Work or Derivative Works thereof in any medium, with or without | ||
| modifications, and in Source or Object form, provided that You | ||
| meet the following conditions: | ||
| (a) You must give any other recipients of the Work or | ||
| Derivative Works a copy of this License; and | ||
| (b) You must cause any modified files to carry prominent notices | ||
| stating that You changed the files; and | ||
| (c) You must retain, in the Source form of any Derivative Works | ||
| that You distribute, all copyright, patent, trademark, and | ||
| attribution notices from the Source form of the Work, | ||
| excluding those notices that do not pertain to any part of | ||
| the Derivative Works; and | ||
| (d) If the Work includes a "NOTICE" text file as part of its | ||
| distribution, then any Derivative Works that You distribute must | ||
| include a readable copy of the attribution notices contained | ||
| within such NOTICE file, excluding those notices that do not | ||
| pertain to any part of the Derivative Works, in at least one | ||
| of the following places: within a NOTICE text file distributed | ||
| as part of the Derivative Works; within the Source form or | ||
| documentation, if provided along with the Derivative Works; or, | ||
| within a display generated by the Derivative Works, if and | ||
| wherever such third-party notices normally appear. The contents | ||
| of the NOTICE file are for informational purposes only and | ||
| do not modify the License. You may add Your own attribution | ||
| notices within Derivative Works that You distribute, alongside | ||
| or as an addendum to the NOTICE text from the Work, provided | ||
| that such additional attribution notices cannot be construed | ||
| as modifying the License. | ||
| You may add Your own copyright statement to Your modifications and | ||
| may provide additional or different license terms and conditions | ||
| for use, reproduction, or distribution of Your modifications, or | ||
| for any such Derivative Works as a whole, provided Your use, | ||
| reproduction, and distribution of the Work otherwise complies with | ||
| the conditions stated in this License. | ||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | ||
| any Contribution intentionally submitted for inclusion in the Work | ||
| by You to the Licensor shall be under the terms and conditions of | ||
| this License, without any additional terms or conditions. | ||
| Notwithstanding the above, nothing herein shall supersede or modify | ||
| the terms of any separate license agreement you may have executed | ||
| with Licensor regarding such Contributions. | ||
| 6. Trademarks. This License does not grant permission to use the trade | ||
| names, trademarks, service marks, or product names of the Licensor, | ||
| except as required for reasonable and customary use in describing the | ||
| origin of the Work and reproducing the content of the NOTICE file. | ||
| 7. Disclaimer of Warranty. Unless required by applicable law or | ||
| agreed to in writing, Licensor provides the Work (and each | ||
| Contributor provides its Contributions) on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
| implied, including, without limitation, any warranties or conditions | ||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | ||
| PARTICULAR PURPOSE. You are solely responsible for determining the | ||
| appropriateness of using or redistributing the Work and assume any | ||
| risks associated with Your exercise of permissions under this License. | ||
| 8. Limitation of Liability. In no event and under no legal theory, | ||
| whether in tort (including negligence), contract, or otherwise, | ||
| unless required by applicable law (such as deliberate and grossly | ||
| negligent acts) or agreed to in writing, shall any Contributor be | ||
| liable to You for damages, including any direct, indirect, special, | ||
| incidental, or consequential damages of any character arising as a | ||
| result of this License or out of the use or inability to use the | ||
| Work (including but not limited to damages for loss of goodwill, | ||
| work stoppage, computer failure or malfunction, or any and all | ||
| other commercial damages or losses), even if such Contributor | ||
| has been advised of the possibility of such damages. | ||
| 9. Accepting Warranty or Additional Liability. While redistributing | ||
| the Work or Derivative Works thereof, You may choose to offer, | ||
| and charge a fee for, acceptance of support, warranty, indemnity, | ||
| or other liability obligations and/or rights consistent with this | ||
| License. However, in accepting such obligations, You may act only | ||
| on Your own behalf and on Your sole responsibility, not on behalf | ||
| of any other Contributor, and only if You agree to indemnify, | ||
| defend, and hold each Contributor harmless for any liability | ||
| incurred by, or claims asserted against, such Contributor by reason | ||
| of your accepting any such warranty or additional liability. | ||
| END OF TERMS AND CONDITIONS | ||
| APPENDIX: How to apply the Apache License to your work. | ||
| To apply the Apache License to your work, attach the following | ||
| boilerplate notice, with the fields enclosed by brackets "{}" | ||
| replaced with your own identifying information. (Don't include | ||
| the brackets!) The text should be enclosed in the appropriate | ||
| comment syntax for the file format. We also recommend that a | ||
| file or class name and description of purpose be included on the | ||
| same "printed page" as the copyright notice for easier | ||
| identification within third-party archives. | ||
| Copyright {yyyy} {name of copyright owner} | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
+18
| [[source]] | ||
| url = "https://pypi.python.org/simple" | ||
| name = "pypi" | ||
| verify_ssl = true | ||
| [dev-packages] | ||
| pytest = ">=3.4.0" | ||
| codecov = ">=2.0.15" | ||
| pytest-cov = ">=2.5.1" | ||
| coverage = ">=4.5" | ||
| funcsigs = ">=1.0.2" | ||
| [packages] | ||
| numpy = ">=1.14.0" |
+203
| { | ||
| "_meta": { | ||
| "hash": { | ||
| "sha256": "a6073dbd0a0f9ad77e0e144caf6b59bd74b9ef0b438af458ed2f78fc98128450" | ||
| }, | ||
| "pipfile-spec": 6, | ||
| "requires": {}, | ||
| "sources": [ | ||
| { | ||
| "name": "pypi", | ||
| "url": "https://pypi.python.org/simple", | ||
| "verify_ssl": true | ||
| } | ||
| ] | ||
| }, | ||
| "default": { | ||
| "numpy": { | ||
| "hashes": [ | ||
| "sha256:07379fe0b450f6fd6e5934a9bc015025bb4ce1c8fbed3ca8bef29328b1bc9570", | ||
| "sha256:085afac75bbc97a096744fcfc97a4b321c5a87220286811e85089ae04885acdd", | ||
| "sha256:2d6481c6bdab1c75affc0fc71eb1bd4b3ecef620d06f2f60c3f00521d54be04f", | ||
| "sha256:2df854df882d322d5c23087a4959e145b953dfff2abe1774fec4f639ac2f3160", | ||
| "sha256:381ad13c30cd1d0b2f3da8a0c1a4aa697487e8bb0e9e0cbeb7439776bcb645f8", | ||
| "sha256:385f1ce46e08676505b692bfde918c1e0b350963a15ef52d77691c2cf0f5dbf6", | ||
| "sha256:4130e5ae16c656b7de654dc5e595cfeb85d3a4b0bb0734d19c0dce6dc7ee0e07", | ||
| "sha256:4d278c2261be6423c5e63d8f0ceb1b0c6db3ff83f2906f4b860db6ae99ca1bb5", | ||
| "sha256:51c5dcb51cf88b34b7d04c15f600b07c6ccbb73a089a38af2ab83c02862318da", | ||
| "sha256:589336ba5199c8061239cf446ee2f2f1fcc0c68e8531ee1382b6fc0c66b2d388", | ||
| "sha256:5ae3564cb630e155a650f4f9c054589848e97836bebae5637240a0d8099f817b", | ||
| "sha256:5edf1acc827ed139086af95ce4449b7b664f57a8c29eb755411a634be280d9f2", | ||
| "sha256:6b82b81c6b3b70ed40bc6d0b71222ebfcd6b6c04a6e7945a936e514b9113d5a3", | ||
| "sha256:6c57f973218b776195d0356e556ec932698f3a563e2f640cfca7020086383f50", | ||
| "sha256:758d1091a501fd2d75034e55e7e98bfd1370dc089160845c242db1c760d944d9", | ||
| "sha256:8622db292b766719810e0cb0f62ef6141e15fe32b04e4eb2959888319e59336b", | ||
| "sha256:8b8dcfcd630f1981f0f1e3846fae883376762a0c1b472baa35b145b911683b7b", | ||
| "sha256:91fdd510743ae4df862dbd51a4354519dd9fb8941347526cd9c2194b792b3da9", | ||
| "sha256:97fa8f1dceffab782069b291e38c4c2227f255cdac5f1e3346666931df87373e", | ||
| "sha256:9b705f18b26fb551366ab6347ba9941b62272bf71c6bbcadcd8af94d10535241", | ||
| "sha256:9d69967673ab7b028c2df09cae05ba56bf4e39e3cb04ebe452b6035c3b49848e", | ||
| "sha256:9e1f53afae865cc32459ad211493cf9e2a3651a7295b7a38654ef3d123808996", | ||
| "sha256:a4a433b3a264dbc9aa9c7c241e87c0358a503ea6394f8737df1683c7c9a102ac", | ||
| "sha256:baadc5f770917ada556afb7651a68176559f4dca5f4b2d0947cd15b9fb84fb51", | ||
| "sha256:c725d11990a9243e6ceffe0ab25a07c46c1cc2c5dc55e305717b5afe856c9608", | ||
| "sha256:d696a8c87315a83983fc59dd27efe034292b9e8ad667aeae51a68b4be14690d9", | ||
| "sha256:e1864a4e9f93ddb2dc6b62ccc2ec1f8250ff4ac0d3d7a15c8985dd4e1fbd6418", | ||
| "sha256:e1d18421a7e2ad4a655b76e65d549d4159f8874c18a417464c1d439ee7ccc7cd" | ||
| ], | ||
| "index": "pypi", | ||
| "version": "==1.14.5" | ||
| } | ||
| }, | ||
| "develop": { | ||
| "atomicwrites": { | ||
| "hashes": [ | ||
| "sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585", | ||
| "sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6" | ||
| ], | ||
| "version": "==1.1.5" | ||
| }, | ||
| "attrs": { | ||
| "hashes": [ | ||
| "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265", | ||
| "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" | ||
| ], | ||
| "version": "==18.1.0" | ||
| }, | ||
| "certifi": { | ||
| "hashes": [ | ||
| "sha256:13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7", | ||
| "sha256:9fa520c1bacfb634fa7af20a76bcbd3d5fb390481724c597da32c719a7dca4b0" | ||
| ], | ||
| "version": "==2018.4.16" | ||
| }, | ||
| "chardet": { | ||
| "hashes": [ | ||
| "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", | ||
| "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" | ||
| ], | ||
| "version": "==3.0.4" | ||
| }, | ||
| "codecov": { | ||
| "hashes": [ | ||
| "sha256:8ed8b7c6791010d359baed66f84f061bba5bd41174bf324c31311e8737602788", | ||
| "sha256:ae00d68e18d8a20e9c3288ba3875ae03db3a8e892115bf9b83ef20507732bed4" | ||
| ], | ||
| "index": "pypi", | ||
| "version": "==2.0.15" | ||
| }, | ||
| "coverage": { | ||
| "hashes": [ | ||
| "sha256:03481e81d558d30d230bc12999e3edffe392d244349a90f4ef9b88425fac74ba", | ||
| "sha256:0b136648de27201056c1869a6c0d4e23f464750fd9a9ba9750b8336a244429ed", | ||
| "sha256:198626739a79b09fa0a2f06e083ffd12eb55449b5f8bfdbeed1df4910b2ca640", | ||
| "sha256:28b2191e7283f4f3568962e373b47ef7f0392993bb6660d079c62bd50fe9d162", | ||
| "sha256:2eb564bbf7816a9d68dd3369a510be3327f1c618d2357fa6b1216994c2e3d508", | ||
| "sha256:337ded681dd2ef9ca04ef5d93cfc87e52e09db2594c296b4a0a3662cb1b41249", | ||
| "sha256:3a2184c6d797a125dca8367878d3b9a178b6fdd05fdc2d35d758c3006a1cd694", | ||
| "sha256:3c79a6f7b95751cdebcd9037e4d06f8d5a9b60e4ed0cd231342aa8ad7124882a", | ||
| "sha256:3d72c20bd105022d29b14a7d628462ebdc61de2f303322c0212a054352f3b287", | ||
| "sha256:3eb42bf89a6be7deb64116dd1cc4b08171734d721e7a7e57ad64cc4ef29ed2f1", | ||
| "sha256:4635a184d0bbe537aa185a34193898eee409332a8ccb27eea36f262566585000", | ||
| "sha256:56e448f051a201c5ebbaa86a5efd0ca90d327204d8b059ab25ad0f35fbfd79f1", | ||
| "sha256:5a13ea7911ff5e1796b6d5e4fbbf6952381a611209b736d48e675c2756f3f74e", | ||
| "sha256:69bf008a06b76619d3c3f3b1983f5145c75a305a0fea513aca094cae5c40a8f5", | ||
| "sha256:6bc583dc18d5979dc0f6cec26a8603129de0304d5ae1f17e57a12834e7235062", | ||
| "sha256:701cd6093d63e6b8ad7009d8a92425428bc4d6e7ab8d75efbb665c806c1d79ba", | ||
| "sha256:7608a3dd5d73cb06c531b8925e0ef8d3de31fed2544a7de6c63960a1e73ea4bc", | ||
| "sha256:76ecd006d1d8f739430ec50cc872889af1f9c1b6b8f48e29941814b09b0fd3cc", | ||
| "sha256:7aa36d2b844a3e4a4b356708d79fd2c260281a7390d678a10b91ca595ddc9e99", | ||
| "sha256:7d3f553904b0c5c016d1dad058a7554c7ac4c91a789fca496e7d8347ad040653", | ||
| "sha256:7e1fe19bd6dce69d9fd159d8e4a80a8f52101380d5d3a4d374b6d3eae0e5de9c", | ||
| "sha256:8c3cb8c35ec4d9506979b4cf90ee9918bc2e49f84189d9bf5c36c0c1119c6558", | ||
| "sha256:9d6dd10d49e01571bf6e147d3b505141ffc093a06756c60b053a859cb2128b1f", | ||
| "sha256:be6cfcd8053d13f5f5eeb284aa8a814220c3da1b0078fa859011c7fffd86dab9", | ||
| "sha256:c1bb572fab8208c400adaf06a8133ac0712179a334c09224fb11393e920abcdd", | ||
| "sha256:de4418dadaa1c01d497e539210cb6baa015965526ff5afc078c57ca69160108d", | ||
| "sha256:e05cb4d9aad6233d67e0541caa7e511fa4047ed7750ec2510d466e806e0255d6", | ||
| "sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80" | ||
| ], | ||
| "index": "pypi", | ||
| "version": "==4.5.1" | ||
| }, | ||
| "funcsigs": { | ||
| "hashes": [ | ||
| "sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca", | ||
| "sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" | ||
| ], | ||
| "index": "pypi", | ||
| "version": "==1.0.2" | ||
| }, | ||
| "idna": { | ||
| "hashes": [ | ||
| "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", | ||
| "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" | ||
| ], | ||
| "version": "==2.7" | ||
| }, | ||
| "more-itertools": { | ||
| "hashes": [ | ||
| "sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8", | ||
| "sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3", | ||
| "sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0" | ||
| ], | ||
| "version": "==4.2.0" | ||
| }, | ||
| "pluggy": { | ||
| "hashes": [ | ||
| "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff", | ||
| "sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c", | ||
| "sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5" | ||
| ], | ||
| "markers": "python_version != '3.3.*' and python_version != '3.2.*' and python_version != '3.0.*' and python_version != '3.1.*' and python_version >= '2.7'", | ||
| "version": "==0.6.0" | ||
| }, | ||
| "py": { | ||
| "hashes": [ | ||
| "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7", | ||
| "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e" | ||
| ], | ||
| "markers": "python_version != '3.3.*' and python_version != '3.2.*' and python_version != '3.0.*' and python_version != '3.1.*' and python_version >= '2.7'", | ||
| "version": "==1.5.4" | ||
| }, | ||
| "pytest": { | ||
| "hashes": [ | ||
| "sha256:0453c8676c2bee6feb0434748b068d5510273a916295fd61d306c4f22fbfd752", | ||
| "sha256:4b208614ae6d98195430ad6bde03641c78553acee7c83cec2e85d613c0cd383d" | ||
| ], | ||
| "index": "pypi", | ||
| "version": "==3.6.3" | ||
| }, | ||
| "pytest-cov": { | ||
| "hashes": [ | ||
| "sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d", | ||
| "sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec" | ||
| ], | ||
| "index": "pypi", | ||
| "version": "==2.5.1" | ||
| }, | ||
| "requests": { | ||
| "hashes": [ | ||
| "sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1", | ||
| "sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a" | ||
| ], | ||
| "markers": "python_version < '4' and python_version != '3.0.*' and python_version >= '2.6' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.1.*'", | ||
| "version": "==2.19.1" | ||
| }, | ||
| "six": { | ||
| "hashes": [ | ||
| "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", | ||
| "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" | ||
| ], | ||
| "version": "==1.11.0" | ||
| }, | ||
| "urllib3": { | ||
| "hashes": [ | ||
| "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf", | ||
| "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5" | ||
| ], | ||
| "markers": "python_version < '4' and python_version != '3.0.*' and python_version >= '2.6' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.1.*'", | ||
| "version": "==1.23" | ||
| } | ||
| } | ||
| } |
| from hdrpy import HdrHistogram | ||
| from unittest import TestCase | ||
| class TestHdrHistogram(TestCase): | ||
| def test_empty(self): | ||
| hdr = HdrHistogram(1, 1 * 60 * 60 * 1000, 3) | ||
| self.assertEqual(hdr.get_min_value(), 0) | ||
| self.assertEqual(hdr.get_max_value(), 0) | ||
| self.assertEqual(hdr.get_mean_value(), 0) | ||
| self.assertEqual(hdr.get_stddev(), 0) | ||
| def test_large_numbers(self): | ||
| histogram = HdrHistogram(20000000, 100000000, 5) | ||
| histogram.record_value(100000000) | ||
| histogram.record_value(20000000) | ||
| histogram.record_value(30000000) | ||
| self.assertTrue(histogram.values_are_equivalent(20000000, histogram.get_value_at_percentile(50.0))) | ||
| self.assertTrue(histogram.values_are_equivalent(30000000, histogram.get_value_at_percentile(83.33))) | ||
| self.assertTrue(histogram.values_are_equivalent(100000000, histogram.get_value_at_percentile(83.34))) | ||
| self.assertTrue(histogram.values_are_equivalent(100000000, histogram.get_value_at_percentile(99.0))) | ||
| def test_record_value(self): | ||
| histogram = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| histogram.record_value(4) | ||
| self.assertEqual(histogram.get_count_at_value(4), 1) | ||
| self.assertEqual(histogram.get_total_count(), 1) | ||
| def test_highest_equavalent_value(self): | ||
| histogram = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| self.assertEqual(8183 * 1024 + 1023, histogram.get_highest_equivalent_value(8180 * 1024)) | ||
| self.assertEqual(8191 * 1024 + 1023, histogram.get_highest_equivalent_value(8191 * 1024)) | ||
| self.assertEqual(8199 * 1024 + 1023, histogram.get_highest_equivalent_value(8193 * 1024)) | ||
| self.assertEqual(9999 * 1024 + 1023, histogram.get_highest_equivalent_value(9995 * 1024)) | ||
| self.assertEqual(10007 * 1024 + 1023, histogram.get_highest_equivalent_value(10007 * 1024)) | ||
| self.assertEqual(10015 * 1024 + 1023, histogram.get_highest_equivalent_value(10008 * 1024)) | ||
| def test_scaled_highest_equiv_value(self): | ||
| histogram = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| self.assertEqual(histogram.get_highest_equivalent_value(8180), 8183) | ||
| self.assertEqual(histogram.get_highest_equivalent_value(8191), 8191) | ||
| self.assertEqual(histogram.get_highest_equivalent_value(8193), 8199) | ||
| self.assertEqual(histogram.get_highest_equivalent_value(9995), 9999) | ||
| self.assertEqual(histogram.get_highest_equivalent_value(10007), 10007) | ||
| self.assertEqual(histogram.get_highest_equivalent_value(10008), 10015) | ||
| def load_histogram(self): | ||
| histogram = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| # record this value with a count of 10,000 | ||
| histogram.record_value(1000, 10000) | ||
| histogram.record_value(100000000) | ||
| return histogram | ||
| def load_corrected_histogram(self): | ||
| histogram = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| # record this value with a count of 10,000 | ||
| histogram.record_corrected_value(1000, 10000, 10000) | ||
| histogram.record_corrected_value(100000000, 10000) | ||
| return histogram | ||
| def check_percentile(self, hist, percentile, value, variation): | ||
| value_at = hist.get_value_at_percentile(percentile) | ||
| self.assertLess(abs(value_at - value), value * variation) | ||
| def check_hist_percentiles(self, hist, total_count, perc_value_list): | ||
| for pair in perc_value_list: | ||
| self.check_percentile(hist, pair[0], pair[1], 0.001) | ||
| self.assertEqual(hist.get_total_count(), total_count) | ||
| self.assertTrue(hist.values_are_equivalent(hist.get_min_value(), 1000.0)) | ||
| self.assertTrue(hist.values_are_equivalent(hist.get_max_value(), 100000000.0)) | ||
| def test_percentiles(self): | ||
| self.check_hist_percentiles(self.load_histogram(), | ||
| 10001, | ||
| ((30.0, 1000.0), | ||
| (99.0, 1000.0), | ||
| (99.99, 1000.0), | ||
| (99.999, 100000000.0), | ||
| (100.0, 100000000.0))) | ||
| self.check_hist_percentiles(self.load_corrected_histogram(), | ||
| 20000, | ||
| ((30.0, 1000.0), | ||
| (50.0, 1000.0), | ||
| (75.0, 50000000.0), | ||
| (90.0, 80000000.0), | ||
| (99.0, 98000000.0), | ||
| (99.999, 100000000.0), | ||
| (100.0, 100000000.0))) | ||
| def test_recorded_iterator(self): | ||
| hist = self.load_histogram() | ||
| index = 0 | ||
| for item in hist.get_recorded_iterator(): | ||
| count_added_in_this_bucket = item.count_added_in_this_iter_step | ||
| if index == 0: | ||
| self.assertEqual(count_added_in_this_bucket, 10000) | ||
| else: | ||
| self.assertEqual(count_added_in_this_bucket, 1) | ||
| index += 1 | ||
| self.assertEqual(index, 2) | ||
| hist = self.load_corrected_histogram() | ||
| index = 0 | ||
| total_added_count = 0 | ||
| for item in hist.get_recorded_iterator(): | ||
| count_added_in_this_bucket = item.count_added_in_this_iter_step | ||
| if index == 0: | ||
| self.assertEqual(count_added_in_this_bucket, 10000) | ||
| self.assertNotEqual(item.count_at_value_iterated_to, 0) | ||
| total_added_count += count_added_in_this_bucket | ||
| index += 1 | ||
| self.assertEqual(total_added_count, 20000) | ||
| self.assertEqual(total_added_count, hist.get_total_count()) | ||
| def test_reset(self): | ||
| histogram = self.load_histogram() | ||
| histogram.reset() | ||
| self.assertEqual(histogram.get_total_count(), 0) | ||
| self.assertEqual(histogram.get_value_at_percentile(99.99), 0) | ||
| def test_invalid_significant_figures(self): | ||
| self.assertRaises(ValueError, lambda: HdrHistogram(1, 100, -1)) | ||
| self.assertRaises(ValueError, lambda: HdrHistogram(1, 100, 6)) | ||
| def test_out_of_range_values(self): | ||
| histogram = HdrHistogram(1, 1000, 4) | ||
| self.assertTrue(histogram.record_value(32767)) | ||
| self.assertFalse(histogram.record_value(32768)) | ||
| def test_mean_stddev(self): | ||
| # fill up a histogram with the values in the list | ||
| histogram = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| for value in [1000, 1000, 3000, 3000]: | ||
| histogram.record_value(value) | ||
| self.assertEqual(histogram.get_mean_value(), 2000.5) | ||
| self.assertEqual(histogram.get_stddev(), 1000.5) | ||
| self.assertEqual(histogram.get_stddev(2000.5), 1000.5) | ||
| def test_get_value_at_percentile(self): | ||
| histogram = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| histogram.record_value(1) | ||
| histogram.record_value(2) | ||
| self.assertEqual(histogram.get_value_at_percentile(50.0), 1) | ||
| histogram.record_value(2) | ||
| histogram.record_value(2) | ||
| histogram.record_value(2) | ||
| self.assertEqual(histogram.get_value_at_percentile(30), 2) | ||
| def test_add(self): | ||
| hist1 = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| hist1.record_value(1, count=100) | ||
| hist1.record_value(2, count=100) | ||
| hist2 = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| hist2.record_value(1, count=100) | ||
| hist2.record_value(2, count=200) | ||
| self.assertEqual(hist1.get_value_at_percentile(50.0), 1) | ||
| self.assertEqual(hist2.get_value_at_percentile(50.0), 2) | ||
| hist1.add(hist2) | ||
| self.assertEqual(hist1.get_value_at_percentile(50.0), 2) | ||
| def test_percentile_dict(self): | ||
| hist = HdrHistogram(1, 3600 * 1000 * 1000, 3) | ||
| for i in range(1, 10000): | ||
| hist.record_value(i, 10000 - i) | ||
| percentiles = [0.0, 50.0, 90.0, 95.0, 99.0, 100.0] | ||
| values = hist.get_percentile_to_value_dict(percentiles) | ||
| expected = {0.0: 1, 50.0: 2929, 99.0: 9007, 100.0: 9999, 90.0: 6839, 95.0: 7767} | ||
| self.assertEqual(values, expected) | ||
| def test_value_counts(self): | ||
| hist = HdrHistogram(1, 1000, 3) | ||
| counts = {10: 100, 20: 200, 30: 300} | ||
| for value, count in counts.items(): | ||
| hist.record_value(value, count) | ||
| recovered_counts = hist.get_value_counts() | ||
| self.assertEqual(recovered_counts, counts) |
| Metadata-Version: 1.1 | ||
| Name: hdrpy | ||
| Version: 0.3.2 | ||
| Version: 0.3.3 | ||
| Summary: HDR histogram implementation based on numpy | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/dmand/hdrpy |
@@ -0,2 +1,10 @@ | ||
| .travis.yml | ||
| AUTHORS | ||
| CHANGELOG.md | ||
| LICENSE | ||
| Pipfile | ||
| Pipfile.lock | ||
| README.rst | ||
| appveyor.yml | ||
| conftest.py | ||
| setup.cfg | ||
@@ -8,3 +16,5 @@ setup.py | ||
| hdrpy.egg-info/dependency_links.txt | ||
| hdrpy.egg-info/pbr.json | ||
| hdrpy.egg-info/requires.txt | ||
| hdrpy.egg-info/top_level.txt | ||
| hdrpy.egg-info/top_level.txt | ||
| tests/test_hdrpy.py |
@@ -493,6 +493,9 @@ """ | ||
| def get_stddev(self): | ||
| def get_stddev(self, mean=None): | ||
| if not self.total_count: | ||
| return 0.0 | ||
| mean = self.get_mean_value() | ||
| if mean is None: | ||
| mean = self.get_mean_value() | ||
| geometric_dev_total = 0.0 | ||
@@ -499,0 +502,0 @@ for item in self.get_recorded_iterator(): |
+1
-1
| Metadata-Version: 1.1 | ||
| Name: hdrpy | ||
| Version: 0.3.2 | ||
| Version: 0.3.3 | ||
| Summary: HDR histogram implementation based on numpy | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/dmand/hdrpy |
+1
-1
@@ -7,3 +7,3 @@ from setuptools import setup | ||
| name="hdrpy", | ||
| version="0.3.2", | ||
| version="0.3.3", | ||
| description="HDR histogram implementation based on numpy", | ||
@@ -10,0 +10,0 @@ author="Dmitri Pribysh", |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
62117
126.41%20
100%657
32.46%