Skip to main content

A package to compare the execution times of two Python scripts.

Reason this release was yanked:

Two bugs fixed in the next version.

Project description

The compare function is designed to compare the execution speed of different Python functions on a set of files. It takes three arguments:

  1. FILEPATHS (List of Strings): This argument accepts a list of file paths. Each file path should point to a Python file that you want to analyze.

  2. FUNCTIONS (String or List of Strings): This argument can be either a single function name (as a string) or a list of function names (as a list of strings). If you pass a single function name, it will be applied to all files. If you pass a list of function names, the number of function names should match the number of files.

  3. ARGS (List of Strings, Tuple, or List of Tuples): This argument can be one argument (as a string), one argument (as a tuple), or multiple arguments (as a list of tuples). If you pass a single argument, it will be applied to all functions. If you pass multiple arguments, the number of arguments should match the number of functions, and each argument should be passed as a tuple.

Here is an example of how to use the compare function:

compare(["file1.py", "file2.py"], "my_function", [("arg1",), ("arg2",)])

In this example, the compare function will apply the my_function function with the arguments arg1 and arg2 to the files file1.py and file2.py, respectively.

When comparing multiple files that perform similar tasks, it's important to note that they may have slight differences. Here's a suggested approach:

  • File Selection: Select the files you wish to compare.
  • Function Identification: Verify if the functions within these files have similar names. If not, create a list that maps the functions to their corresponding files based on their positioning.
  • Argument Verification: Check if there are any arguments that need to be passed to these functions.

  • EXAMPLES
compareSpeed(["test3.py", "test4.py"], 
           ["my_function", "word_function"], 
           [("tst3", 4, 7, 9), ("tst4", 4, 9, 7)])
compareSpeed(["metadata_extractor_v1.py", "metadata_extractor_v2.py"], 
           ["get_metadata", "getMetadata"], 
           "https://www.coursera.org/learn/machine-learning-with-python")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tympy-0.0.12.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tympy-0.0.12-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file tympy-0.0.12.tar.gz.

File metadata

  • Download URL: tympy-0.0.12.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for tympy-0.0.12.tar.gz
Algorithm Hash digest
SHA256 de0d7e57925fc08fd5f23ae4e3b1a0acdc008f2fe89838361974077ef84a599b
MD5 37dedbf8d1081b3824773d17f22e4a08
BLAKE2b-256 e84038116b05af0ad3f9ec7da3082ebe37ddd8bd721b5055e0661563b2bdada1

See more details on using hashes here.

File details

Details for the file tympy-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: tympy-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for tympy-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 b9319a1a47e3af52b8d2205876404ae72ef19a566df9c1675cb8651fab1c1a8c
MD5 8abecc4d6d4c09054ec30e2a405e7371
BLAKE2b-256 001a2ffb7a452379961357bfdfd210699f160ce62f9f1730aa67c72d5184fc30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page