Skip to content
Snippets Groups Projects
Commit 3e639302 authored by Hock, Martin's avatar Hock, Martin
Browse files

Emphasized the small difference of windows and unix setup.

Used italics to express variables / input arguments. Added information about optional dependencies in the contributions part.
parent df7f25c2
Branches
Tags
4 merge requests!41Include latest changes in main branch,!37Merge dev upstream changes into improve/metadata,!35Adjust readme.md,!34Include architecture diagram in docs
Pipeline #824547 waiting for manual action
...@@ -8,7 +8,8 @@ plotID is a program connected to Research Data Management (RDM). It has two main ...@@ -8,7 +8,8 @@ plotID is a program connected to Research Data Management (RDM). It has two main
**Note:** To run plotID python version ≥ 3.10 is required. **Note:** To run plotID python version ≥ 3.10 is required.
## Installation ## 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. Apart from setting up an optional virtual environment, installation is the same for Windows and Unix systems. 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.
1. [Optional] Create a virtual environment and activate it: 1. [Optional] Create a virtual environment and activate it:
```bash ```bash
...@@ -47,19 +48,19 @@ Tag your figure/plot with an ID. It is possible to tag multiple figures at once. ...@@ -47,19 +48,19 @@ Tag your figure/plot with an ID. It is possible to tag multiple figures at once.
`tagplot(figures, plot_engine)` `tagplot(figures, plot_engine)`
The variable "figures" can be a single figure or a list of multiple figures. The variable "figures" can be a single figure or a list of multiple figures.
The argument "plot_engine" defines which plot engine was used to create the figures. It also determines which plot engine plotID uses to place the ID on the plot. Currently supported plot engines are: The argument "plot_engine" defines which plot engine was used to create the figures. It also determines which plot engine plotID uses to place the ID on the plot. Currently supported plot engines are:
- 'matplotlib', which processes figures created by matplotlib. - *matplotlib*, which processes figures created by matplotlib.
- 'image', which processes pictures with common extensions (jpg, png, etc.). - *image*, which processes pictures files with common extensions (jpg, png, etc.).
tagplot returns a PlotIDTransfer object that contains the tagged figures and the corresponding IDs as strings. tagplot returns a PlotIDTransfer object that contains the tagged figures and the corresponding IDs as strings.
Optional parameters can be used to customize the tag process. Optional parameters can be used to customize the tag process.
- prefix : str, optional - *prefix* : str, optional
Will be added as prefix to the ID. Will be added as prefix to the ID.
- id_method : str, optional - *id_method* : str, optional
id_method for creating the ID. Create an ID by Unix time is referenced as 'time', create a random ID with id_method='random'. The default is 'time'. id_method for creating the ID. Create an ID by Unix time is referenced as 'time', create a random ID with id_method='random'. The default is 'time'.
- location : string, optional - *location* : string, optional
Location for ID to be displayed on the plot. Default is 'east'. Location for ID to be displayed on the plot. Default is 'east'.
- qrcode : boolean, optional - *qrcode* : boolean, optional
Experimental support for encoding the ID in a QR Code. Experimental support for encoding the ID in a QR Code.
Example: Example:
...@@ -75,16 +76,16 @@ FIGS_AND_IDS = tagplot(FIGS_AS_LIST, 'matplotlib', prefix='XY23_', id_method='ra ...@@ -75,16 +76,16 @@ FIGS_AND_IDS = tagplot(FIGS_AS_LIST, 'matplotlib', prefix='XY23_', id_method='ra
Save plot, data and measuring script. It is possible to export multiple figures at once. Save plot, data and measuring script. It is possible to export multiple figures at once.
`publish(figs_and_ids, src_datapath, dst_path, plot_name)` `publish(figs_and_ids, src_datapath, dst_path, plot_name)`
- "figs_and_ids" must be a PlotIDTransfer object. Therefore, it can be directly passed from tagplot() to publish(). - *figs_and_ids* must be a PlotIDTransfer object. Therefore, it can be directly passed from tagplot() to publish().
- "src_datapath" specifies the path to (raw) data that should be published. It can be a string or a list of strings that specifies all files and directories which will be published. - *src_datapath* specifies the path to (raw) data that should be published. It can be a string or a list of strings that specifies all files and directories which will be published.
- "dst_path" is the path to the destination directory, where all the data should be copied/exported to. - *dst_path* is the path to the destination directory, where all the data should be copied/exported to.
- "plot_names" will be the file names for the exported plots. If you give only one plot name but several figures, plotID will name the exported plots with an appended number, e.g. example_fig1.png, example_fig2.png, ... - *plot_names* will be the file names for the exported plots. If you give only one plot name but several figures, plotID will name the exported plots with an appended number, e.g. example_fig1.png, example_fig2.png, ...
Optional parameters can be used to customize the publish process. Optional parameters can be used to customize the publish process.
- data_storage: str, optional - *data_storage*: str, optional
Method how the data should be stored. Available options: 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. - *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. - *individual*: The complete raw data will be copied to a folder for every plot, respectively.
Example: Example:
`publish(figs_and_ids, '/home/user/Documents/research_data', '/home/user/Documents/exported_data', 'EnergyOverTime-Plot')` `publish(figs_and_ids, '/home/user/Documents/research_data', '/home/user/Documents/exported_data', 'EnergyOverTime-Plot')`
...@@ -93,8 +94,8 @@ If you want to build plotID yourself, follow these steps: ...@@ -93,8 +94,8 @@ 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): 1. Download the source code from [Gitlab](https://git.rwth-aachen.de/plotid/plotid_python):
`git clone https://git.rwth-aachen.de/plotid/plotid_python.git` `git clone https://git.rwth-aachen.de/plotid/plotid_python.git`
`cd plotid_python` `cd plotid_python`
2. [Optional] Create a virtual environment (see Installation). 2. *[Optional]* Create a virtual environment (see [Installation](#Installation)).
3. [Optional] Run unittests and coverage: 3. *[Optional]* Run unittests and coverage:
`python3 tests/runner_tests.py` `python3 tests/runner_tests.py`
4. Build the package 4. Build the package
`python3 -m build` `python3 -m build`
...@@ -102,6 +103,8 @@ If you want to build plotID yourself, follow these steps: ...@@ -102,6 +103,8 @@ If you want to build plotID yourself, follow these steps:
## Contributing ## Contributing
Contributions to plotID are very welcome. If you encounter any issues with plotID please report them in our [issue tracker](https://git.rwth-aachen.de/plotid/plotid_python/-/issues). Code contributions via merge request are also highly appreciated. Please have a look at [CONTRIBUTING](https://git.rwth-aachen.de/plotid/plotid_python/-/blob/main/CONTRIBUTING.md) first. Contributions to plotID are very welcome. If you encounter any issues with plotID please report them in our [issue tracker](https://git.rwth-aachen.de/plotid/plotid_python/-/issues). Code contributions via merge request are also highly appreciated. Please have a look at [CONTRIBUTING](https://git.rwth-aachen.de/plotid/plotid_python/-/blob/main/CONTRIBUTING.md) first.
To install all optional dependencies use `pip install .[test,docs]` or `pip install plotid[test,docs]` respectively.
## Documentation ## Documentation
If you have more questions about plotID, please have a look at the [documentation](https://plotid.pages.rwth-aachen.de/plotid_python). If you have more questions about plotID, please have a look at the [documentation](https://plotid.pages.rwth-aachen.de/plotid_python).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment