arrgh


Namearrgh JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryA small python utility to pretty-print a table summarizing arrays & scalars from numpy, pytorch, etc.
upload_time2023-06-15 23:32:42
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2023 Nicholas Sharp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords printing debugging logging tensor numpy pytorch jax
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # printarr
A small python utility to pretty-print a table summarizing arrays & scalars from numpy, pytorch, etc.

### Example

Calling `printarr(my_arr1, my_arr2, ...)` prints a table like:

```
       name | dtype         | shape         | type          | device | min         | max         | mean       
--------------------------------------------------------------------------------------------------------------
     [None] | None          | N/A           | NoneType      |        | N/A         | N/A         | N/A        
    intval1 | int           | scalar        | int           |        |      7      |      7      |      7     
    intval2 | int           | scalar        | int           |        |     -3      |     -3      |     -3     
  floatval0 | float         | scalar        | float         |        |     42      |     42      |     42     
  floatval1 | float         | scalar        | float         |        | 5.5e-12     | 5.5e-12     | 5.5e-12    
  floatval2 | float         | scalar        | float         |        | 7.72324e+44 | 7.72324e+44 | 7.72324e+44
     npval1 | int64         | [100]         | numpy.ndarray |        |      0      |     99      |   49.5     
     npval2 | int64         | [10000]       | numpy.ndarray |        |      0      |   9999      | 4999.5     
     npval3 | uint64        | [10000]       | numpy.ndarray |        |      0      |   9999      | 4999.5     
     npval4 | float32       | [100, 10, 10] | numpy.ndarray |        |      0      |   9999      | 4999.5     
[temporary] | float32       | [10, 8]       | numpy.ndarray |        |      2      |     99      |   50.5     
     npval5 | int64         | []            | numpy.int64   |        |   9999      |   9999      |   9999     
  torchval1 | torch.float32 | [1000, 12, 3] | torch.Tensor  | cpu    | -4.08445    | 3.90982     | 0.00404567 
  torchval2 | torch.float32 | [1000, 12, 3] | torch.Tensor  | cuda:0 | -3.87309    | 3.90342     | 0.00339224 
  torchval3 | torch.int64   | [1000]        | torch.Tensor  | cpu    |      0      |    999      | N/A        
  torchval4 | torch.int64   | []            | torch.Tensor  | cpu    |      0      |      0      | N/A
```

### Installation

`pip install printarr`

`from printarr import printarr`

### Docs

The package exposes a single function called `printarr()`. Call it like: `printarr(my_arr, some_other_arr, maybe_a_scalar)`.

The function accepts a variable number of arguments. Arrays can also be passed as named optional arguments.

Inputs can be:
- Numpy tensor arrays
- Pytorch tensor arrays
- Jax tensor arrays
- Python ints / floats
- `None`
- It may also work with other array-like types, but they have not been tested.
- Input values which are not arrays or numeric types (strings, objects, etc) will be printed as blank rows in the table.

When arrays are passed as variable arguments, the printed name of the array in the table is inferred from the variable name in the outer scope, when possible. When arrays are passed as named keyword arguments, the key name is used.

Pass an integer for the `printarr_float_width` option to specify the precision to which floating point types are printed.

