plot-serializer


Nameplot-serializer JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryA simple tool for serializing scientific diagram to (FAIR) data.
upload_time2024-09-18 10:10:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2023 Michaela Leštáková, Ning Xia, TU Darmstadt 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 rdm plot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Overview

[[_TOC_]]

## Installation
Currently, Plot Serializer can only be installed from a local repository.

To install it, first clone this repository to a directory of your choice by navigating to the directory and executing

```cmd
git clone git@git.rwth-aachen.de:fst-tuda/projects/rdm/plot-serializer.git
```

Activate the pip environment into which you would like to install Plot Serializer. If you need to create a new pip environment, follow the section `Creating virtual environment` below.

With the pip environment activated, install Plot Serializer using pip, giving the path to the cloned repository:

```cmd
pip install path/to/directory/plot-serializer
```

## Documentation

View Plot Serializer's documentation on [Read the Docs](https://plot-serializer.readthedocs.io/en/latest/)

## Contributing
Clone this repository with

```cmd
git clone git@git.rwth-aachen.de:fst-tuda/projects/rdm/plot-serializer.git
```



### Creating the virtual environment
On Windows, run

```cmd
py -m venv env
```
The second argument is the location to create the virtual environment. Generally, you can just create this in your project and call it env.

venv will create a virtual Python installation in the env folder.

Before you can start installing or using packages in your virtual environment you’ll need to activate it. Activating a virtual environment will put the virtual environment-specific python and pip executables into your shell’s PATH.

```cmd
.\env\Scripts\activate
```

You can confirm you’re in the virtual environment by checking the location of your Python interpreter:

```cmd
where python
```
Tell pip to install all of the packages in the `requirements.txt` file using the -r flag:

```cmd
py -m pip install -r requirements.txt
```

Update the `requirements.txt` file when you install new packages.

For more detailed instructions, check https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/.

### Linting
This project uses the `flake8` linter and the `black` autoformatter.

### Documentation
Documentation is an essential part of writing code.

:warning: All public functions, methods, classes and modules must be properly documented with docstrings.

This project uses `google`-style docstrings. An example for a good docstring:

```python
def find_largest_distance(point, polygon):
    """Finds the largest distance between a point and the edges of a polygon.

    Args:
        point (shapely.geometry.Point): shapely point object
        polygon (shapely.geometry.Polygon): shapely polygon object

    Returns:
        float: the largest distance between a point and the edges of a polygon
    """
    distance_list = np.array([])
    for poly_point in list(zip(*polygon.exterior.coords.xy)):
        distance = point.distance(Point(poly_point))
        distance_list = np.append(distance_list, distance)
    max_distance = max(distance_list)
    return max_distance
```
because:
- [x] short and easy to understand description
- [x] starts with a verb in third person
- [x] `type` of the args are given
- [x] args and returns are described sufficiently

Where necessary, add additional information using comments.

### Naming Convention
Follow [Guido](https://en.wikipedia.org/wiki/Guido_van_Rossum)'s recommendations (taken from [Google Python Styleguide](https://google.github.io/styleguide/pyguide.html#3164-guidelines-derived-from-guidos-recommendations)):

<table rules="all" border="1" summary="Guidelines from Guido's Recommendations"
       cellspacing="2" cellpadding="2">

  <tr>
    <th>Type</th>
    <th>Public</th>
    <th>Internal</th>
  </tr>

  <tr>
    <td>Packages</td>
    <td><code>lower_with_under</code></td>
    <td></td>
  </tr>

  <tr>
    <td>Modules</td>
    <td><code>lower_with_under</code></td>
    <td><code>_lower_with_under</code></td>
  </tr>

  <tr>
    <td>Classes</td>
    <td><code>CapWords</code></td>
    <td><code>_CapWords</code></td>
  </tr>

  <tr>
    <td>Exceptions</td>
    <td><code>CapWords</code></td>
    <td></td>
  </tr>

  <tr>
    <td>Functions</td>
    <td><code>lower_with_under()</code></td>
    <td><code>_lower_with_under()</code></td>
  </tr>

  <tr>
    <td>Global/Class Constants</td>
    <td><code>CAPS_WITH_UNDER</code></td>
    <td><code>_CAPS_WITH_UNDER</code></td>
  </tr>

  <tr>
    <td>Global/Class Variables</td>
    <td><code>lower_with_under</code></td>
    <td><code>_lower_with_under</code></td>
  </tr>

  <tr>
    <td>Instance Variables</td>
    <td><code>lower_with_under</code></td>
    <td><code>_lower_with_under</code> (protected)</td>
  </tr>

  <tr>
    <td>Method Names</td>
    <td><code>lower_with_under()</code></td>
    <td><code>_lower_with_under()</code> (protected)</td>
  </tr>

  <tr>
    <td>Function/Method Parameters</td>
    <td><code>lower_with_under</code></td>
    <td></td>
  </tr>

  <tr>
    <td>Local Variables</td>
    <td><code>lower_with_under</code></td>
    <td></td>
  </tr>

</table>

For better readability, use meaningful, expressive names instead of hard-to-understand short names. Don’t drop letters from your source code. Although dropped letters in names like `memcpy` (memory copy) and `strcmp` (string compare) were popular in the C programming language before the 1990s, they’re an unreadable style of naming that you shouldn’t use today. If a name isn’t easily pronounceable, it isn’t easily understood.

Additionally, feel free to use short phrases that can make your code read like plain English. For example, `number_of_trials` is more readable than simply `number_trials`.

[More on naming.](https://inventwithpython.com/beyond/chapter4.html)

Use a spell checker.

### Code Structure
The maximum line length is 120 characters.

Whitespaces should be automatically deleted; the autoformatter should take care of this.

Improve readability by limiting the number of nested statements.

Preferrably write short functions, and [pure functions](https://realpython.com/python-functional-programming/#:~:text=A%20pure%20function%20is%20a,to%20state%20or%20mutable%20data.) that can be tested.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "plot-serializer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "rdm, plot",
    "author": null,
    "author_email": "Michaela Lestakova <michaela.lestakova@tu-darmstadt.de>, Ning Xia <ning.xia@tu-darmstadt.de>",
    "download_url": "https://files.pythonhosted.org/packages/a5/ee/f165851b2be8a923a83ea116d095986c85c623057ebdd3e4338472f0c9fb/plot_serializer-0.2.0.tar.gz",
    "platform": null,
    "description": "# Overview\n\n[[_TOC_]]\n\n## Installation\nCurrently, Plot Serializer can only be installed from a local repository.\n\nTo install it, first clone this repository to a directory of your choice by navigating to the directory and executing\n\n```cmd\ngit clone git@git.rwth-aachen.de:fst-tuda/projects/rdm/plot-serializer.git\n```\n\nActivate the pip environment into which you would like to install Plot Serializer. If you need to create a new pip environment, follow the section `Creating virtual environment` below.\n\nWith the pip environment activated, install Plot Serializer using pip, giving the path to the cloned repository:\n\n```cmd\npip install path/to/directory/plot-serializer\n```\n\n## Documentation\n\nView Plot Serializer's documentation on [Read the Docs](https://plot-serializer.readthedocs.io/en/latest/)\n\n## Contributing\nClone this repository with\n\n```cmd\ngit clone git@git.rwth-aachen.de:fst-tuda/projects/rdm/plot-serializer.git\n```\n\n\n\n### Creating the virtual environment\nOn Windows, run\n\n```cmd\npy -m venv env\n```\nThe second argument is the location to create the virtual environment. Generally, you can just create this in your project and call it env.\n\nvenv will create a virtual Python installation in the env folder.\n\nBefore you can start installing or using packages in your virtual environment you\u2019ll need to activate it. Activating a virtual environment will put the virtual environment-specific python and pip executables into your shell\u2019s PATH.\n\n```cmd\n.\\env\\Scripts\\activate\n```\n\nYou can confirm you\u2019re in the virtual environment by checking the location of your Python interpreter:\n\n```cmd\nwhere python\n```\nTell pip to install all of the packages in the `requirements.txt` file using the -r flag:\n\n```cmd\npy -m pip install -r requirements.txt\n```\n\nUpdate the `requirements.txt` file when you install new packages.\n\nFor more detailed instructions, check https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/.\n\n### Linting\nThis project uses the `flake8` linter and the `black` autoformatter.\n\n### Documentation\nDocumentation is an essential part of writing code.\n\n:warning: All public functions, methods, classes and modules must be properly documented with docstrings.\n\nThis project uses `google`-style docstrings. An example for a good docstring:\n\n```python\ndef find_largest_distance(point, polygon):\n    \"\"\"Finds the largest distance between a point and the edges of a polygon.\n\n    Args:\n        point (shapely.geometry.Point): shapely point object\n        polygon (shapely.geometry.Polygon): shapely polygon object\n\n    Returns:\n        float: the largest distance between a point and the edges of a polygon\n    \"\"\"\n    distance_list = np.array([])\n    for poly_point in list(zip(*polygon.exterior.coords.xy)):\n        distance = point.distance(Point(poly_point))\n        distance_list = np.append(distance_list, distance)\n    max_distance = max(distance_list)\n    return max_distance\n```\nbecause:\n- [x] short and easy to understand description\n- [x] starts with a verb in third person\n- [x] `type` of the args are given\n- [x] args and returns are described sufficiently\n\nWhere necessary, add additional information using comments.\n\n### Naming Convention\nFollow [Guido](https://en.wikipedia.org/wiki/Guido_van_Rossum)'s recommendations (taken from [Google Python Styleguide](https://google.github.io/styleguide/pyguide.html#3164-guidelines-derived-from-guidos-recommendations)):\n\n<table rules=\"all\" border=\"1\" summary=\"Guidelines from Guido's Recommendations\"\n       cellspacing=\"2\" cellpadding=\"2\">\n\n  <tr>\n    <th>Type</th>\n    <th>Public</th>\n    <th>Internal</th>\n  </tr>\n\n  <tr>\n    <td>Packages</td>\n    <td><code>lower_with_under</code></td>\n    <td></td>\n  </tr>\n\n  <tr>\n    <td>Modules</td>\n    <td><code>lower_with_under</code></td>\n    <td><code>_lower_with_under</code></td>\n  </tr>\n\n  <tr>\n    <td>Classes</td>\n    <td><code>CapWords</code></td>\n    <td><code>_CapWords</code></td>\n  </tr>\n\n  <tr>\n    <td>Exceptions</td>\n    <td><code>CapWords</code></td>\n    <td></td>\n  </tr>\n\n  <tr>\n    <td>Functions</td>\n    <td><code>lower_with_under()</code></td>\n    <td><code>_lower_with_under()</code></td>\n  </tr>\n\n  <tr>\n    <td>Global/Class Constants</td>\n    <td><code>CAPS_WITH_UNDER</code></td>\n    <td><code>_CAPS_WITH_UNDER</code></td>\n  </tr>\n\n  <tr>\n    <td>Global/Class Variables</td>\n    <td><code>lower_with_under</code></td>\n    <td><code>_lower_with_under</code></td>\n  </tr>\n\n  <tr>\n    <td>Instance Variables</td>\n    <td><code>lower_with_under</code></td>\n    <td><code>_lower_with_under</code> (protected)</td>\n  </tr>\n\n  <tr>\n    <td>Method Names</td>\n    <td><code>lower_with_under()</code></td>\n    <td><code>_lower_with_under()</code> (protected)</td>\n  </tr>\n\n  <tr>\n    <td>Function/Method Parameters</td>\n    <td><code>lower_with_under</code></td>\n    <td></td>\n  </tr>\n\n  <tr>\n    <td>Local Variables</td>\n    <td><code>lower_with_under</code></td>\n    <td></td>\n  </tr>\n\n</table>\n\nFor better readability, use meaningful, expressive names instead of hard-to-understand short names. Don\u2019t drop letters from your source code. Although dropped letters in names like `memcpy` (memory copy) and `strcmp` (string compare) were popular in the C programming language before the 1990s, they\u2019re an unreadable style of naming that you shouldn\u2019t use today. If a name isn\u2019t easily pronounceable, it isn\u2019t easily understood.\n\nAdditionally, feel free to use short phrases that can make your code read like plain English. For example, `number_of_trials` is more readable than simply `number_trials`.\n\n[More on naming.](https://inventwithpython.com/beyond/chapter4.html)\n\nUse a spell checker.\n\n### Code Structure\nThe maximum line length is 120 characters.\n\nWhitespaces should be automatically deleted; the autoformatter should take care of this.\n\nImprove readability by limiting the number of nested statements.\n\nPreferrably write short functions, and [pure functions](https://realpython.com/python-functional-programming/#:~:text=A%20pure%20function%20is%20a,to%20state%20or%20mutable%20data.) that can be tested.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Michaela Le\u0161t\u00e1kov\u00e1, Ning Xia, TU Darmstadt  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 simple tool for serializing scientific diagram to (FAIR) data.",
    "version": "0.2.0",
    "project_urls": {
        "documentation": "https://plot-serializer.readthedocs.io/en/latest/",
        "repository": "https://git.rwth-aachen.de/rdm-tools/plot-serializer"
    },
    "split_keywords": [
        "rdm",
        " plot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b6aa799c3d3ec7b9b4a765e4a4b64f3adc2d86d6d442e928a5a0e002f8af2f2",
                "md5": "2da8fc83d2706fe3944f89e091cdbea3",
                "sha256": "cd564d8e27776ec97fa1b1e5ed527e1a2f6c7c5efd32540ab743471123aab8a3"
            },
            "downloads": -1,
            "filename": "plot_serializer-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2da8fc83d2706fe3944f89e091cdbea3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 33565,
            "upload_time": "2024-09-18T10:10:05",
            "upload_time_iso_8601": "2024-09-18T10:10:05.161052Z",
            "url": "https://files.pythonhosted.org/packages/6b/6a/a799c3d3ec7b9b4a765e4a4b64f3adc2d86d6d442e928a5a0e002f8af2f2/plot_serializer-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a5eef165851b2be8a923a83ea116d095986c85c623057ebdd3e4338472f0c9fb",
                "md5": "910fdc963541329ce66489c1d195a54d",
                "sha256": "3ba06893d69d60b834e3257a252468cc30e1aa48be136aac9bea6425c530d9db"
            },
            "downloads": -1,
            "filename": "plot_serializer-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "910fdc963541329ce66489c1d195a54d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 28630,
            "upload_time": "2024-09-18T10:10:06",
            "upload_time_iso_8601": "2024-09-18T10:10:06.848700Z",
            "url": "https://files.pythonhosted.org/packages/a5/ee/f165851b2be8a923a83ea116d095986c85c623057ebdd3e4338472f0c9fb/plot_serializer-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-18 10:10:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "plot-serializer"
}
        
Elapsed time: 4.39827s