psdi-data-conversion 0.0.36__tar.gz → 0.0.37__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/CONTRIBUTING.md +27 -3
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/PKG-INFO +73 -57
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/README.md +71 -55
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/app.py +94 -14
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/converters/base.py +2 -2
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/download.htm +22 -9
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/styles/psdi-common.css +5 -4
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/templates/index.htm +6 -1
- psdi_data_conversion-0.0.37/psdi_data_conversion/testing/constants.py +15 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/testing/conversion_callbacks.py +7 -6
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/testing/conversion_test_specs.py +107 -18
- psdi_data_conversion-0.0.37/psdi_data_conversion/testing/gui.py +366 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/testing/utils.py +86 -44
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/pyproject.toml +2 -1
- psdi_data_conversion-0.0.37/tests/gui/gui_test.py +109 -0
- {psdi_data_conversion-0.0.36/tests → psdi_data_conversion-0.0.37/tests/python}/file_io_test.py +4 -2
- {psdi_data_conversion-0.0.36/tests → psdi_data_conversion-0.0.37/tests/python}/security_test.py +2 -2
- psdi_data_conversion-0.0.36/.github/workflows/ci-cron.yml +0 -51
- psdi_data_conversion-0.0.36/.github/workflows/ci-deploy-production.yml +0 -61
- psdi_data_conversion-0.0.36/.github/workflows/ci-feature.yml +0 -16
- psdi_data_conversion-0.0.36/.github/workflows/ci-main.yml +0 -34
- psdi_data_conversion-0.0.36/.github/workflows/ci-pr.yml +0 -26
- psdi_data_conversion-0.0.36/.github/workflows/ci-rc-hotfix.yml +0 -18
- psdi_data_conversion-0.0.36/.github/workflows/ci-release.yml +0 -130
- psdi_data_conversion-0.0.36/.github/workflows/job-anchore-scan.yml +0 -52
- psdi_data_conversion-0.0.36/.github/workflows/job-container-push.yml +0 -44
- psdi_data_conversion-0.0.36/.github/workflows/job-deploy-k8s.yml +0 -67
- psdi_data_conversion-0.0.36/.github/workflows/job-open-pull-request.yml +0 -56
- psdi_data_conversion-0.0.36/.github/workflows/job-publish-doc.yml +0 -52
- psdi_data_conversion-0.0.36/.github/workflows/job-tag.yml +0 -50
- psdi_data_conversion-0.0.36/.github/workflows/job-test-gui.yml +0 -36
- psdi_data_conversion-0.0.36/.github/workflows/job-test-python.yml +0 -51
- psdi_data_conversion-0.0.36/psdi_data_conversion/testing/constants.py +0 -12
- psdi_data_conversion-0.0.36/run_local.sh +0 -38
- psdi_data_conversion-0.0.36/tests/selenium/files/standard_test.cdxml +0 -3
- psdi_data_conversion-0.0.36/tests/selenium/run.sh +0 -5
- psdi_data_conversion-0.0.36/tests/selenium/selenium_tests.py +0 -140
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/.gitignore +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/CHANGELOG.md +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/LICENSE +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/__init__.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/bin/LICENSE_ATOMSK +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/bin/LICENSE_C2X +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/bin/linux/atomsk +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/bin/linux/c2x +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/bin/mac/atomsk +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/bin/mac/c2x +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/constants.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/converter.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/converters/__init__.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/converters/atomsk.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/converters/c2x.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/converters/openbabel.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/database.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/dist.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/file_io.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/log_utility.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/main.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/scripts/atomsk.sh +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/scripts/c2x.sh +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/security.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/accessibility.htm +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/convert.htm +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/convertato.htm +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/convertc2x.htm +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/documentation.htm +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/feedback.htm +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/header-links.html +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/index-versions/header-links.html +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/index-versions/psdi-common-footer.html +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/index-versions/psdi-common-header.html +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/psdi-common-footer.html +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/psdi-common-header.html +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/content/report.htm +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/data/data.json +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/colormode-toggle-dm.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/colormode-toggle-lm.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/psdi-icon-dark.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/psdi-icon-light.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/psdi-logo-darktext-simple.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/psdi-logo-darktext.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/psdi-logo-lighttext-simple.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/psdi-logo-lighttext.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-bluesky-black.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-bluesky-white.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-instagram-black.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-instagram-white.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-linkedin-black.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-linkedin-white.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-mastodon-black.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-mastodon-white.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-x-black.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-x-white.svg +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-youtube-black.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/social-logo-youtube-white.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/ukri-epsr-logo-darktext.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/ukri-epsr-logo-lighttext.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/ukri-logo-darktext.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/img/ukri-logo-lighttext.png +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/accessibility.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/common.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/convert.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/convert_common.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/convertato.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/convertc2x.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/data.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/format.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/load_accessibility.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/psdi-common.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/javascript/report.js +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/static/styles/format.css +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/testing/__init__.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/scripts/setup_bin.py +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/1ARJ.mmcif +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/1NE6.mmcif +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/5a9z-assembly1.cif +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/Fapatite.ins +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/aceticacid.mol +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/benzyne.molden +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/caffeine-smi.tar +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/caffeine-smi.tar.gz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/caffeine-smi.zip +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/caffeine.inchi +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/ch3cl-esp.cub +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/cyclopropane_err.mol +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/ethanol.xyz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/fullRhinovirus.pdb +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/hemoglobin.pdb +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/nacl.cif +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/nacl.mol +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/aceticacid.log.txt +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/aceticacid.mol2 +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine-2D-fastest.xyz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine-3D-best.xyz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine.smi +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine.xyz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine_a_in.smi +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine_a_in_kx_f4_l5_out.smi +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine_a_in_kx_f4_out.smi +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine_a_in_kx_out.smi +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/caffeine_a_in_x_out.smi +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/hemoglobin_Atomsk.xyz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/hemoglobin_c2x.xyz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/nacl.log +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/nacl.mol +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/quartz_OB.cif +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/quartz_OB.log.txt +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/quartz_atomsk.cif +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/quartz_atomsk.log.txt +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/standard_test.inchi +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/xyz_files-mol.zip +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/output/xyz_files.log.txt +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/periodic_dmol3.outmol +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/quartz.xyz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/quartz_err.xyz +0 -0
- {psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/test_data/standard_test.cdxml +0 -0
- {psdi_data_conversion-0.0.36/tests → psdi_data_conversion-0.0.37/tests/python}/cli_test.py +0 -0
- {psdi_data_conversion-0.0.36/tests → psdi_data_conversion-0.0.37/tests/python}/converter_test.py +0 -0
- {psdi_data_conversion-0.0.36/tests → psdi_data_conversion-0.0.37/tests/python}/database_test.py +0 -0
- {psdi_data_conversion-0.0.36/tests → psdi_data_conversion-0.0.37/tests/python}/dist_test.py +0 -0
- {psdi_data_conversion-0.0.36/tests → psdi_data_conversion-0.0.37/tests/python}/logging_test.py +0 -0
@@ -297,6 +297,22 @@ For debugging python issues, it's recommended to install the package in editable
|
|
297
297
|
pip install --editable .'[gui-test]'
|
298
298
|
```
|
299
299
|
|
300
|
+
### Running Unit Tests
|
301
|
+
|
302
|
+
The GUI unit tests require a web driver to be installed, and will install one if one isn't. To avoid repeated unnecessary API calls for the installation, you can set the environmental variable `DRIVER` when running tests to the location of your driver. This can be set to be automatically picked up by many IDEs by setting this in a `.env` file in the root of your project, e.g.:
|
303
|
+
|
304
|
+
```
|
305
|
+
DRIVER=~/.wdm/drivers/geckodriver/linux64/v0.36.0/geckodriver
|
306
|
+
```
|
307
|
+
|
308
|
+
To get the address of your driver, you can run the following in a Python terminal from within this projects virtual environment (after installing the `[gui-test]` optional dependencies):
|
309
|
+
|
310
|
+
```python
|
311
|
+
from webdriver_manager.firefox import GeckoDriverManager
|
312
|
+
driver_path = GeckoDriverManager().install()
|
313
|
+
print(f"Gecko driver installed to: {driver_path}")
|
314
|
+
```
|
315
|
+
|
300
316
|
## Continuous Integration
|
301
317
|
|
302
318
|
This project uses various GitHub workflows to perform Continuous Integration tasks. These can be found in the `.github/workflows` folder. The files which start with "ci-" are the directly-triggered workflows, and the files which start with "job-" are reusable workflows called by the former. These workflows handle the following tasks:
|
@@ -310,7 +326,7 @@ See the commons within the files for further details.
|
|
310
326
|
|
311
327
|
## Publishing
|
312
328
|
|
313
|
-
The Python library, CLA, and local GUI are
|
329
|
+
The Python library, CLA, and local GUI are published as a Python package via PyPI. This section describes how the package is set up and how it's published.
|
314
330
|
|
315
331
|
### Package Setup
|
316
332
|
|
@@ -318,11 +334,11 @@ The package's setup is defined in the `pyproject.toml` file. This defines the pr
|
|
318
334
|
|
319
335
|
The package uses [Hatch](https://hatch.pypa.io/latest/) for its build backend, as it is simpler to configure than the classic [Setuptools](https://setuptools.pypa.io/en/latest/userguide/) and provides some useful extensibility.
|
320
336
|
|
321
|
-
The version of the package is set to be determined from the version control system, meaning on the release branch, the version will always match the latest tag.
|
337
|
+
The version of the package is set to be determined from the version control system, meaning on the release branch, the version will always match the latest tag. This alleviates us of having to manually maintain the version for the package to keep it correct, but does result in some quirks. It's a bit fussier to set up (though that's done now), and it makes the user take an extra step if they want to install from source but haven't cloned the repository - this is noted in the installation instructions in the README.
|
322
338
|
|
323
339
|
### Initial Publication
|
324
340
|
|
325
|
-
This section details the
|
341
|
+
This section details the proceduce for the initial publication of this package - now that this is complete, this section is left in for reference in case of future need.
|
326
342
|
|
327
343
|
First, it's necessary to install a couple required packages in order to build a Python package: `build` to build it and `twine` to upload it. These can be installed with pip via:
|
328
344
|
|
@@ -350,6 +366,14 @@ To upload, follow [this tutorial](https://packaging.python.org/en/latest/tutoria
|
|
350
366
|
|
351
367
|
The `ci-release.yml` workflow is planned to publish any new releases to PyPI after the initial publication. This can be set up by uncommenting the relevant lines in this file, possibly updating the `job-publish-pypi.yml` to enable this (testing will be necessary), and setting up Trusted Publishing for the project on PyPI (see [guide](https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-pypi))
|
352
368
|
|
369
|
+
### Project Management
|
370
|
+
|
371
|
+
This project is published on PyPI at https://pypi.org/project/psdi-data-conversion/ and on TestPyPI at https://test.pypi.org/project/psdi-data-conversion/. Maintainers can manage the project through the "Manage" link on that page or from their own projects page.
|
372
|
+
|
373
|
+
The most important setting to be aware of here is Publishing -> Trusted Publisher Management. This is the system used to allow automatic publishing of releases from GitHub. It's set up so that the current project, organisation, environment, and workflow for publishing are approved. If any of these change, this will need to be updated by adding a new trusted publisher with the new settings (on both PyPI and TestPyPI) and removing the old one.
|
374
|
+
|
375
|
+
The management page can also be used to add or remove collaborators through the Collaborators tab. Generally the project on these sites doesn't require much maintenance, but at least a few active collaborators should be on it at all times to avoid getting locked out if someone is suddenly unavailable.
|
376
|
+
|
353
377
|
## Deployment
|
354
378
|
|
355
379
|
Deployment is handled by the `job-deploy-k8s.yml` reusable workflow, which is triggered from `ci-main.yml` to deploy to dev on each push to `main` and `ci-release.yml` to deploy to staging on each push to `release`. When a push to production is desired, it must be triggered manually by calling the `ci-deploy-production.yml` workflow on the `release` branch (it's set up to fail if run on any other branch).
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: psdi_data_conversion
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.37
|
4
4
|
Summary: Chemistry file format conversion service, provided by PSDI
|
5
5
|
Project-URL: Homepage, https://data-conversion.psdi.ac.uk/
|
6
6
|
Project-URL: Documentation, https://psdi-uk.github.io/psdi-data-conversion/
|
@@ -278,7 +278,10 @@ This is the repository for the PSDI PF2 Chemistry File Format Conversion project
|
|
278
278
|
- [Installation and Setup](#installation-and-setup)
|
279
279
|
- [Running the App](#running-the-app)
|
280
280
|
- [Testing](#testing)
|
281
|
-
- [
|
281
|
+
- [Troubleshooting](#troubleshooting)
|
282
|
+
- [OSError: [Errno 24] Too many open files](#oserror-errno-24-too-many-open-files)
|
283
|
+
- [Errors running c2x or Atomsk converters](#errors-running-c2x-or-atomsk-converters)
|
284
|
+
- [Licensing](#licensing)
|
282
285
|
- [Contributors](#contributors)
|
283
286
|
- [Funding](#funding)
|
284
287
|
|
@@ -312,15 +315,17 @@ This is the repository for the PSDI PF2 Chemistry File Format Conversion project
|
|
312
315
|
- `test_data`
|
313
316
|
- (Files used for testing the project)
|
314
317
|
- `tests`
|
315
|
-
-
|
318
|
+
- `gui`
|
319
|
+
- (Unit tests for the GUI, aka the local version of the web app)
|
320
|
+
- `python`
|
321
|
+
- (Unit tests for the Python library and command-line application)
|
316
322
|
- `CHANGELOG.md` (Updates since initial public release)
|
317
323
|
- `CONTRIBUTING.md` (Guidelines and information for contributors to the project)
|
318
324
|
- `DOCKERFILE` (Dockerfile for image containerising PSDI's data conversion service)
|
319
|
-
- `LICENSE` (Apache
|
325
|
+
- `LICENSE` (Apache License version 2.0)
|
320
326
|
- `pyproject.toml` (Python project metadata and settings)
|
321
327
|
- `README.md` (This file)
|
322
328
|
- `requirements.txt` (Requirements for the web app deployment of this project)
|
323
|
-
- `run_local.sh` (Helper script to run the web app locally)
|
324
329
|
|
325
330
|
## Requirements
|
326
331
|
|
@@ -596,50 +601,9 @@ pip install .'[gui]'
|
|
596
601
|
|
597
602
|
If your system does not allow installation in this manner, it may be necessary to set up a virtual environment. See the instructions in the [command-line application installation](#installation) section above for how to do that, and then try to install again once you've set one up and activated it.
|
598
603
|
|
599
|
-
If you've installed this repository from source, you can use the provided `run_local.sh` bash script to run the application. Otherwise (e.g. if you've installed from a wheel or PyPI), copy and paste the following into a script:
|
600
|
-
|
601
|
-
```bash
|
602
|
-
#!/bin/bash
|
603
|
-
|
604
|
-
# The envvar MAX_FILESIZE can be used to set the maximum allowed filesize in MB - 0 indicates no maximum
|
605
|
-
if [ -z $MAX_FILESIZE ]; then
|
606
|
-
export MAX_FILESIZE=0
|
607
|
-
fi
|
608
|
-
|
609
|
-
# The envvar MAX_FILESIZE_OB can be used to set the maximum allowed filesize in MB for the Open Babel converter - 0
|
610
|
-
# indicates no maximum. This is currently set to 1 MB by default as the converter seems to hang above this limit (not
|
611
|
-
# even allowing the process to be cancelled). This can be changed in the future if this is patched
|
612
|
-
if [ -z $MAX_FILESIZE_OB ]; then
|
613
|
-
export MAX_FILESIZE_OB=1
|
614
|
-
fi
|
615
|
-
|
616
|
-
# Logging control - "full" sets server-style logging, which is necessary to produce the output logs with the expected
|
617
|
-
# names. This should not be changed, or else errors will occur
|
618
|
-
export LOG_MODE=full
|
619
|
-
|
620
|
-
# The level to log at. Leave blank for defaults, which logs at INFO level for user output and ERROR level for the server
|
621
|
-
# log and stdout. If set to a different value here (e.g. DEBUG), all these channels will be set to that level
|
622
|
-
export LOG_LEVEL=
|
623
|
-
|
624
|
-
# The envvar SERVICE_MODE can be set to "true" to make this behave as if it's running as the public web service -
|
625
|
-
# uncomment the following line to enable that
|
626
|
-
# export SERVICE_MODE=true
|
627
|
-
|
628
|
-
# Uncomment the following line to enable debug mode
|
629
|
-
# export FLASK_ENV=development
|
630
|
-
|
631
|
-
# Execute a local run of the application from the proper path
|
632
|
-
|
633
|
-
PACKAGE_PATH=`python -c "import psdi_data_conversion; print(psdi_data_conversion.__path__[0])"`
|
634
|
-
cd $PACKAGE_PATH/..
|
635
|
-
python -m flask --app psdi_data_conversion/app.py run
|
636
|
-
```
|
637
|
-
|
638
|
-
If desired, you can modify the environmental variables set in this script to modify the operation - see the comments on each for details.
|
639
|
-
|
640
604
|
### Running the App
|
641
605
|
|
642
|
-
|
606
|
+
Once installed, the command-line script `psdi-data-convert-gui` will be made available, which can be called to start the server. You can then access the website by going to <http://127.0.0.1:5000> in a browser (this will also be printed in the terminal, and you can CTRL+click it there to open it in your default browser). Guidance for using the app is given on each page of it. When you're finished with the app, key CTRL+C in the terminal where you called the script to shut down the server, or, if the process was backgrounded, kill the appropriate process.
|
643
607
|
|
644
608
|
In case of problems when using Chrome, try opening Chrome from the command line:
|
645
609
|
open -a "Google Chrome.app" --args --allow-file-access-from-files
|
@@ -662,28 +626,80 @@ To test the CLA and Python library, install the optional testing requirements lo
|
|
662
626
|
|
663
627
|
```bash
|
664
628
|
pip install .'[test]'
|
665
|
-
pytest
|
629
|
+
pytest tests/python
|
666
630
|
```
|
667
631
|
|
668
632
|
To test the local version of the web app, install the GUI testing requirements locally (which also include the standard GUI requirements and standard testing requirements), start the server, and test by executing the GUI test script:
|
669
633
|
|
670
634
|
```bash
|
671
635
|
pip install .'[gui-test]'
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
636
|
+
pytest tests/gui
|
637
|
+
```
|
638
|
+
|
639
|
+
Both of these sets of tests can also be run together if desired through:
|
640
|
+
|
641
|
+
```bash
|
642
|
+
pip install .'[gui-test]'
|
643
|
+
pytest
|
676
644
|
```
|
677
645
|
|
678
|
-
##
|
646
|
+
## Troubleshooting
|
647
|
+
|
648
|
+
This section presents solutions for commonly-encountered issues.
|
649
|
+
|
650
|
+
### OSError: [Errno 24] Too many open files
|
651
|
+
|
652
|
+
You may see the error:
|
653
|
+
|
654
|
+
```
|
655
|
+
OSError: [Errno 24] Too many open files
|
656
|
+
```
|
657
|
+
|
658
|
+
while running the command-line application, using the Python library, or running tests This error is caused by a program hitting the limit of the number of open filehandles allowed by the OS. This limit is typically set to 1024 on Linux systems and 256 on MacOS systems, and thus this issue occurs much more often on the latter. You can see what your current limit is by running the command:
|
659
|
+
|
660
|
+
```bash
|
661
|
+
ulimit -a | grep "open files"
|
662
|
+
```
|
663
|
+
|
664
|
+
This limit can be temporarily increased for the current terminal session by running the command:
|
665
|
+
|
666
|
+
```bash
|
667
|
+
ulimit -n 1024 # Or another, higher number
|
668
|
+
```
|
669
|
+
|
670
|
+
First, try increasing the limit and then redo the operation which caused this error to see if this resolves it. If this does, you can make this change permanent in a few ways, the easiest of which is to add this command to your `.bashrc` file so it will be set for every new terminal session.
|
671
|
+
|
672
|
+
If you see this error when the filehandle limit is already set to a high value such as 1024, this may indicate the presence of a bug in the project which causes a leaking of filehandles, so please open an issue about it, pasting the error you get and the details of your system, particularly including your current filehandle limit.
|
673
|
+
|
674
|
+
### Errors running c2x or Atomsk converters
|
675
|
+
|
676
|
+
We provide support for the c2x and Atomsk converters by packing binaries which support common Linux and MacOS platforms with this project, but we cannot guarantee universal support for these binaries. In particular, they may rely on dynamically-linked libraries which aren't installed on your system.
|
677
|
+
|
678
|
+
Look through the error message you received for messages such as "Library not loaded" or "no such file", and see if they point to the name of a library which you can try installing. For instance, if you see that it's searching for `libquadmath.0.dylib` but not finding it, you can try installing this library. In this case, this library can be installed through apt with:
|
679
|
+
|
680
|
+
```bash
|
681
|
+
sudo apt install libquadmath0
|
682
|
+
```
|
683
|
+
|
684
|
+
or through brew via:
|
685
|
+
|
686
|
+
```bash
|
687
|
+
brew install gcc
|
688
|
+
```
|
689
|
+
|
690
|
+
Alternatively, you can run your own versions of the `c2x` and `atomsk` binaries with this project. Compile them yourself however you wish - see the projects at https://github.com/codenrx/c2x and https://github.com/pierrehirel/atomsk and follow their instructions to build a binary on your system. Once you've done so, add the binary to your `$PATH`, and this project will pick that up and use it in preference to the prepackaged binary.
|
691
|
+
|
692
|
+
On the other hand, it's possible that an error of this sort will occur if you have a non-working binary of one of these converters in your `$PATH`. If this might be the case, you can try removing it and see if the prepackaged binary works for you, or else recompile it to try to fix errors.
|
693
|
+
|
694
|
+
## Licensing
|
679
695
|
|
680
696
|
This project is provided under the Apache License version 2.0, the terms of which can be found in the file `LICENSE`.
|
681
697
|
|
682
|
-
This project redistributes compiled binaries for the Atomsk and c2x converters. These are both
|
698
|
+
This project redistributes compiled binaries for the Atomsk and c2x converters. These are both licensed under the
|
683
699
|
GNU General Public License version 3 and are redistributed per its terms. Any further redistribution of these binaries,
|
684
|
-
including redistribution of this project as a whole, including them, must also follow the terms of this
|
700
|
+
including redistribution of this project as a whole, including them, must also follow the terms of this license.
|
685
701
|
|
686
|
-
This requires conspicuously displaying notice of this
|
702
|
+
This requires conspicuously displaying notice of this license, providing the text of of the license (provided here in
|
687
703
|
the files `psdi_data_conversion/bin/LICENSE_C2X` and `psdi_data_conversion/bin/LICENSE_ATOMSK`), and appropriately
|
688
704
|
conveying the source code for each of these. Their respective source code may be found at:
|
689
705
|
|
@@ -33,7 +33,10 @@ This is the repository for the PSDI PF2 Chemistry File Format Conversion project
|
|
33
33
|
- [Installation and Setup](#installation-and-setup)
|
34
34
|
- [Running the App](#running-the-app)
|
35
35
|
- [Testing](#testing)
|
36
|
-
- [
|
36
|
+
- [Troubleshooting](#troubleshooting)
|
37
|
+
- [OSError: [Errno 24] Too many open files](#oserror-errno-24-too-many-open-files)
|
38
|
+
- [Errors running c2x or Atomsk converters](#errors-running-c2x-or-atomsk-converters)
|
39
|
+
- [Licensing](#licensing)
|
37
40
|
- [Contributors](#contributors)
|
38
41
|
- [Funding](#funding)
|
39
42
|
|
@@ -67,15 +70,17 @@ This is the repository for the PSDI PF2 Chemistry File Format Conversion project
|
|
67
70
|
- `test_data`
|
68
71
|
- (Files used for testing the project)
|
69
72
|
- `tests`
|
70
|
-
-
|
73
|
+
- `gui`
|
74
|
+
- (Unit tests for the GUI, aka the local version of the web app)
|
75
|
+
- `python`
|
76
|
+
- (Unit tests for the Python library and command-line application)
|
71
77
|
- `CHANGELOG.md` (Updates since initial public release)
|
72
78
|
- `CONTRIBUTING.md` (Guidelines and information for contributors to the project)
|
73
79
|
- `DOCKERFILE` (Dockerfile for image containerising PSDI's data conversion service)
|
74
|
-
- `LICENSE` (Apache
|
80
|
+
- `LICENSE` (Apache License version 2.0)
|
75
81
|
- `pyproject.toml` (Python project metadata and settings)
|
76
82
|
- `README.md` (This file)
|
77
83
|
- `requirements.txt` (Requirements for the web app deployment of this project)
|
78
|
-
- `run_local.sh` (Helper script to run the web app locally)
|
79
84
|
|
80
85
|
## Requirements
|
81
86
|
|
@@ -351,50 +356,9 @@ pip install .'[gui]'
|
|
351
356
|
|
352
357
|
If your system does not allow installation in this manner, it may be necessary to set up a virtual environment. See the instructions in the [command-line application installation](#installation) section above for how to do that, and then try to install again once you've set one up and activated it.
|
353
358
|
|
354
|
-
If you've installed this repository from source, you can use the provided `run_local.sh` bash script to run the application. Otherwise (e.g. if you've installed from a wheel or PyPI), copy and paste the following into a script:
|
355
|
-
|
356
|
-
```bash
|
357
|
-
#!/bin/bash
|
358
|
-
|
359
|
-
# The envvar MAX_FILESIZE can be used to set the maximum allowed filesize in MB - 0 indicates no maximum
|
360
|
-
if [ -z $MAX_FILESIZE ]; then
|
361
|
-
export MAX_FILESIZE=0
|
362
|
-
fi
|
363
|
-
|
364
|
-
# The envvar MAX_FILESIZE_OB can be used to set the maximum allowed filesize in MB for the Open Babel converter - 0
|
365
|
-
# indicates no maximum. This is currently set to 1 MB by default as the converter seems to hang above this limit (not
|
366
|
-
# even allowing the process to be cancelled). This can be changed in the future if this is patched
|
367
|
-
if [ -z $MAX_FILESIZE_OB ]; then
|
368
|
-
export MAX_FILESIZE_OB=1
|
369
|
-
fi
|
370
|
-
|
371
|
-
# Logging control - "full" sets server-style logging, which is necessary to produce the output logs with the expected
|
372
|
-
# names. This should not be changed, or else errors will occur
|
373
|
-
export LOG_MODE=full
|
374
|
-
|
375
|
-
# The level to log at. Leave blank for defaults, which logs at INFO level for user output and ERROR level for the server
|
376
|
-
# log and stdout. If set to a different value here (e.g. DEBUG), all these channels will be set to that level
|
377
|
-
export LOG_LEVEL=
|
378
|
-
|
379
|
-
# The envvar SERVICE_MODE can be set to "true" to make this behave as if it's running as the public web service -
|
380
|
-
# uncomment the following line to enable that
|
381
|
-
# export SERVICE_MODE=true
|
382
|
-
|
383
|
-
# Uncomment the following line to enable debug mode
|
384
|
-
# export FLASK_ENV=development
|
385
|
-
|
386
|
-
# Execute a local run of the application from the proper path
|
387
|
-
|
388
|
-
PACKAGE_PATH=`python -c "import psdi_data_conversion; print(psdi_data_conversion.__path__[0])"`
|
389
|
-
cd $PACKAGE_PATH/..
|
390
|
-
python -m flask --app psdi_data_conversion/app.py run
|
391
|
-
```
|
392
|
-
|
393
|
-
If desired, you can modify the environmental variables set in this script to modify the operation - see the comments on each for details.
|
394
|
-
|
395
359
|
### Running the App
|
396
360
|
|
397
|
-
|
361
|
+
Once installed, the command-line script `psdi-data-convert-gui` will be made available, which can be called to start the server. You can then access the website by going to <http://127.0.0.1:5000> in a browser (this will also be printed in the terminal, and you can CTRL+click it there to open it in your default browser). Guidance for using the app is given on each page of it. When you're finished with the app, key CTRL+C in the terminal where you called the script to shut down the server, or, if the process was backgrounded, kill the appropriate process.
|
398
362
|
|
399
363
|
In case of problems when using Chrome, try opening Chrome from the command line:
|
400
364
|
open -a "Google Chrome.app" --args --allow-file-access-from-files
|
@@ -417,28 +381,80 @@ To test the CLA and Python library, install the optional testing requirements lo
|
|
417
381
|
|
418
382
|
```bash
|
419
383
|
pip install .'[test]'
|
420
|
-
pytest
|
384
|
+
pytest tests/python
|
421
385
|
```
|
422
386
|
|
423
387
|
To test the local version of the web app, install the GUI testing requirements locally (which also include the standard GUI requirements and standard testing requirements), start the server, and test by executing the GUI test script:
|
424
388
|
|
425
389
|
```bash
|
426
390
|
pip install .'[gui-test]'
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
391
|
+
pytest tests/gui
|
392
|
+
```
|
393
|
+
|
394
|
+
Both of these sets of tests can also be run together if desired through:
|
395
|
+
|
396
|
+
```bash
|
397
|
+
pip install .'[gui-test]'
|
398
|
+
pytest
|
431
399
|
```
|
432
400
|
|
433
|
-
##
|
401
|
+
## Troubleshooting
|
402
|
+
|
403
|
+
This section presents solutions for commonly-encountered issues.
|
404
|
+
|
405
|
+
### OSError: [Errno 24] Too many open files
|
406
|
+
|
407
|
+
You may see the error:
|
408
|
+
|
409
|
+
```
|
410
|
+
OSError: [Errno 24] Too many open files
|
411
|
+
```
|
412
|
+
|
413
|
+
while running the command-line application, using the Python library, or running tests This error is caused by a program hitting the limit of the number of open filehandles allowed by the OS. This limit is typically set to 1024 on Linux systems and 256 on MacOS systems, and thus this issue occurs much more often on the latter. You can see what your current limit is by running the command:
|
414
|
+
|
415
|
+
```bash
|
416
|
+
ulimit -a | grep "open files"
|
417
|
+
```
|
418
|
+
|
419
|
+
This limit can be temporarily increased for the current terminal session by running the command:
|
420
|
+
|
421
|
+
```bash
|
422
|
+
ulimit -n 1024 # Or another, higher number
|
423
|
+
```
|
424
|
+
|
425
|
+
First, try increasing the limit and then redo the operation which caused this error to see if this resolves it. If this does, you can make this change permanent in a few ways, the easiest of which is to add this command to your `.bashrc` file so it will be set for every new terminal session.
|
426
|
+
|
427
|
+
If you see this error when the filehandle limit is already set to a high value such as 1024, this may indicate the presence of a bug in the project which causes a leaking of filehandles, so please open an issue about it, pasting the error you get and the details of your system, particularly including your current filehandle limit.
|
428
|
+
|
429
|
+
### Errors running c2x or Atomsk converters
|
430
|
+
|
431
|
+
We provide support for the c2x and Atomsk converters by packing binaries which support common Linux and MacOS platforms with this project, but we cannot guarantee universal support for these binaries. In particular, they may rely on dynamically-linked libraries which aren't installed on your system.
|
432
|
+
|
433
|
+
Look through the error message you received for messages such as "Library not loaded" or "no such file", and see if they point to the name of a library which you can try installing. For instance, if you see that it's searching for `libquadmath.0.dylib` but not finding it, you can try installing this library. In this case, this library can be installed through apt with:
|
434
|
+
|
435
|
+
```bash
|
436
|
+
sudo apt install libquadmath0
|
437
|
+
```
|
438
|
+
|
439
|
+
or through brew via:
|
440
|
+
|
441
|
+
```bash
|
442
|
+
brew install gcc
|
443
|
+
```
|
444
|
+
|
445
|
+
Alternatively, you can run your own versions of the `c2x` and `atomsk` binaries with this project. Compile them yourself however you wish - see the projects at https://github.com/codenrx/c2x and https://github.com/pierrehirel/atomsk and follow their instructions to build a binary on your system. Once you've done so, add the binary to your `$PATH`, and this project will pick that up and use it in preference to the prepackaged binary.
|
446
|
+
|
447
|
+
On the other hand, it's possible that an error of this sort will occur if you have a non-working binary of one of these converters in your `$PATH`. If this might be the case, you can try removing it and see if the prepackaged binary works for you, or else recompile it to try to fix errors.
|
448
|
+
|
449
|
+
## Licensing
|
434
450
|
|
435
451
|
This project is provided under the Apache License version 2.0, the terms of which can be found in the file `LICENSE`.
|
436
452
|
|
437
|
-
This project redistributes compiled binaries for the Atomsk and c2x converters. These are both
|
453
|
+
This project redistributes compiled binaries for the Atomsk and c2x converters. These are both licensed under the
|
438
454
|
GNU General Public License version 3 and are redistributed per its terms. Any further redistribution of these binaries,
|
439
|
-
including redistribution of this project as a whole, including them, must also follow the terms of this
|
455
|
+
including redistribution of this project as a whole, including them, must also follow the terms of this license.
|
440
456
|
|
441
|
-
This requires conspicuously displaying notice of this
|
457
|
+
This requires conspicuously displaying notice of this license, providing the text of of the license (provided here in
|
442
458
|
the files `psdi_data_conversion/bin/LICENSE_C2X` and `psdi_data_conversion/bin/LICENSE_ATOMSK`), and appropriately
|
443
459
|
conveying the source code for each of these. Their respective source code may be found at:
|
444
460
|
|
@@ -5,6 +5,7 @@ Version 1.0, 8th November 2024
|
|
5
5
|
This script acts as a server for the PSDI Data Conversion Service website.
|
6
6
|
"""
|
7
7
|
|
8
|
+
from argparse import ArgumentParser
|
8
9
|
import hashlib
|
9
10
|
import os
|
10
11
|
import json
|
@@ -14,6 +15,7 @@ import sys
|
|
14
15
|
import traceback
|
15
16
|
from flask import Flask, request, render_template, abort, Response
|
16
17
|
|
18
|
+
import psdi_data_conversion
|
17
19
|
from psdi_data_conversion import log_utility
|
18
20
|
from psdi_data_conversion import constants as const
|
19
21
|
from psdi_data_conversion.converter import run_converter
|
@@ -63,6 +65,20 @@ else:
|
|
63
65
|
print(f"ERROR: {str(e)}")
|
64
66
|
exit(1)
|
65
67
|
|
68
|
+
# Get the maximum allowed size from the envvar for it
|
69
|
+
ev_max_file_size = os.environ.get(const.MAX_FILESIZE_EV)
|
70
|
+
if ev_max_file_size is not None:
|
71
|
+
max_file_size = float(ev_max_file_size)*const.MEGABYTE
|
72
|
+
else:
|
73
|
+
max_file_size = const.DEFAULT_MAX_FILE_SIZE
|
74
|
+
|
75
|
+
# And same for the Open Babel maximum file size
|
76
|
+
ev_max_file_size_ob = os.environ.get(const.MAX_FILESIZE_OB_EV)
|
77
|
+
if ev_max_file_size_ob is not None:
|
78
|
+
max_file_size_ob = float(ev_max_file_size_ob)*const.MEGABYTE
|
79
|
+
else:
|
80
|
+
max_file_size_ob = const.DEFAULT_MAX_FILE_SIZE_OB
|
81
|
+
|
66
82
|
app = Flask(__name__)
|
67
83
|
|
68
84
|
|
@@ -95,19 +111,6 @@ def get_last_sha() -> str:
|
|
95
111
|
def website():
|
96
112
|
"""Return the web page along with the token
|
97
113
|
"""
|
98
|
-
# Get the maximum allowed size from the envvar for it
|
99
|
-
ev_max_file_size = os.environ.get(const.MAX_FILESIZE_EV)
|
100
|
-
if ev_max_file_size is not None:
|
101
|
-
max_file_size = float(ev_max_file_size)*const.MEGABYTE
|
102
|
-
else:
|
103
|
-
max_file_size = const.DEFAULT_MAX_FILE_SIZE
|
104
|
-
|
105
|
-
# And same for the Open Babel maximum file size
|
106
|
-
ev_max_file_size_ob = os.environ.get(const.MAX_FILESIZE_OB_EV)
|
107
|
-
if ev_max_file_size_ob is not None:
|
108
|
-
max_file_size_ob = float(ev_max_file_size_ob)*const.MEGABYTE
|
109
|
-
else:
|
110
|
-
max_file_size_ob = const.DEFAULT_MAX_FILE_SIZE_OB
|
111
114
|
|
112
115
|
data = [{'token': token,
|
113
116
|
'max_file_size': max_file_size,
|
@@ -143,7 +146,7 @@ def convert():
|
|
143
146
|
data=request.form,
|
144
147
|
to_format=request.form['to'],
|
145
148
|
from_format=request.form['from'],
|
146
|
-
strict=request.form['check_ext'],
|
149
|
+
strict=(request.form['check_ext'] != "false"),
|
147
150
|
log_mode=log_mode,
|
148
151
|
log_level=log_level,
|
149
152
|
delete_input=True,
|
@@ -260,3 +263,80 @@ def data():
|
|
260
263
|
else:
|
261
264
|
# return http status code 405
|
262
265
|
abort(405)
|
266
|
+
|
267
|
+
|
268
|
+
def start_app():
|
269
|
+
"""Start the Flask app - this requires being run from the base directory of the project, so this changes the
|
270
|
+
current directory to there. Anything else which changes it while the app is running may interfere with its proper
|
271
|
+
execution.
|
272
|
+
"""
|
273
|
+
|
274
|
+
os.chdir(os.path.join(psdi_data_conversion.__path__[0], ".."))
|
275
|
+
app.run()
|
276
|
+
|
277
|
+
|
278
|
+
def main():
|
279
|
+
"""Standard entry-point function for this script.
|
280
|
+
"""
|
281
|
+
|
282
|
+
parser = ArgumentParser()
|
283
|
+
|
284
|
+
parser.add_argument("--use-env-vars", action="store_true",
|
285
|
+
help="If set, all other arguments and defaults for this script are ignored, and environmental "
|
286
|
+
"variables and their defaults will instead control execution. These defaults will result in "
|
287
|
+
"the app running in production server mode.")
|
288
|
+
|
289
|
+
parser.add_argument("--max-file-size", type=float, default=const.DEFAULT_MAX_FILE_SIZE,
|
290
|
+
help="The maximum allowed filesize in MB - 0 (default) indicates no maximum")
|
291
|
+
|
292
|
+
parser.add_argument("--max-file-size-ob", type=float, default=const.DEFAULT_MAX_FILE_SIZE_OB,
|
293
|
+
help="The maximum allowed filesize in MB for the Open Babel converter, taking precendence over "
|
294
|
+
"the general maximum file size when Open Babel is used - 0 indicates no maximum. Default 1 MB.")
|
295
|
+
|
296
|
+
parser.add_argument("--service-mode", action="store_true",
|
297
|
+
help="If set, will run as if deploying a service rather than the local GUI")
|
298
|
+
|
299
|
+
parser.add_argument("--dev-mode", action="store_true",
|
300
|
+
help="If set, will expose development elements")
|
301
|
+
|
302
|
+
parser.add_argument("--log-mode", type=str, default=const.LOG_FULL,
|
303
|
+
help="How logs should be stored. Allowed values are: \n"
|
304
|
+
"- 'full' - Multi-file logging, not recommended for the CLI, but allowed for a compatible "
|
305
|
+
"interface with the public web app"
|
306
|
+
"- 'simple' - Logs saved to one file"
|
307
|
+
"- 'stdout' - Output logs and errors only to stdout"
|
308
|
+
"- 'none' - Output only errors to stdout")
|
309
|
+
|
310
|
+
parser.add_argument("--log-level", type=str, default=None,
|
311
|
+
help="The desired level to log at. Allowed values are: 'DEBUG', 'INFO', 'WARNING', 'ERROR, "
|
312
|
+
"'CRITICAL'. Default: 'INFO' for logging to file, 'WARNING' for logging to stdout")
|
313
|
+
|
314
|
+
# Set global variables for settings based on parsed arguments, unless it's set to use env vars
|
315
|
+
args = parser.parse_args()
|
316
|
+
|
317
|
+
if not args.use_env_vars:
|
318
|
+
|
319
|
+
global max_file_size
|
320
|
+
max_file_size = args.max_file_size*const.MEGABYTE
|
321
|
+
|
322
|
+
global max_file_size_ob
|
323
|
+
max_file_size_ob = args.max_file_size_ob*const.MEGABYTE
|
324
|
+
|
325
|
+
global service_mode
|
326
|
+
service_mode = args.service_mode
|
327
|
+
|
328
|
+
global production_mode
|
329
|
+
production_mode = not args.dev_mode
|
330
|
+
|
331
|
+
global log_mode
|
332
|
+
log_mode = args.log_mode
|
333
|
+
|
334
|
+
global log_level
|
335
|
+
log_level = args.log_level
|
336
|
+
|
337
|
+
start_app()
|
338
|
+
|
339
|
+
|
340
|
+
if __name__ == "__main__":
|
341
|
+
|
342
|
+
main()
|
{psdi_data_conversion-0.0.36 → psdi_data_conversion-0.0.37}/psdi_data_conversion/converters/base.py
RENAMED
@@ -284,9 +284,9 @@ class FileConverter:
|
|
284
284
|
if max_file_size is None:
|
285
285
|
from psdi_data_conversion.converters.openbabel import CONVERTER_OB
|
286
286
|
if self.name == CONVERTER_OB:
|
287
|
-
self.max_file_size = const.DEFAULT_MAX_FILE_SIZE_OB
|
287
|
+
self.max_file_size = const.DEFAULT_MAX_FILE_SIZE_OB
|
288
288
|
else:
|
289
|
-
self.max_file_size = const.DEFAULT_MAX_FILE_SIZE
|
289
|
+
self.max_file_size = const.DEFAULT_MAX_FILE_SIZE
|
290
290
|
else:
|
291
291
|
self.max_file_size = max_file_size*const.MEGABYTE
|
292
292
|
|
@@ -43,6 +43,8 @@
|
|
43
43
|
Python library.
|
44
44
|
</p>
|
45
45
|
|
46
|
+
<h2>Installation</h2>
|
47
|
+
|
46
48
|
<h3>Install via pip</h3>
|
47
49
|
|
48
50
|
<ul>
|
@@ -63,12 +65,6 @@
|
|
63
65
|
Python library.
|
64
66
|
</p>
|
65
67
|
|
66
|
-
<p>
|
67
|
-
If you do wish to run the local version of this webpage, you'll need to create a helper script to set up the
|
68
|
-
proper parameters and start the server. See the README provided on the front page of this project's PyPI page,
|
69
|
-
linked above, for the source of this helper script, which you can paste and use locally.
|
70
|
-
</p>
|
71
|
-
|
72
68
|
<h3>Source Code</h3>
|
73
69
|
|
74
70
|
<ul>
|
@@ -86,11 +82,28 @@
|
|
86
82
|
for other possible optional dependencies sets that can be installed.
|
87
83
|
</p>
|
88
84
|
|
89
|
-
<
|
90
|
-
|
91
|
-
|
85
|
+
<h2>Use</h2>
|
86
|
+
|
87
|
+
<p>
|
88
|
+
Once installed, the project can be used in one of three ways:
|
92
89
|
</p>
|
93
90
|
|
91
|
+
<ul>
|
92
|
+
<li><strong>Local Gui:</strong> Run the script <code class="secondary">psdi-data-convert-gui</code> to start the
|
93
|
+
server. Append the <code class="secondary">--help</code> option for to see optional arguments (generally not
|
94
|
+
required for end-users)
|
95
|
+
</li>
|
96
|
+
<li><strong>Command-Line Application:</strong> Run the script <code class="secondary">psdi-data-convert</code>
|
97
|
+
to use the application at the command-line. Append the <code class="secondary">--help</code> option to see
|
98
|
+
arguments for it, and/or find documentation in the project's README.
|
99
|
+
</li>
|
100
|
+
<li><strong>Python Library:</strong> Within a Python script, library, or terminal, the project can be imported
|
101
|
+
via <code class="secondary">import psdi_data_conversion</code>, with the most useful function being <code
|
102
|
+
class="secondary">psdi_data_conversion.converter.run_converter</code> - see the <code
|
103
|
+
class="secondary">help()</code> of this function and/or find documentation in the project's README.
|
104
|
+
</li>
|
105
|
+
</ul>
|
106
|
+
|
94
107
|
<h2>Documentation</h2>
|
95
108
|
|
96
109
|
<ul>
|
@@ -228,7 +228,7 @@ body {
|
|
228
228
|
top : 0;
|
229
229
|
left : 0;
|
230
230
|
background: var(--ifm-background-color);
|
231
|
-
z-index :
|
231
|
+
z-index : 99999;
|
232
232
|
}
|
233
233
|
|
234
234
|
select,
|
@@ -412,7 +412,8 @@ h6 {
|
|
412
412
|
}
|
413
413
|
|
414
414
|
p {
|
415
|
-
margin: 0 0 1.25rem 0;
|
415
|
+
margin : 0 0 1.25rem 0;
|
416
|
+
padding-bottom: 0;
|
416
417
|
}
|
417
418
|
|
418
419
|
.text--center {
|
@@ -546,9 +547,9 @@ a svg {
|
|
546
547
|
}
|
547
548
|
|
548
549
|
.navbar__title h5 {
|
549
|
-
display:
|
550
|
+
display: flex;
|
550
551
|
color : var(--ifm-heading-color);
|
551
|
-
margin : 0 0 0.5rem
|
552
|
+
margin : 0 0 0.5rem 1.5rem;
|
552
553
|
}
|
553
554
|
|
554
555
|
.navbar__logo img {
|