Author: Nicholas Sharp (nmwsharp.com)



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "arrgh",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Nicholas Sharp <nmwsharp@gmail.com>",
    "keywords": "printing,debugging,logging,tensor,numpy,pytorch,jax",
    "author": "",
    "author_email": "Nicholas Sharp <nmwsharp@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/21/5a/938cd7714f27fbcdc22cb0ba8f2488caaf973577faf14bc69135d1417228/arrgh-0.0.1.tar.gz",
    "platform": null,
    "description": "# printarr\nA small python utility to pretty-print a table summarizing arrays &amp; scalars from numpy, pytorch, etc.\n\n### Example\n\nCalling `printarr(my_arr1, my_arr2, ...)` prints a table like:\n\n```\n       name | dtype         | shape         | type          | device | min         | max         | mean       \n--------------------------------------------------------------------------------------------------------------\n     [None] | None          | N/A           | NoneType      |        | N/A         | N/A         | N/A        \n    intval1 | int           | scalar        | int           |        |      7      |      7      |      7     \n    intval2 | int           | scalar        | int           |        |     -3      |     -3      |     -3     \n  floatval0 | float         | scalar        | float         |        |     42      |     42      |     42     \n  floatval1 | float         | scalar        | float         |        | 5.5e-12     | 5.5e-12     | 5.5e-12    \n  floatval2 | float         | scalar        | float         |        | 7.72324e+44 | 7.72324e+44 | 7.72324e+44\n     npval1 | int64         | [100]         | numpy.ndarray |        |      0      |     99      |   49.5     \n     npval2 | int64         | [10000]       | numpy.ndarray |        |      0      |   9999      | 4999.5     \n     npval3 | uint64        | [10000]       | numpy.ndarray |        |      0      |   9999      | 4999.5     \n     npval4 | float32       | [100, 10, 10] | numpy.ndarray |        |      0      |   9999      | 4999.5     \n[temporary] | float32       | [10, 8]       | numpy.ndarray |        |      2      |     99      |   50.5     \n     npval5 | int64         | []            | numpy.int64   |        |   9999      |   9999      |   9999     \n  torchval1 | torch.float32 | [1000, 12, 3] | torch.Tensor  | cpu    | -4.08445    | 3.90982     | 0.00404567 \n  torchval2 | torch.float32 | [1000, 12, 3] | torch.Tensor  | cuda:0 | -3.87309    | 3.90342     | 0.00339224 \n  torchval3 | torch.int64   | [1000]        | torch.Tensor  | cpu    |      0      |    999      | N/A        \n  torchval4 | torch.int64   | []            | torch.Tensor  | cpu    |      0      |      0      | N/A\n```\n\n### Installation\n\n`pip install printarr`\n\n`from printarr import printarr`\n\n### Docs\n\nThe package exposes a single function called `printarr()`. Call it like: `printarr(my_arr, some_other_arr, maybe_a_scalar)`.\n\nThe function accepts a variable number of arguments. Arrays can also be passed as named optional arguments.\n\nInputs can be:\n- Numpy tensor arrays\n- Pytorch tensor arrays\n- Jax tensor arrays\n- Python ints / floats\n- `None`\n- It may also work with other array-like types, but they have not been tested.\n- Input values which are not arrays or numeric types (strings, objects, etc) will be printed as blank rows in the table.\n\nWhen arrays are passed as variable arguments, the printed name of the array in the table is inferred from the variable name in the outer scope, when possible. When arrays are passed as named keyword arguments, the key name is used.\n\nPass an integer for the `printarr_float_width` option to specify the precision to which floating point types are printed.\n\nAuthor: Nicholas Sharp (nmwsharp.com)\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Nicholas Sharp  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A small python utility to pretty-print a table summarizing arrays & scalars from numpy, pytorch, etc.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/nmwsharp/printarr"
    },
    "split_keywords": [
        "printing",
        "debugging",
        "logging",
        "tensor",
        "numpy",
        "pytorch",
        "jax"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "07f5b54a3840c9efb0373ed211bde926b160912d05c943c3aa64d9c4575156f0",
                "md5": "adc6a7daca579aed096de2353690ffac",
                "sha256": "597e9d4bc4db4bad8f41ebcce833a07db62b81f7fdd2a0c925ba9610cb4ea531"
            },
            "downloads": -1,
            "filename": "arrgh-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "adc6a7daca579aed096de2353690ffac",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5888,
            "upload_time": "2023-06-15T23:32:41",
            "upload_time_iso_8601": "2023-06-15T23:32:41.064961Z",
            "url": "https://files.pythonhosted.org/packages/07/f5/b54a3840c9efb0373ed211bde926b160912d05c943c3aa64d9c4575156f0/arrgh-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "215a938cd7714f27fbcdc22cb0ba8f2488caaf973577faf14bc69135d1417228",
                "md5": "a174014d384805dc04ea29de10cde8f1",
                "sha256": "08176af99ab2b7b48ab5771cacdc86ba8b054dec3bdf106dc8d230d10b163689"
            },
            "downloads": -1,
            "filename": "arrgh-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a174014d384805dc04ea29de10cde8f1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4825,
            "upload_time": "2023-06-15T23:32:42",
            "upload_time_iso_8601": "2023-06-15T23:32:42.511888Z",
            "url": "https://files.pythonhosted.org/packages/21/5a/938cd7714f27fbcdc22cb0ba8f2488caaf973577faf14bc69135d1417228/arrgh-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-15 23:32:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nmwsharp",
    "github_project": "printarr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "arrgh"
}
        
Elapsed time: 0.11031s