Skip to main content

⌛️ PERFASSESS 💾

Python 3.11 pip 24.0 License: MIT

✍ Contributor: Lucas ROUAUD

📒 Description

This module permit to evaluate the performance of a given function and create Plotly bar plot. Check the documentation at https://filouplains.github.io/perfassess/.

🗄 Dependencies

To run this software, you will need python ≥ 3.11 and this next module:

  • numpy ≥ 1.26.0
  • plotly ≥ 5.19.0
  • pyyaml ≥ 6.0.1

⚙️ Installation

🥹 EZ way

Recommended method:

$ pipx install perfassess

If you do not have pipx installed, check out the documentation at https://pipx.pypa.io/stable/installation/. Else, classical installation method:

$ pip install perfassess

😩 From source

👬 Cloning the repository

You can clone the repository using HTTPS:

$ git clone https://github.com/FilouPlains/perfassess.git

or using SSH:

$ git clone git@github.com:FilouPlains/perfassess.git

Then go to the 📁 perfassess/ directory:

$ cd perfassess

All next commands are assuming that you are in the 📁 perfassess/ directory. This directory will be name as 📁 ./.

🐍📦 Installing with pip

Simply launch this command in the 📁 ./ directory:

$ python3 -m pip install .

You are now able to launch the program!

⌨️ Using command line

✏️ General note

By doing:

$ perfassess --help

You will get the help to use the command line interface. Here are the used legends:

  • int: Integer.
  • str: String.
  • [type|value]: Type of the input required, follow by the default value. So if this optional arguments is not used, “value” will be chosen.

⚠️ If you use pickle, the command line interface will not work!

📄 Normal use

To use th program, launch:

$ perfassess -s script.py \\
             -f function_name \\
             -o output_directory/ \\
             -a argument.yml

You can actually directly test the program in the repository root (📁 perfassess/) using:

$ perfassess -s src/perfassess/testor.py \\
             -f testor \\
             -a data/argument.yml \\
             -o data/

📁 Package use

Let us say that you want to test a package, which should have this kind of tree structure:

package/
└── src/
    ├── __init__.py
    └── script.py

In package, you can use relative paths. But with these, the “normal use” method do not work. Instead, use the next command, if you are in 📁 package/, in order to evaluate script.py:

$ perfassess -s src/script.py \\
             -f function_name \\
             -o output_directory/ \\
             --package src/__init__.py \\
             -a argument.yml

In addition of the previous "normal use" method, you have to indicate a __init__.py file.

Note 📝

Packages are identify with __init__.py files and allow relatives import.

🗂 Subpackage use

Let us say that you want to test a subpackage, which should have this kind of tree structure:

./package/
└── src/
    ├── __init__.py
    └── subpackage/
        ├── __init__.py
        └── script.py

In subpackage, you can use relative paths. But with these, the “normal use” method do not work. But the “package use” also do not work. Instead, use the next command, if you are in 📁 package/, in order to evaluate script.py:

$ perfassess -s src/subpackage/script.py \\
             -f function_name \\
             -o output_directory/ \\
             --package src/__init__.py \\
             --subpackage src/subpackage/__init__.py \\
             -a argument.yml

In addition of the previous “normal use” and “package use” method, you have to indicate two __init__.py files. The first one is the top package __init__.py file. The second one is the __init__.py file of the subpackage to test.

Note 📝

Packages are identify with __init__.py files and allow relatives import.

🔍 Describing possible parameters

Argument Mandatory? Type and usage Description
-s
--script
Yes -s script.py The script that contain the function to test.
-o
--output
Yes -o output_directory/ The directory where the plot have to be produced.
-f
--function
No -f main The function to test.
-a
--argument
No -a argument.yml The argument to passe to the function to test*.
--n_field No -n_field 2 The number of field to keep**.
--package No --package package/__init__.py The __init__.py file of the top package to test.
--subpackage No -o package/subpackage/__init__.py The __init__.py file of the subpackage to test.
-h
--help
No Flag Display the help and exit the program.
-v
--version
No Flag Display the version and exit the program.
  • * = If you want to test a function that requires arguments, you can give to the command line interface a argument.yml file that contains all required arguments. If the tested function requires an argument like toto, you can put in the YAML file:
toto: 10
  • ** = In memory usage, tested functions are going to be named something like /home/user/Documents/program/package/script.py. To shorten the name, use the --n_field tag. For instance, giving 2 will let know to the program that you want to only keep the last two field, which in the end will look something like: package/script.py.

🙇‍♂️ Aknowledgement

🔍 Code reviewing: Hubert Santuz

This work is licensed under a MIT License.

License: MIT

Metadata

Release files for perfassess 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for perfassess 0.0.4
File Size Uploaded
perfassess-0.0.4.tar.gz 4.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for perfassess 0.0.4
File Interpreter ABI Platform
perfassess-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 4.5 MB

Release files / perfassess-0.0.4.tar.gz

Download URL perfassess-0.0.4.tar.gz
Size 4.5 MB
Tags Source
SHA-256 checksum
How to use checksums
a7862f33e31d000e57658de2fd02ca2b677e919b3a79f0a5d48e66c22b0b6b27
BLAKE2b-256 checksum
How to use checksums
d3cc36ce8b361d81a6c0c0bfb6dcc163994bbd81308a6c31357a61d78c639239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / perfassess-0.0.4-py3-none-any.whl

Download URL perfassess-0.0.4-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32286c116ebd67efb6d2335f70960ba11a0b206b8b67c0d4306b59c583cae38b
BLAKE2b-256 checksum
How to use checksums
5c456926613f1f5c3fb5ba9aabc01f4b873ce2f15fbbfe71d10d875fe3d42daa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page