expviz


Nameexpviz JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/fuzihaofzh/expviz
SummaryVisualize experiments tables and figures.
upload_time2024-03-14 20:29:22
maintainer
docs_urlNone
author
requires_python
license
keywords shell env
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Experiments Visualization Toolkit (ExpViz)

Welcome to the Experiments Visualization Toolkit (ExpViz), a Python-based solution designed to facilitate the handling and visualization of experiment results, particularly those stored in JSON format. Whether your results are stored in files or represented as JSON-like dictionaries, ExpViz is here to streamline your data visualization process.

[![GitHub Repo](https://img.shields.io/badge/github-repo-green.svg?style=flat&logo=github)](https://github.com/fuzihaofzh/expviz)

## Features

- **Read Results**: Directly input JSON-like dictionaries or read experiment results from JSON files in a specified directory.
- **Convert to DataFrame**: Elegantly transform nested dictionaries into customizable Pandas DataFrames.
- **Table Rendering**: Convert DataFrames to LaTeX and Markdown tables for seamless integration into documents and web pages.
- **Jupyter Display**: Render and showcase DataFrames interactively within Jupyter notebooks.

## Installation

```sh
# Clone the repository
git clone https://github.com/fuzihaofzh/expviz.git

# Navigate to the cloned repository
cd expviz

# (Optional) Install any dependencies listed in requirements.txt
pip install -r requirements.txt
```

## Usage

### 1. Reading Results

```python
# Directly using a JSON-like dictionary
data_dict = {
    "exp1": {"Score1": 10.1, "Score2": 20},
    "exp2": {"Score1": 30, "Score2": None}
}
results = read_results(data_dict=data_dict)

# Alternatively, using the base URL and experiment names
baseurl = "path/to/experiment/results"
expnames = ["experiment1", "experiment2"]  # or {"exp1": "experiment1", "exp2": "experiment2"}
results = read_results(baseurl, expnames, filename="eval.json")
```

### 2. Converting to DataFrame

```python
# Format and convert the results to a DataFrame
df = dict_to_dataframe(results, fmt='{:,.3g}', transpose=False)
print(df)
```

### 3. Rendering as LaTeX or Markdown

```python
# Convert the DataFrame to a LaTeX table
latex_table = to_latex(results, fmt='{:,.3g}', transpose=False)
print(latex_table)

# Convert the DataFrame to a Markdown table
markdown_table = to_markdown(results, fmt='{:,.3g}', transpose=False)
print(markdown_table)
```

### 4. Displaying in Jupyter

```python
# Visualize the DataFrame in a Jupyter notebook
show(results, fmt='{:,.3g}', transpose=False)
```

## Examples

- **Using JSON-like Dictionary**

    ```python
    data_dict = {
        "exp1": {"Score1": 10.1, "Score2": 20},
        "exp2": {"Score1": 30, "Score2": None}
    }
    results = read_results(data_dict=data_dict)
    ```

- **Using a List of Experiments**

    ```python
    results = read_results("path/to/results", ["experiment1", "experiment2"])
    ```

- **Using a Dictionary of Experiments**

    ```python
    results = read_results("path/to/results", {"exp1": "experiment1", "exp2": "experiment2"})
    ```

- **Visualizing in Jupyter Notebook**

    ```python
    show(results)
    ```

- **Rendering as Markdown**

    ```python
    md_table = to_markdown(results)
    print(md_table)
    ```

## Contributing

Contributions are warmly welcomed! For information on how to contribute, please refer to our [contributing guidelines](CONTRIBUTING.md).

## License

ExpViz is under the MIT License. For more details, check out the [LICENSE.md](LICENSE.md) file in our GitHub repository.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fuzihaofzh/expviz",
    "name": "expviz",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Shell env",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/29/38/f4ec24cae284dba81ae6da9b4a28557d13f58b9b4a6f3a011dedf99f45b5/expviz-0.0.2.tar.gz",
    "platform": null,
    "description": "# Experiments Visualization Toolkit (ExpViz)\n\nWelcome to the Experiments Visualization Toolkit (ExpViz), a Python-based solution designed to facilitate the handling and visualization of experiment results, particularly those stored in JSON format. Whether your results are stored in files or represented as JSON-like dictionaries, ExpViz is here to streamline your data visualization process.\n\n[![GitHub Repo](https://img.shields.io/badge/github-repo-green.svg?style=flat&logo=github)](https://github.com/fuzihaofzh/expviz)\n\n## Features\n\n- **Read Results**: Directly input JSON-like dictionaries or read experiment results from JSON files in a specified directory.\n- **Convert to DataFrame**: Elegantly transform nested dictionaries into customizable Pandas DataFrames.\n- **Table Rendering**: Convert DataFrames to LaTeX and Markdown tables for seamless integration into documents and web pages.\n- **Jupyter Display**: Render and showcase DataFrames interactively within Jupyter notebooks.\n\n## Installation\n\n```sh\n# Clone the repository\ngit clone https://github.com/fuzihaofzh/expviz.git\n\n# Navigate to the cloned repository\ncd expviz\n\n# (Optional) Install any dependencies listed in requirements.txt\npip install -r requirements.txt\n```\n\n## Usage\n\n### 1. Reading Results\n\n```python\n# Directly using a JSON-like dictionary\ndata_dict = {\n    \"exp1\": {\"Score1\": 10.1, \"Score2\": 20},\n    \"exp2\": {\"Score1\": 30, \"Score2\": None}\n}\nresults = read_results(data_dict=data_dict)\n\n# Alternatively, using the base URL and experiment names\nbaseurl = \"path/to/experiment/results\"\nexpnames = [\"experiment1\", \"experiment2\"]  # or {\"exp1\": \"experiment1\", \"exp2\": \"experiment2\"}\nresults = read_results(baseurl, expnames, filename=\"eval.json\")\n```\n\n### 2. Converting to DataFrame\n\n```python\n# Format and convert the results to a DataFrame\ndf = dict_to_dataframe(results, fmt='{:,.3g}', transpose=False)\nprint(df)\n```\n\n### 3. Rendering as LaTeX or Markdown\n\n```python\n# Convert the DataFrame to a LaTeX table\nlatex_table = to_latex(results, fmt='{:,.3g}', transpose=False)\nprint(latex_table)\n\n# Convert the DataFrame to a Markdown table\nmarkdown_table = to_markdown(results, fmt='{:,.3g}', transpose=False)\nprint(markdown_table)\n```\n\n### 4. Displaying in Jupyter\n\n```python\n# Visualize the DataFrame in a Jupyter notebook\nshow(results, fmt='{:,.3g}', transpose=False)\n```\n\n## Examples\n\n- **Using JSON-like Dictionary**\n\n    ```python\n    data_dict = {\n        \"exp1\": {\"Score1\": 10.1, \"Score2\": 20},\n        \"exp2\": {\"Score1\": 30, \"Score2\": None}\n    }\n    results = read_results(data_dict=data_dict)\n    ```\n\n- **Using a List of Experiments**\n\n    ```python\n    results = read_results(\"path/to/results\", [\"experiment1\", \"experiment2\"])\n    ```\n\n- **Using a Dictionary of Experiments**\n\n    ```python\n    results = read_results(\"path/to/results\", {\"exp1\": \"experiment1\", \"exp2\": \"experiment2\"})\n    ```\n\n- **Visualizing in Jupyter Notebook**\n\n    ```python\n    show(results)\n    ```\n\n- **Rendering as Markdown**\n\n    ```python\n    md_table = to_markdown(results)\n    print(md_table)\n    ```\n\n## Contributing\n\nContributions are warmly welcomed! For information on how to contribute, please refer to our [contributing guidelines](CONTRIBUTING.md).\n\n## License\n\nExpViz is under the MIT License. For more details, check out the [LICENSE.md](LICENSE.md) file in our GitHub repository.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Visualize experiments tables and figures.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/fuzihaofzh/expviz"
    },
    "split_keywords": [
        "shell",
        "env"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e72475df300ac630a5e910c4c31d327f2dd5c74642068d91cb91bed77015f5be",
                "md5": "ff74ac6a1d5abb840effd2c766f138f5",
                "sha256": "c85fc23639b1ac8eddb24dbaf3dbdb27605e8b5b9f9c6264a0c5a994d24d0d2c"
            },
            "downloads": -1,
            "filename": "expviz-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ff74ac6a1d5abb840effd2c766f138f5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5009,
            "upload_time": "2024-03-14T20:29:21",
            "upload_time_iso_8601": "2024-03-14T20:29:21.187819Z",
            "url": "https://files.pythonhosted.org/packages/e7/24/75df300ac630a5e910c4c31d327f2dd5c74642068d91cb91bed77015f5be/expviz-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2938f4ec24cae284dba81ae6da9b4a28557d13f58b9b4a6f3a011dedf99f45b5",
                "md5": "0489398c828605e84a715fe8903b9b7e",
                "sha256": "b3f52e26fdd054eb9388cd6bb7b158614a8b6e714880c130169aab1aa018d68d"
            },
            "downloads": -1,
            "filename": "expviz-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0489398c828605e84a715fe8903b9b7e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5291,
            "upload_time": "2024-03-14T20:29:22",
            "upload_time_iso_8601": "2024-03-14T20:29:22.745395Z",
            "url": "https://files.pythonhosted.org/packages/29/38/f4ec24cae284dba81ae6da9b4a28557d13f58b9b4a6f3a011dedf99f45b5/expviz-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-14 20:29:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fuzihaofzh",
    "github_project": "expviz",
    "github_not_found": true,
    "lcname": "expviz"
}
        
Elapsed time: 0.20987s