Metadata-Version: 2.1
Name: timethese
Version: 0.0.4
Summary: timeit for multiple functions with better reporting
Home-page: https://github.com/jwbargsten/python-timethese
Author: Joachim W. Bargsten
Author-email: jw@bargsten.org
License: MIT
Project-URL: Issue Tracker, https://github.com/jwbargsten/python-timethese/issues
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
Requires-Python: >=3.5
Requires-Dist: more-itertools (>=8.2.0)

========
Overview
========



timeit for multiple functions with better reporting

* Free software: MIT License

Installation
============

::

    pip install timethese

You can also install the in-development version with::

    pip install https://github.com/jwbargsten/python-timethese/archive/master.zip


Usage
=====

To use TimeThese in a project::

      from timethese import cmpthese, pprint_cmp, timethese

      xs = range(10)


      def map_hex():
          list(map(hex, xs))


      def list_compr_hex():
          list([hex(x) for x in xs])


      def map_lambda():
          list(map(lambda x: x + 2, xs))


      def map_lambda_fn():
          fn = lambda x: x + 2
          list(map(fn, xs))


      def list_compr_nofn():
          list([x + 2 for x in xs])


      cmp_res_dict = cmpthese(
          10000,
          {
              "map_hex": map_hex,
              "list_compr_hex": list_compr_hex,
              "map_lambda": map_lambda,
              "map_lambda_fn": map_lambda_fn,
              "list_compr_nofn": list_compr_nofn,
          },
          repeat=3,
      )

      print(pprint_cmp(cmp_res_dict))


      cmp_res_list = cmpthese(
          10000, [map_hex, list_compr_hex, map_lambda, map_lambda_fn, list_compr_nofn,], repeat=3,
      )

      print(pprint_cmp(cmp_res_list))


Development
===========

To run the all tests run::

    tox

Note, to combine the coverage data from all the tox environments run:

.. list-table::
    :widths: 10 90
    :stub-columns: 1

    - - Windows
      - ::

            set PYTEST_ADDOPTS=--cov-append
            tox

    - - Other
      - ::

            PYTEST_ADDOPTS=--cov-append tox


Changelog
=========

0.0.4 (2020-05-30)
------------------

* Fixed code to be compatible with python 3.5
* Fixed travis stuff
* Added decorators to time specific functions for pandas.DataFrame.pipe arguments


0.0.3 (2020-05-27)
------------------

* First release on PyPI.


