Skip to main content

Access the performance of a given function and create plot.

Project description

⌛️ 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

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

perfassess-0.0.4.tar.gz (4.5 MB view details)

Uploaded Source

Built Distribution

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

perfassess-0.0.4-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file perfassess-0.0.4.tar.gz.

File metadata

  • Download URL: perfassess-0.0.4.tar.gz
  • Upload date:
  • Size: 4.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for perfassess-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a7862f33e31d000e57658de2fd02ca2b677e919b3a79f0a5d48e66c22b0b6b27
MD5 4cf2cc1a76b79acf6e97559dad4b31e4
BLAKE2b-256 d3cc36ce8b361d81a6c0c0bfb6dcc163994bbd81308a6c31357a61d78c639239

See more details on using hashes here.

File details

Details for the file perfassess-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: perfassess-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for perfassess-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 32286c116ebd67efb6d2335f70960ba11a0b206b8b67c0d4306b59c583cae38b
MD5 bf989d4a1fb62bbcbda00533d28106f0
BLAKE2b-256 5c456926613f1f5c3fb5ba9aabc01f4b873ce2f15fbbfe71d10d875fe3d42daa

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