hdrpy
Advanced tools
| Metadata-Version: 1.1 | ||
| Name: hdrpy | ||
| Version: 0.3.1 | ||
| Version: 0.3.2 | ||
| Summary: HDR histogram implementation based on numpy | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/dmand/hdrpy |
@@ -1,10 +0,2 @@ | ||
| .travis.yml | ||
| AUTHORS | ||
| CHANGELOG.md | ||
| LICENSE | ||
| Pipfile | ||
| Pipfile.lock | ||
| README.rst | ||
| appveyor.yml | ||
| conftest.py | ||
| setup.cfg | ||
@@ -16,5 +8,3 @@ setup.py | ||
| hdrpy.egg-info/dependency_links.txt | ||
| hdrpy.egg-info/pbr.json | ||
| hdrpy.egg-info/requires.txt | ||
| hdrpy.egg-info/top_level.txt | ||
| tests/test_hdrpy.py | ||
| hdrpy.egg-info/top_level.txt |
@@ -208,8 +208,3 @@ """ | ||
| def has_next(self): | ||
| if self.total_count != self.histogram.total_count: | ||
| raise HdrConcurrentModificationException() | ||
| return self.current_index < self.histogram.counts_len - 1 | ||
| class HdrHistogram(object): | ||
@@ -216,0 +211,0 @@ """ |
+1
-1
| Metadata-Version: 1.1 | ||
| Name: hdrpy | ||
| Version: 0.3.1 | ||
| Version: 0.3.2 | ||
| Summary: HDR histogram implementation based on numpy | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/dmand/hdrpy |
+15
-0
@@ -0,1 +1,4 @@ | ||
| |pypi-version| |pypi-python| |travis-build| |appveyor-build| |pypi-license-apache| | ||
| hdrpy | ||
@@ -9,2 +12,4 @@ ===== | ||
| Technically, it can be considered a fork of | ||
@@ -15,1 +20,11 @@ `hdrhistogram <https://github.com/HdrHistogram/HdrHistogram_py/>`__ with | ||
| involved. | ||
| .. |pypi-python| image:: https://img.shields.io/pypi/pyversions/hdrpy.svg | ||
| .. |pypi-version| image:: https://img.shields.io/pypi/v/hdrpy.svg | ||
| .. |travis-build| image:: https://img.shields.io/travis/dmand/hdrpy.svg | ||
| .. |appveyor-build| image:: https://img.shields.io/appveyor/ci/dmand/hdrpy.svg | ||
| .. |pypi-license-apache| image:: https://img.shields.io/appveyor/ci/dmand/hdrpy.svg | ||
| :trim: |
+0
-1
@@ -23,3 +23,2 @@ [metadata] | ||
| tag_date = 0 | ||
| tag_svn_revision = 0 | ||
+1
-1
@@ -7,3 +7,3 @@ from setuptools import setup | ||
| name="hdrpy", | ||
| version="0.3.1", | ||
| version="0.3.2", | ||
| description="HDR histogram implementation based on numpy", | ||
@@ -10,0 +10,0 @@ author="Dmitri Pribysh", |
-31
| 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 | ||
| install: | ||
| - 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 |
-35
| # 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)\"" | ||
| - "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> |
-26
| # 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.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" | ||
| [packages] | ||
| numpy = ">=1.14.0" |
-193
| { | ||
| "_meta": { | ||
| "hash": { | ||
| "sha256": "c773f0a900b3f8c17d6c296fc415c4189a66fe2adfa98cb65d9cee1b05a27893" | ||
| }, | ||
| "host-environment-markers": { | ||
| "implementation_name": "cpython", | ||
| "implementation_version": "3.5.2", | ||
| "os_name": "posix", | ||
| "platform_machine": "x86_64", | ||
| "platform_python_implementation": "CPython", | ||
| "platform_release": "4.4.0-109-generic", | ||
| "platform_system": "Linux", | ||
| "platform_version": "#132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018", | ||
| "python_full_version": "3.5.2", | ||
| "python_version": "3.5", | ||
| "sys_platform": "linux" | ||
| }, | ||
| "pipfile-spec": 6, | ||
| "requires": {}, | ||
| "sources": [ | ||
| { | ||
| "name": "pypi", | ||
| "url": "https://pypi.python.org/simple", | ||
| "verify_ssl": true | ||
| } | ||
| ] | ||
| }, | ||
| "default": { | ||
| "numpy": { | ||
| "hashes": [ | ||
| "sha256:428cd3c0b197cf857671353d8c85833193921af9fafcc169a1f29c7185833d50", | ||
| "sha256:a476e437d73e5754aa66e1e75840d0163119c3911b7361f4cd06985212a3c3fb", | ||
| "sha256:289ff717138cd9aa133adcbd3c3e284458b9c8230db4d42b39083a3407370317", | ||
| "sha256:c5eccb4bf96dbb2436c61bb3c2658139e779679b6ae0d04c5e268e6608b58053", | ||
| "sha256:75471acf298d455b035226cc609a92aee42c4bb6aa71def85f77fa2c2b646b61", | ||
| "sha256:5c54fb98ecf42da59ed93736d1c071842482b18657eb16ba6e466bd873e1b923", | ||
| "sha256:9ddf384ac3aacb72e122a8207775cc29727cbd9c531ee1a4b95754f24f42f7f3", | ||
| "sha256:781d3197da49c421a07f250750de70a52c42af08ca02a2f7bdb571c0625ae7eb", | ||
| "sha256:93b26d6c06a22e64d56aaca32aaaffd27a4143db0ac2f21a048f0b571f2bfc55", | ||
| "sha256:b2547f57d05ba59df4289493254f29f4c9082d255f1f97b7e286f40f453e33a1", | ||
| "sha256:eef6af1c752eef538a96018ef9bdf8e37bbf28aab50a1436501a4aa47a6467df", | ||
| "sha256:ff8a4b2c3ac831964f529a2da506c28d002562b230261ae5c16885f5f53d2e75", | ||
| "sha256:194074058c22a4066e1b6a4ea432486ee468d24ab16f13630c1030409e6b8666", | ||
| "sha256:4e13f1a848fde960dea33702770265837c72b796a6a3eaac7528cfe75ddefadd", | ||
| "sha256:91101216d72749df63968d86611b549438fb18af2c63849c01f9a897516133c7", | ||
| "sha256:97507349abb7d1f6b76b877258defe8720833881dc7e7fd052bac90c88587387", | ||
| "sha256:1479b46b6040b5c689831496354c8859c456b152d37315673a0c18720b41223b", | ||
| "sha256:98b1ac79c160e36093d7914244e40ee1e7164223e795aa2c71dcce367554e646", | ||
| "sha256:24bbec9a199f938eab75de8390f410969bc33c218e5430fa1ae9401b00865255", | ||
| "sha256:7880f412543e96548374a4bb1d75e4cdb8cad80f3a101ed0f8d0e0428f719c1c", | ||
| "sha256:6112f152b76a28c450bbf665da11757078a724a90330112f5b7ea2d6b6cefd67", | ||
| "sha256:7c5276763646480143d5f3a6c2acb2885460c765051a1baf4d5070f63d05010f", | ||
| "sha256:3de643935b212307b420248018323a44ec51987a336d1d747c1322afc3c099fb" | ||
| ], | ||
| "version": "==1.14.0" | ||
| } | ||
| }, | ||
| "develop": { | ||
| "attrs": { | ||
| "hashes": [ | ||
| "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450", | ||
| "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9" | ||
| ], | ||
| "version": "==17.4.0" | ||
| }, | ||
| "certifi": { | ||
| "hashes": [ | ||
| "sha256:14131608ad2fd56836d33a71ee60fa1c82bc9d2c8d98b7bdbc631fe1b3cd1296", | ||
| "sha256:edbc3f203427eef571f79a7692bb160a2b0f7ccaa31953e99bd17e307cf63f7d" | ||
| ], | ||
| "version": "==2018.1.18" | ||
| }, | ||
| "chardet": { | ||
| "hashes": [ | ||
| "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691", | ||
| "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" | ||
| ], | ||
| "version": "==3.0.4" | ||
| }, | ||
| "codecov": { | ||
| "hashes": [ | ||
| "sha256:ae00d68e18d8a20e9c3288ba3875ae03db3a8e892115bf9b83ef20507732bed4", | ||
| "sha256:8ed8b7c6791010d359baed66f84f061bba5bd41174bf324c31311e8737602788" | ||
| ], | ||
| "version": "==2.0.15" | ||
| }, | ||
| "coverage": { | ||
| "hashes": [ | ||
| "sha256:464d85d6959497cc4adfa9f0d36fca809e2ca7ec5f4625f548317892cac6ed7c", | ||
| "sha256:e958ab5b6a7f3b88289a25c95d031f2b62bc73219141c09d261fd97f244c124c", | ||
| "sha256:67288f8834a0a64c1af66286b22fd325b5524ceaa153a51c3e2e30f7e8b3f826", | ||
| "sha256:cfb6b7035c6605e2a87abe7d84ea35a107e6c432014a3f1ca243ab57a558fbcd", | ||
| "sha256:c86a12b3dc004bcbe97a3849354bd1f93eb6fb69b0e4eb58831fd7adba7740ec", | ||
| "sha256:8ddcf308f894d01a1a0ae01283d19b613751815b7190113266a0b7f9d076e86d", | ||
| "sha256:adab01e4c63a01bdf036f57f0114497994aa2195d8659d12a3d69673c3f27939", | ||
| "sha256:54d73fe68a7ac9c847af69a234a7461bbaf3cad95f258317d4584d14dd53f679", | ||
| "sha256:a0d98c71d026c1757c7393a99d24c6e42091ff41e20e68238b17e145252c2d0a", | ||
| "sha256:464e0eda175c7fe2dc730d9d02acde5b8a8518d9417413dee6ca187d1f65ef89", | ||
| "sha256:2890cb40464686c0c1dccc1223664bbc34d85af053bc5dbcd71ea13959e264f2", | ||
| "sha256:0f2315c793b1360f80a9119fff76efb7b4e5ab5062651dff515e681719f29689", | ||
| "sha256:85c028e959312285225040cdac5ad3db6189e958a234f09ae6b4ba5f539c842d", | ||
| "sha256:da6585339fc8a25086003a2b2c0167438b8ab0cd0ccae468d22ed603e414bba1", | ||
| "sha256:e837865a7b20c01a8a2f904c05fba36e8406b146649ff9174cbddf32e217b777", | ||
| "sha256:b718efb33097c7651a60a03b4b38b14776f92194bc0e9e598ce05ddaef7c70e7", | ||
| "sha256:7413f078fbba267de44814584593a729f88fc37f2d938263844b7f4daf1e36ec", | ||
| "sha256:47ad00a0c025f87a7528cc13d013c54e4691ae8730430e49ec9c7ace7e0e1fba", | ||
| "sha256:95f9f5072afeb2204401401cbd0ab978a9f86ef1ebc5cd267ba431cfa581cc4d", | ||
| "sha256:ca8827a5dad1176a8da6bf5396fd07e66549d1bc842047b76cdf69e196597a80", | ||
| "sha256:c68164c4f49cfc2e66ca1ded62e4a1092a6bd4b2c65222059b867700ad19151c", | ||
| "sha256:61e0bcf15aa0385e15d1fe4a86022a6b813d08c785855e3fab56ba6d7ac3dd21", | ||
| "sha256:981a64063242a2c6c88dda33ccafe3583026847961fe56636b6a00c47674e258", | ||
| "sha256:21e47d2ff9c75e25880dd12b316db11379e9afc98b39e9516149d189c15c564b", | ||
| "sha256:f6b822c68f68f48d480d23fcfcd1d4df7d42ff03cf5d7b574d09e662c0b95b43", | ||
| "sha256:53fa7aa7643a22eeadcf8b781b97a51f37d43ba1d897a05238aa7e4d11bc0667", | ||
| "sha256:95ce1a70323d47c0f6b8d6cfd3c14c38cb30d51fd1ab4f6414734fa33a78b17e", | ||
| "sha256:b7a06a523dfeaf417da630d46ad4f4e11ca1bae6202c9312c4cb987dde5792fc", | ||
| "sha256:585e8db44b8f3af2a4152b00dd8a7a36bc1d2aba7de5e50fc17a54178428f0d6", | ||
| "sha256:102933e14b726bd4fdfafb541e122ad36c150732aee36db409d8c8766e11537e", | ||
| "sha256:15f92238487d93f7f34a3ba03be3bd4615c69cffc88388b4dd1ea99af74fc1bf", | ||
| "sha256:319190dd7fa08c23332215782b563a9ef12b76fb15e4a325915592b825eca9ed", | ||
| "sha256:af14e9628c0a3152b6a1fbba4471e6a3e5f5567ecae614f84b84ff3441c58692", | ||
| "sha256:72bc3f91a25a87fd87eb57983c8cefbb8aa5bacd50d73516ade398271d652d77", | ||
| "sha256:c3905f10786dcf386f3f6cebe0ae4a36f47e5e256471161fb944ca537e97e928", | ||
| "sha256:3344079d73a4849341aaaecd9b391141824b8c9a96732fbd6ef95ba9566895d3" | ||
| ], | ||
| "version": "==4.5" | ||
| }, | ||
| "funcsigs": { | ||
| "hashes": [ | ||
| "sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca", | ||
| "sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" | ||
| ], | ||
| "markers": "python_version < '3.0'", | ||
| "version": "==1.0.2" | ||
| }, | ||
| "idna": { | ||
| "hashes": [ | ||
| "sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4", | ||
| "sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f" | ||
| ], | ||
| "version": "==2.6" | ||
| }, | ||
| "pluggy": { | ||
| "hashes": [ | ||
| "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff" | ||
| ], | ||
| "version": "==0.6.0" | ||
| }, | ||
| "py": { | ||
| "hashes": [ | ||
| "sha256:8cca5c229d225f8c1e3085be4fcf306090b00850fefad892f9d96c7b6e2f310f", | ||
| "sha256:ca18943e28235417756316bfada6cd96b23ce60dd532642690dcfdaba988a76d" | ||
| ], | ||
| "version": "==1.5.2" | ||
| }, | ||
| "pytest": { | ||
| "hashes": [ | ||
| "sha256:95fa025cd6deb5d937e04e368a00552332b58cae23f63b76c8c540ff1733ab6d", | ||
| "sha256:6074ea3b9c999bd6d0df5fa9d12dd95ccd23550df2a582f5f5b848331d2e82ca" | ||
| ], | ||
| "version": "==3.4.0" | ||
| }, | ||
| "pytest-cov": { | ||
| "hashes": [ | ||
| "sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec", | ||
| "sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d" | ||
| ], | ||
| "version": "==2.5.1" | ||
| }, | ||
| "requests": { | ||
| "hashes": [ | ||
| "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", | ||
| "sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" | ||
| ], | ||
| "version": "==2.18.4" | ||
| }, | ||
| "six": { | ||
| "hashes": [ | ||
| "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", | ||
| "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" | ||
| ], | ||
| "version": "==1.11.0" | ||
| }, | ||
| "urllib3": { | ||
| "hashes": [ | ||
| "sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b", | ||
| "sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f" | ||
| ], | ||
| "version": "==1.22" | ||
| } | ||
| } | ||
| } |
| 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) | ||
| 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) |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
27436
-53.72%10
-50%496
-24.73%