The compare function is designed to compare the execution speed of different Python functions on a set of files. It takes three arguments:
-
FILES(List of Strings): This argument accepts a list of file names. Each file should point to a Python file that you want to run. -
FUNCTIONS(Single 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. -
ARGS(Single String, 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:
First install and import the package:
import tympy as TO
Example 1: Compare Execution Speed of Multiple Functions in Multiple Files
TO.compare(["example_1.py", "example_2.py", "example_3.py"],
["sum", "SuM", "SuMIT"],
[(5, 9), (9, 5), (5, 9)])
Example 2: Compare Execution Speed of a Single Function Across Multiple Files
TO.compare(["example_1.py", "example_2.py"],
"subtract",
[(5, 9), (9, 5)])
Example 3: Compare Execution Speed of Multiple Functions with Single Argument
TO.compare(["example_1.py", "example_3.py"],
["sum", "SuMIT"],
(5, 9))
Example 4: Compare Execution Speed of Multiple Functions with Single String Argument
TO.compare(["example_1.py", "example_2.py"],
["printNOW", "printNoW"],
"Hello World!")
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.
Metadata
Release files for tympy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tympy-0.1.1.tar.gz | 4.3 kB | Without provenance | Details for tympy-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tympy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for tympy-0.1.1-py3-none-any.whl |
Total release size: 8.3 kB
Release files / tympy-0.1.1.tar.gz
| Download URL | tympy-0.1.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f61fcb14d8ebd186d5b1946bfc6d537be6a1e7ef7d9f682feb3170f06bd2b448
|
|
BLAKE2b-256 checksum How to use checksums |
4462a37e01ecd4a2fe84fa35e67af7516b5ce19adb74ecec4657fe44f8d18a10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / tympy-0.1.1-py3-none-any.whl
| Download URL | tympy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
879e381d640119864b67cfe40d3129d27ae84c7c263c25ffa1bddead489f6c2e
|
|
BLAKE2b-256 checksum How to use checksums |
34d22329eba751a6da1089006e96e67e6cd73be80b6bfcfca8c5e0319f9c042a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for tympy 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.