perfassess


Nameperfassess JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryAccess the performance of a given function and create plot.
upload_time2024-04-24 11:30:22
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License
keywords assessor memory performance plot python time
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

# βŒ›οΈ PERFASSESS πŸ’Ύ

[![Python 3.11](https://img.shields.io/badge/python-%E2%89%A5_3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/)
[![pip 24.0](https://img.shields.io/badge/pip-%E2%89%A5_24.0-green.svg)](https://pip.pypa.io/en/latest/installation/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

✍ Contributor: **Lucas ROUAUD**

</div align="center">

## πŸ“’ 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/](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:

```bash
$ pipx install perfassess
```

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

```bash
$ pip install perfassess
```

### 😩 From source
#### πŸ‘¬ Cloning the repository

You can clone the repository using `HTTPS`:

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

or using `SSH`:

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

Then go to the `πŸ“ perfassess/` directory:

```bash
$ 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:

```bash
$ python3 -m pip install .
```

**You are now able to launch the program!**

## ⌨️ Using command line

### ✏️ General note

By doing:

```sh
$ 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:

```sh
$ 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:

```sh
$ 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:

```sh
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`:

```sh
$ 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:

```sh
./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`:

```sh
$ 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`<br>`--script`**   |      Yes       | `-s script.py`                      | The script that contain the function to test.      |
| **`-o`<br>`--output`**   |      Yes       | `-o output_directory/`              | The directory where the plot have to be produced.  |
| **`-f`<br>`--function`** |       No       | `-f main`                           | The function to test.                              |
| **`-a`<br>`--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`<br>`--help`**     |       No       | Flag                                | Display the help and exit the program.             |
| **`-v`<br>`--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:

```yml
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](https://opensource.org/licenses/MIT)._


[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "perfassess",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Lucas ROUAUD <lucas.rouaud@gmail.com>",
    "keywords": "assessor, memory, performance, plot, python, time",
    "author": null,
    "author_email": "Lucas ROUAUD <lucas.rouaud@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d3/cc/36ce8b361d81a6c0c0bfb6dcc163994bbd81308a6c31357a61d78c639239/perfassess-0.0.4.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# \u231b\ufe0f PERFASSESS \ud83d\udcbe\n\n[![Python 3.11](https://img.shields.io/badge/python-%E2%89%A5_3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/)\n[![pip 24.0](https://img.shields.io/badge/pip-%E2%89%A5_24.0-green.svg)](https://pip.pypa.io/en/latest/installation/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u270d Contributor: **Lucas ROUAUD**\n\n</div align=\"center\">\n\n## \ud83d\udcd2 Description\n\n**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/](https://filouplains.github.io/perfassess/).**\n\n## \ud83d\uddc4 Dependencies\n\nTo run this software, you will need `python \u2265 3.11` and this next module:\n\n- `numpy \u2265 1.26.0`\n- `plotly \u2265 5.19.0`\n- `pyyaml \u2265 6.0.1`\n\n## \u2699\ufe0f Installation\n\n### \ud83e\udd79 EZ way\n\nRecommended method:\n\n```bash\n$ pipx install perfassess\n```\n\nIf you do not have pipx installed, check out the documentation at [https://pipx.pypa.io/stable/installation/](https://pipx.pypa.io/stable/installation/). Else, classical installation method:\n\n```bash\n$ pip install perfassess\n```\n\n### \ud83d\ude29 From source\n#### \ud83d\udc6c Cloning the repository\n\nYou can clone the repository using `HTTPS`:\n\n```bash\n$ git clone https://github.com/FilouPlains/perfassess.git\n```\n\nor using `SSH`:\n\n```bash\n$ git clone git@github.com:FilouPlains/perfassess.git\n```\n\nThen go to the `\ud83d\udcc1 perfassess/` directory:\n\n```bash\n$ cd perfassess\n```\n\n**All next commands are assuming that you are in the `\ud83d\udcc1 perfassess/` directory. This directory will be name as `\ud83d\udcc1 ./`.**\n\n#### \ud83d\udc0d\ud83d\udce6 Installing with pip\n\nSimply launch this command in the `\ud83d\udcc1 ./` directory:\n\n```bash\n$ python3 -m pip install .\n```\n\n**You are now able to launch the program!**\n\n## \u2328\ufe0f Using command line\n\n### \u270f\ufe0f General note\n\nBy doing:\n\n```sh\n$ perfassess --help\n```\n\nYou will get the help to use the command line interface. Here are the used legends:\n\n- **`int`:** Integer.\n- **`str`:** String.\n- **`[type|value]`:** Type of the input required, follow by the default value. So if this optional arguments is not used, \u201cvalue\u201d will be chosen.\n\n> \u26a0\ufe0f If you use `pickle`, the command line interface will not work!\n\n### \ud83d\udcc4 Normal use\n\nTo use th program, launch:\n\n```sh\n$ perfassess -s script.py \\\\\n             -f function_name \\\\\n             -o output_directory/ \\\\\n             -a argument.yml\n```\n\nYou can actually directly test the program in the repository root (`\ud83d\udcc1 perfassess/`) using:\n\n```sh\n$ perfassess -s src/perfassess/testor.py \\\\\n             -f testor \\\\\n             -a data/argument.yml \\\\\n             -o data/\n```\n\n### \ud83d\udcc1 Package use\n\nLet us say that you want to test a package, which should have this kind of tree structure:\n\n```sh\npackage/\n\u2514\u2500\u2500 src/\n    \u251c\u2500\u2500 __init__.py\n    \u2514\u2500\u2500 script.py\n```\n\nIn package, you can use relative paths. But with these, the \u201cnormal use\u201d method do not work. Instead, use the next command, if you are in `\ud83d\udcc1 package/`, in order to evaluate `script.py`:\n\n```sh\n$ perfassess -s src/script.py \\\\\n             -f function_name \\\\\n             -o output_directory/ \\\\\n             --package src/__init__.py \\\\\n             -a argument.yml\n```\n\nIn addition of the previous \"normal use\" method, you have to indicate a `__init__.py` file.\n\n> **Note \ud83d\udcdd**\n> \n> Packages are identify with `__init__.py` files and allow relatives import.\n\n### \ud83d\uddc2 Subpackage use\n\nLet us say that you want to test a subpackage, which should have this kind of tree structure:\n\n```sh\n./package/\n\u2514\u2500\u2500 src/\n    \u251c\u2500\u2500 __init__.py\n    \u2514\u2500\u2500 subpackage/\n        \u251c\u2500\u2500 __init__.py\n        \u2514\u2500\u2500 script.py\n```\n\nIn subpackage, you can use relative paths. But with these, the \u201cnormal use\u201d method do not work. But the \u201cpackage use\u201d also do not work. Instead, use the next command, if you are in `\ud83d\udcc1 package/`, in order to evaluate `script.py`:\n\n```sh\n$ perfassess -s src/subpackage/script.py \\\\\n             -f function_name \\\\\n             -o output_directory/ \\\\\n             --package src/__init__.py \\\\\n             --subpackage src/subpackage/__init__.py \\\\\n             -a argument.yml\n```\n\nIn addition of the previous \u201cnormal use\u201d and \u201cpackage use\u201d 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.\n\n> **Note \ud83d\udcdd**\n> \n> Packages are identify with `__init__.py` files and allow relatives import.\n\n### \ud83d\udd0d Describing possible parameters\n\n| **Argument**             | **Mandatory?** | **Type and usage**                  | **Description**                                    |\n| :----------------------- | :------------: | :---------------------------------- | :------------------------------------------------- |\n| **`-s`<br>`--script`**   |      Yes       | `-s script.py`                      | The script that contain the function to test.      |\n| **`-o`<br>`--output`**   |      Yes       | `-o output_directory/`              | The directory where the plot have to be produced.  |\n| **`-f`<br>`--function`** |       No       | `-f main`                           | The function to test.                              |\n| **`-a`<br>`--argument`** |       No       | `-a argument.yml`                   | The argument to passe to the function to test*.    |\n| **`--n_field`**          |       No       | `-n_field 2`                        | The number of field to keep**.                     |\n| **`--package`**          |       No       | `--package package/__init__.py`     | The `__init__.py` file of the top package to test. |\n| **`--subpackage`**       |       No       | `-o package/subpackage/__init__.py` | The `__init__.py` file of the subpackage to test.  |\n| **`-h`<br>`--help`**     |       No       | Flag                                | Display the help and exit the program.             |\n| **`-v`<br>`--version`**  |       No       | Flag                                | Display the version and exit the program.          |\n\n- **\\* =** 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:\n\n```yml\ntoto: 10\n```\n\n- **\\*\\* =** 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`.\n\n## \ud83d\ude47\u200d\u2642\ufe0f Aknowledgement\n\n\ud83d\udd0d Code reviewing: **Hubert Santuz**\n\n_This work is licensed under a [MIT License](https://opensource.org/licenses/MIT)._\n\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Access the performance of a given function and create plot.",
    "version": "0.0.4",
    "project_urls": {
        "Documentation": "https://filouplains.github.io/perfassess/",
        "Homepage": "https://github.com/FilouPlains/perfassess",
        "Repository": "https://github.com/FilouPlains/perfassess"
    },
    "split_keywords": [
        "assessor",
        " memory",
        " performance",
        " plot",
        " python",
        " time"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c456926613f1f5c3fb5ba9aabc01f4b873ce2f15fbbfe71d10d875fe3d42daa",
                "md5": "bf989d4a1fb62bbcbda00533d28106f0",
                "sha256": "32286c116ebd67efb6d2335f70960ba11a0b206b8b67c0d4306b59c583cae38b"
            },
            "downloads": -1,
            "filename": "perfassess-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bf989d4a1fb62bbcbda00533d28106f0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 14939,
            "upload_time": "2024-04-24T11:30:19",
            "upload_time_iso_8601": "2024-04-24T11:30:19.063292Z",
            "url": "https://files.pythonhosted.org/packages/5c/45/6926613f1f5c3fb5ba9aabc01f4b873ce2f15fbbfe71d10d875fe3d42daa/perfassess-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d3cc36ce8b361d81a6c0c0bfb6dcc163994bbd81308a6c31357a61d78c639239",
                "md5": "4cf2cc1a76b79acf6e97559dad4b31e4",
                "sha256": "a7862f33e31d000e57658de2fd02ca2b677e919b3a79f0a5d48e66c22b0b6b27"
            },
            "downloads": -1,
            "filename": "perfassess-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "4cf2cc1a76b79acf6e97559dad4b31e4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 4480188,
            "upload_time": "2024-04-24T11:30:22",
            "upload_time_iso_8601": "2024-04-24T11:30:22.201930Z",
            "url": "https://files.pythonhosted.org/packages/d3/cc/36ce8b361d81a6c0c0bfb6dcc163994bbd81308a6c31357a61d78c639239/perfassess-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-24 11:30:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FilouPlains",
    "github_project": "perfassess",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "perfassess"
}
        
Elapsed time: 0.25288s