Skip to content
Snippets Groups Projects
Commit 829fbbe1 authored by Mayr, Hannes's avatar Mayr, Hannes
Browse files

Merge branch 'dev' into 'main'

Small documentation improvements and dependency updates

Closes #139

See merge request !73
parents bace53ba ebc18bd1
Branches
Tags
1 merge request!73Small documentation improvements and dependency updates
Pipeline #1064374 passed
......@@ -11,7 +11,7 @@ plotID is a program connected to Research Data Management (RDM). It has two main
## Installation
Currently there are two options to run plotID. Either install it via pip from the Python Package Index (PyPi) or install plotID from the source code.
**Installation is the same for Windows and Unix systems, except** for the **optional** first set of setting up a virtual environment.
**Installation is the same for Windows and Unix systems, except** for the **optional** first step of setting up a virtual environment.
1. [Optional] Create a virtual environment and activate it:
```bash
......@@ -90,13 +90,14 @@ Save plot, data and measuring script. Modules that are imported in the script wh
Optional parameters can be used to customize the publish process.
- *data_storage*: str, optional
Method how the data should be stored. Available options:
- *centralized*: The raw data will copied only once. All other plots will reference this data via sym link.
- *individual*: The complete raw data will be copied to a folder for every plot, respectively.
- *centralized* (not implemented yet): The raw data will copied only once. All other plots will reference this data via sym link.
- *individual* (default): The complete raw data will be copied to a folder for every plot, respectively.
- *plot_names* : str or list of str, optional
Name for the exported plot. If not provided, the corresponding IDs will be used.
name for the exported plot. If not provided, the corresponding IDs will be used.
Example:
`publish(figs_and_ids, "/home/user/Documents/research_data", "/home/user/Documents/exported_data", plot_names=["EnergyOverTime-Plot", "TimeOverEnergy-Plot")`
```python
publish(FIGS_AND_IDS, "/home/user/Documents/research_data", "/home/user/Documents/exported_data", plot_names=["EnergyOverTime-Plot", "TimeOverEnergy-Plot")`
```
## Build
If you want to build plotID yourself, follow these steps:
1. Download the source code from [Gitlab](https://git.rwth-aachen.de/plotid/plotid_python):
......
......@@ -10,5 +10,5 @@ research data, the plot is based on. Additionally, the script that created the
plot will also be copied to the directory.
"""
__version__ = "0.3.1"
__version__ = "0.3.2"
__author__ = "Institut Fluidsystemtechnik within nfdi4ing at TU Darmstadt"
......@@ -68,10 +68,12 @@ def tagplot_image(plotid_object: PlotOptions) -> PlotIDTransfer:
# Create temporary PIL image to get correct textsize
tmp_img = Image.new("L", (100, 100))
tmp_draw = ImageDraw.Draw(tmp_img)
textsize = tmp_draw.textsize(img_id, font)
_, _, textwidth, textheight = tmp_draw.textbbox((0, 0), img_id, font)
# Create new image with white background and the size of the textbox
img_txt = Image.new("RGBA", textsize, color=(255, 255, 255, 0))
img_txt = Image.new(
"RGBA", (textwidth, textheight), color=(255, 255, 255, 0)
)
draw_txt = ImageDraw.Draw(img_txt)
draw_txt.text((0, 0), img_id, font=font, fill=color)
# Rotate the image by the given angle
......@@ -90,7 +92,7 @@ def tagplot_image(plotid_object: PlotOptions) -> PlotIDTransfer:
if plotid_object.qrcode:
qrcode = create_qrcode(img_id)
qrcode.thumbnail(
(plotid_object.qr_size, plotid_object.qr_size), Image.ANTIALIAS
(plotid_object.qr_size, plotid_object.qr_size), Image.Resampling.LANCZOS
)
img.paste(
qrcode,
......
......@@ -75,7 +75,7 @@ def tagplot_matplotlib(plotid_object: PlotOptions) -> PlotIDTransfer:
if plotid_object.qrcode:
qrcode = create_qrcode(fig_id)
qrcode.thumbnail(
(plotid_object.qr_size, plotid_object.qr_size), Image.ANTIALIAS
(plotid_object.qr_size, plotid_object.qr_size), Image.Resampling.LANCZOS
)
fig.figimage(
qrcode,
......
[build-system]
requires = ["setuptools>=43", "wheel"]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"
[project]
......
coverage==6.3.2
coverage==7.3.0
cycler==0.11.0
fonttools==4.32.0
kiwisolver==1.4.2
matplotlib==3.5.2
myst-parser==0.18.0
numpy==1.22.3
packaging==21.3
Pillow==9.3.0
pyparsing==3.0.8
fonttools==4.42.1
kiwisolver==1.4.5
matplotlib==3.7.2
myst-parser==2.0.0
numpy==1.25.2
packaging==23.1
Pillow==10.0.0
pyparsing==3.0.9
python-dateutil==2.8.2
qrcode==7.3.1
qrcode==7.4.2
six==1.16.0
Sphinx==5.0.2
sphinx-autoapi==1.8.4
sphinx-rtd-theme==1.0.0
Sphinx==7.2.5
sphinx-autoapi==2.1.1
sphinx-rtd-theme==1.3.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment