|
1 | 1 | # pdz-tool-gui
|
2 |
| -User interface for `pdz-tool` which converts XRF spectral data PDZ files to open CSV, JSON, TXT, and JPEG formats |
| 2 | + |
| 3 | + |
| 4 | +User interface for [`pdz-tool`](https://github.com/bducraux/pdz-tool) which converts Bruker XRF spectral data PDZ files to open CSV and JPEG formats. |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +`pdz-tool` by [Bruno Ducraux](https://github.com/bducraux) |
| 9 | +with features and fixes by [Lars Maxfield](https://github.com/larsmaxfield) |
| 10 | + |
| 11 | +Interface created by [Lars Maxfield](https://github.com/larsmaxfield) |
| 12 | + |
| 13 | +Image extraction adapted from `read_pdz` by [Frank Ligterink](https://github.com/fligt) |
| 14 | + |
| 15 | +Icon by Good Stuff Non Sense, [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
| 16 | + |
| 17 | + |
| 18 | +## Developers |
| 19 | + |
| 20 | +### Dependencies |
| 21 | + |
| 22 | + - `pdz-tool` |
| 23 | + - `python>=3.11` |
| 24 | + - `tk` |
| 25 | + - `pyinstaller<6` if you need to create executables or packages ([`6.y.z` versions of `pyinstaller` can throw a error when closing the window on Windows](https://stackoverflow.com/questions/60502431/files-built-using-pyinstaller-onefile-no-longer-deletes-their-temporary-mei-d)) |
| 26 | + |
| 27 | + |
| 28 | +### Virtual environments |
| 29 | + |
| 30 | +#### `conda` |
| 31 | + |
| 32 | +If you use `conda` (Anaconda), it can be faster to manually create the environment instead of solving from `environment.yml`. |
| 33 | + |
| 34 | +Change directory to the repo root and run these commands to manually create the environment in `./env`: |
| 35 | + |
| 36 | +```` |
| 37 | +conda create -y --prefix ./env python=3.11 --force |
| 38 | +conda activate ./env |
| 39 | +pip install pdz-tool |
| 40 | +pip install "pyinstaller<6" |
| 41 | +```` |
| 42 | + |
| 43 | +To activate the environment in the future, change directory to repo root and run `conda activate ./env`. |
| 44 | + |
| 45 | + |
| 46 | +### Creating portable executable and package |
| 47 | + |
| 48 | +Run PyInstaller with the following arguments while in the source code directory. |
| 49 | + |
| 50 | +For Windows: |
| 51 | + |
| 52 | +``` |
| 53 | +pyinstaller --onefile --windowed --icon=icon.ico --add-data=C:\absolute\path\to\source\icon.ico;. main.py |
| 54 | +``` |
| 55 | + |
| 56 | +For macOS: |
| 57 | + |
| 58 | +``` |
| 59 | +pyinstaller --windowed --icon=icon.icns --add-data=\absolute\path\to\source\icon.icns;. main.py |
| 60 | +``` |
| 61 | + |
| 62 | +The terminating `;.` in the `add-data` path is necessary. |
| 63 | +`.` indicates the directory in which to add the data, here root. |
| 64 | +If the icons are moved to a subdirectory, this `.` will need to be replaced by |
| 65 | +that subdirectory path. |
0 commit comments