# Wafermap
[
![pypi](https://img.shields.io/pypi/v/wafermap.svg)
![pypi](https://img.shields.io/pypi/pyversions/wafermap.svg)
![pypi](https://img.shields.io/github/license/cap1tan/wafermap.svg)
](https://pypi.org/project/wafermap/)
[
![GitHub](https://img.shields.io/github/v/release/cap1tan/wafermap?include_prereleases)
![GitHub](https://img.shields.io/github/languages/code-size/cap1tan/wafermap)
![pypi](https://img.shields.io/badge/linting-pylint-yellowgreen)
](https://github.com/cap1tan/wafermap)
A python package to plot maps of semiconductor wafers.
Free software: MIT license
## Features
* Circular wafers with arbitrary notch orientations and full or inner layouts.
* Grid with adjustable offset and origin, cells with adjustable size and margin.
* Edge-exclusion.
* Hover-able points, vectors and images.
* Tooltips with embeddable images.
* Individual labels and colors for each die.
* Toggle layers on/off individually.
* Export zoom-able maps to HTML.
* Export PNG images (needs Chromium)
## Examples
- See the full dynamic maps [here](https://cap1tan.github.io/wafermap/)!
- Static png image, just to get a taste:
![Example_wafermap](docs/test_wafermap_example.png)
## Installation
To install Wafermap, run this command in your
terminal:
``` console
$ pip install wafermap
```
This is the preferred method to install Wafermap, as it will always install the most recent stable release.
If you don't have [pip][] installed, this [Python installation guide][]
can guide you through the process.
### From source
The source for Wafermap can be downloaded from
the [Github repo][].
You can clone the public repository:
``` console
$ git clone git://github.com/cap1tan/wafermap
```
[pip]: https://pip.pypa.io
[Python installation guide]: http://docs.python-guide.org/en/latest/starting/installation/
[Github repo]: https://github.com/%7B%7B%20cookiecutter.github_username%20%7D%7D/%7B%7B%20cookiecutter.project_slug%20%7D%7D
## Usage
To use Wafermap in a project
```python
import wafermap
```
First let's define a Wafermap:
```python
wm = wafermap.WaferMap(wafer_radius=100, # all length dimensions in mm
cell_size=(10, 20), # (sizeX, sizeY)
cell_margin=(8, 15), # distance between cell borders (x, y)
cell_origin=(0, 0), # which cell to select as origin (0, 0), in (x, y)
grid_offset=(-2.05, -4.1), # grid offset in (x, y)
edge_exclusion=2.2, # margin from the wafer edge where a red edge exclusion ring is drawn
coverage='full', # 'full': will cover wafer with cells, partial cells allowed
# 'inner': only full cells allowed
notch_orientation=270) # angle of notch in degrees. 270 corresponds to a notch at the bottom
```
To add an image at a specific cell/relative cell coordinates simply:
```python
wm.add_image(image_source_file="inspection1.jpg",
cell=(1, 0), # (cell_index_x, cell_index_y)
offset=(2.0, 2.0)) # relative coordinate of the image within the cell
```
Adding vectors is just as easy. Just define cell and \[(start_rel_coordinates), (end_rel_coordinates)\]:
```python
vectors = [
((3, 0), [(0, 0), (1, 1)]),
((3, 0), [(1, 0), (-5, 5)]),
((3, 0), [(0, 1), (10, -10)]),
((3, 0), [(1, 1), (-20, -20)]),
]
colors = ['green', 'red', 'blue', 'black']
for color, (cell, vector) in zip(colors, vectors):
wm.add_vector(vector_points=vector, cell=cell, vector_style={'color': color}, root_style={'radius': 1, 'color': color})
```
Let's throw in some points in a normal distribution for good measure too:
```python
# add 50 points per cell, in a random distribution
import random as rnd
cell_size = (10, 20)
cell_points = [(cell, [(rnd.gauss(cell_size[0] / 2, cell_size[0] / 6),
rnd.gauss(cell_size[1] / 2, cell_size[1] / 6)) for _ in
range(50)]) for cell in wm.cell_map.keys()]
for cell, cell_points_ in cell_points:
for cell_point in cell_points_:
wm.add_point(cell=cell, offset=cell_point)
```
Finally, nothing would matter if we couldn't see the result:
```python
# save to html
wm.save_html(f"wafermap.html")
# save to png (Chromium must be installed)
wm.save_png(f"wafermap.png")
```
## Dependencies
- __Folium__ & __branca__ -> to make dynamic, zoom-able and pan-able HTML based maps
- __Pillow__ -> to support embedded images and format the optional image output
- __Chromium__ -> exporting to .png images
## Contributing
Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.
You can contribute in many ways:
### Types of Contributions
#### Report Bugs
Report bugs at https://github.com/cap1tan/wafermap/issues.
If you are reporting a bug, please include:
* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.
#### Fix Bugs
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.
#### Implement Features
Look through the GitHub issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.
#### Write Documentation
Wafermap could always use more documentation, whether as part of the
official Wafermap docs, in docstrings, or even on the web in blog posts,
articles, and such.
#### Submit Feedback
The best way to send feedback is to file an issue at https://github.com/cap1tan/wafermap/issues.
If you are proposing a feature:
* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)
### Get Started!
Ready to contribute? Here's how to set up `wafermap` for local development.
1. Fork the `wafermap` repo on GitHub.
2. Clone your fork locally
```
$ git clone git@github.com:your_name_here/wafermap.git
```
3. Ensure [poetry](https://python-poetry.org/docs/) is installed.
4. Install dependencies and start your virtualenv:
```
$ poetry install -E test -E doc -E dev
```
5. Create a branch for local development:
```
$ git checkout -b name-of-your-bugfix-or-feature
```
Now you can make your changes locally.
6. When you're done making changes, check that your changes pass the
tests, including testing other Python versions, with tox:
```
$ tox
```
7. Commit your changes and push your branch to GitHub:
```
$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
```
8. Submit a pull request through the GitHub website.
### Pull Request Guidelines
Before you submit a pull request, check that it meets these guidelines:
1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.md.
3. The pull request should work for Python 3.6, 3.7, 3.8, 3.9 and for PyPy. Check
https://github.com/cap1tan/wafermap/actions
and make sure that the tests pass for all supported Python versions.
### Tips
```
$ python -m unittest tests.test_wafermap
```
To run a subset of tests.
### Deploying
A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.md).
Then run:
```
$ poetry patch # possible: major / minor / patch
$ git push
$ git push --tags
```
Github Actions will then deploy to PyPI if tests pass.
Raw data
{
"_id": null,
"home_page": "https://github.com/cap1tan/wafermap",
"name": "wafermap",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "semiconductor,wafer,layout,plot",
"author": "cap1tan",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/5f/d0/023f51dedd1798b22cecdfbadcb30595bf31d8ba6f864ddb823c308a7d34/wafermap-0.2.6.tar.gz",
"platform": null,
"description": "# Wafermap\n\n[\n![pypi](https://img.shields.io/pypi/v/wafermap.svg)\n![pypi](https://img.shields.io/pypi/pyversions/wafermap.svg)\n![pypi](https://img.shields.io/github/license/cap1tan/wafermap.svg)\n](https://pypi.org/project/wafermap/)\n[\n![GitHub](https://img.shields.io/github/v/release/cap1tan/wafermap?include_prereleases)\n![GitHub](https://img.shields.io/github/languages/code-size/cap1tan/wafermap)\n![pypi](https://img.shields.io/badge/linting-pylint-yellowgreen)\n](https://github.com/cap1tan/wafermap)\n\n\n\nA python package to plot maps of semiconductor wafers.\n\nFree software: MIT license\n\n\n## Features\n\n* Circular wafers with arbitrary notch orientations and full or inner layouts.\n* Grid with adjustable offset and origin, cells with adjustable size and margin.\n* Edge-exclusion.\n* Hover-able points, vectors and images.\n* Tooltips with embeddable images.\n* Individual labels and colors for each die.\n* Toggle layers on/off individually.\n* Export zoom-able maps to HTML.\n* Export PNG images (needs Chromium)\n\n\n## Examples\n\n- See the full dynamic maps [here](https://cap1tan.github.io/wafermap/)!\n\n- Static png image, just to get a taste:\n\n![Example_wafermap](docs/test_wafermap_example.png)\n\n\n## Installation\n\nTo install Wafermap, run this command in your\nterminal:\n\n``` console\n$ pip install wafermap\n```\n\nThis is the preferred method to install Wafermap, as it will always install the most recent stable release.\n\nIf you don't have [pip][] installed, this [Python installation guide][]\ncan guide you through the process.\n\n### From source\n\nThe source for Wafermap can be downloaded from\nthe [Github repo][].\n\nYou can clone the public repository:\n\n``` console\n$ git clone git://github.com/cap1tan/wafermap\n```\n\n\n [pip]: https://pip.pypa.io\n [Python installation guide]: http://docs.python-guide.org/en/latest/starting/installation/\n [Github repo]: https://github.com/%7B%7B%20cookiecutter.github_username%20%7D%7D/%7B%7B%20cookiecutter.project_slug%20%7D%7D\n\n\n## Usage\n\nTo use Wafermap in a project\n\n```python\n import wafermap\n```\n\nFirst let's define a Wafermap:\n```python\nwm = wafermap.WaferMap(wafer_radius=100, # all length dimensions in mm\n cell_size=(10, 20), # (sizeX, sizeY)\n cell_margin=(8, 15), # distance between cell borders (x, y)\n cell_origin=(0, 0), # which cell to select as origin (0, 0), in (x, y)\n grid_offset=(-2.05, -4.1), # grid offset in (x, y)\n edge_exclusion=2.2, # margin from the wafer edge where a red edge exclusion ring is drawn\n coverage='full', # 'full': will cover wafer with cells, partial cells allowed\n # 'inner': only full cells allowed\n notch_orientation=270) # angle of notch in degrees. 270 corresponds to a notch at the bottom\n```\n\nTo add an image at a specific cell/relative cell coordinates simply:\n```python\nwm.add_image(image_source_file=\"inspection1.jpg\",\n cell=(1, 0), # (cell_index_x, cell_index_y)\n offset=(2.0, 2.0)) # relative coordinate of the image within the cell\n```\n\nAdding vectors is just as easy. Just define cell and \\[(start_rel_coordinates), (end_rel_coordinates)\\]:\n```python\nvectors = [\n ((3, 0), [(0, 0), (1, 1)]),\n ((3, 0), [(1, 0), (-5, 5)]),\n ((3, 0), [(0, 1), (10, -10)]),\n ((3, 0), [(1, 1), (-20, -20)]),\n ]\ncolors = ['green', 'red', 'blue', 'black']\nfor color, (cell, vector) in zip(colors, vectors):\n wm.add_vector(vector_points=vector, cell=cell, vector_style={'color': color}, root_style={'radius': 1, 'color': color})\n```\n\nLet's throw in some points in a normal distribution for good measure too:\n\n```python\n# add 50 points per cell, in a random distribution\nimport random as rnd\n\ncell_size = (10, 20)\ncell_points = [(cell, [(rnd.gauss(cell_size[0] / 2, cell_size[0] / 6),\n rnd.gauss(cell_size[1] / 2, cell_size[1] / 6)) for _ in\n range(50)]) for cell in wm.cell_map.keys()]\nfor cell, cell_points_ in cell_points:\n for cell_point in cell_points_:\n wm.add_point(cell=cell, offset=cell_point)\n```\n\nFinally, nothing would matter if we couldn't see the result:\n```python\n# save to html\nwm.save_html(f\"wafermap.html\")\n\n# save to png (Chromium must be installed)\nwm.save_png(f\"wafermap.png\")\n```\n\n\n## Dependencies\n\n- __Folium__ & __branca__ -> to make dynamic, zoom-able and pan-able HTML based maps\n- __Pillow__ -> to support embedded images and format the optional image output \n- __Chromium__ -> exporting to .png images\n\n\n## Contributing\n\nContributions are welcome, and they are greatly appreciated! Every little bit\nhelps, and credit will always be given.\n\nYou can contribute in many ways:\n\n### Types of Contributions\n\n#### Report Bugs\n\nReport bugs at https://github.com/cap1tan/wafermap/issues.\n\nIf you are reporting a bug, please include:\n\n* Your operating system name and version.\n* Any details about your local setup that might be helpful in troubleshooting.\n* Detailed steps to reproduce the bug.\n\n#### Fix Bugs\n\nLook through the GitHub issues for bugs. Anything tagged with \"bug\" and \"help\nwanted\" is open to whoever wants to implement it.\n\n#### Implement Features\n\nLook through the GitHub issues for features. Anything tagged with \"enhancement\"\nand \"help wanted\" is open to whoever wants to implement it.\n\n#### Write Documentation\n\nWafermap could always use more documentation, whether as part of the\nofficial Wafermap docs, in docstrings, or even on the web in blog posts,\narticles, and such.\n\n#### Submit Feedback\n\nThe best way to send feedback is to file an issue at https://github.com/cap1tan/wafermap/issues.\n\nIf you are proposing a feature:\n\n* Explain in detail how it would work.\n* Keep the scope as narrow as possible, to make it easier to implement.\n* Remember that this is a volunteer-driven project, and that contributions\n are welcome :)\n\n### Get Started!\n\nReady to contribute? Here's how to set up `wafermap` for local development.\n\n1. Fork the `wafermap` repo on GitHub.\n2. Clone your fork locally\n\n```\n $ git clone git@github.com:your_name_here/wafermap.git\n```\n\n3. Ensure [poetry](https://python-poetry.org/docs/) is installed.\n4. Install dependencies and start your virtualenv:\n\n```\n $ poetry install -E test -E doc -E dev\n```\n\n5. Create a branch for local development:\n\n```\n $ git checkout -b name-of-your-bugfix-or-feature\n```\n\n Now you can make your changes locally.\n\n6. When you're done making changes, check that your changes pass the\n tests, including testing other Python versions, with tox:\n\n```\n $ tox\n```\n\n7. Commit your changes and push your branch to GitHub:\n\n```\n $ git add .\n $ git commit -m \"Your detailed description of your changes.\"\n $ git push origin name-of-your-bugfix-or-feature\n```\n\n8. Submit a pull request through the GitHub website.\n\n### Pull Request Guidelines\n\nBefore you submit a pull request, check that it meets these guidelines:\n\n1. The pull request should include tests.\n2. If the pull request adds functionality, the docs should be updated. Put\n your new functionality into a function with a docstring, and add the\n feature to the list in README.md.\n3. The pull request should work for Python 3.6, 3.7, 3.8, 3.9 and for PyPy. Check\n https://github.com/cap1tan/wafermap/actions\n and make sure that the tests pass for all supported Python versions.\n\n### Tips\n```\n $ python -m unittest tests.test_wafermap\n```\nTo run a subset of tests.\n\n\n### Deploying\n\nA reminder for the maintainers on how to deploy.\nMake sure all your changes are committed (including an entry in HISTORY.md).\nThen run:\n\n```\n$ poetry patch # possible: major / minor / patch\n$ git push\n$ git push --tags\n```\n\nGithub Actions will then deploy to PyPI if tests pass.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python package to plot maps of semiconductor wafers.",
"version": "0.2.6",
"project_urls": {
"Homepage": "https://github.com/cap1tan/wafermap",
"Repository": "https://github.com/cap1tan/wafermap"
},
"split_keywords": [
"semiconductor",
"wafer",
"layout",
"plot"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "66df9a6d114f2620f2a368946183e0dca6d057ba9a7c5c74cfae53f7ccb3fd24",
"md5": "f69156828f08c196ed66acacb684db90",
"sha256": "24d546ff9753f1386034c6c0360577780470b2f14a0d908ca1e72387c0133f13"
},
"downloads": -1,
"filename": "wafermap-0.2.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f69156828f08c196ed66acacb684db90",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 13582,
"upload_time": "2023-08-14T09:50:57",
"upload_time_iso_8601": "2023-08-14T09:50:57.391585Z",
"url": "https://files.pythonhosted.org/packages/66/df/9a6d114f2620f2a368946183e0dca6d057ba9a7c5c74cfae53f7ccb3fd24/wafermap-0.2.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5fd0023f51dedd1798b22cecdfbadcb30595bf31d8ba6f864ddb823c308a7d34",
"md5": "d941a1af59cc94321ea8926f7086ae54",
"sha256": "ba8c4f2bb38f8d9d52994271dfa89c813effaab940dfdfd99709688e3ac923c6"
},
"downloads": -1,
"filename": "wafermap-0.2.6.tar.gz",
"has_sig": false,
"md5_digest": "d941a1af59cc94321ea8926f7086ae54",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 15142,
"upload_time": "2023-08-14T09:50:59",
"upload_time_iso_8601": "2023-08-14T09:50:59.006670Z",
"url": "https://files.pythonhosted.org/packages/5f/d0/023f51dedd1798b22cecdfbadcb30595bf31d8ba6f864ddb823c308a7d34/wafermap-0.2.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-14 09:50:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cap1tan",
"github_project": "wafermap",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "wafermap"
}