mat3ra-api-examples 0.1.0__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.
Files changed (105) hide show
  1. mat3ra-api-examples-0.1.0/.gitattributes +17 -0
  2. mat3ra-api-examples-0.1.0/.github/workflows/check_links.yml +16 -0
  3. mat3ra-api-examples-0.1.0/.github/workflows/cicd.yml +133 -0
  4. mat3ra-api-examples-0.1.0/.github/workflows/zip_release.yml +51 -0
  5. mat3ra-api-examples-0.1.0/.gitignore +112 -0
  6. mat3ra-api-examples-0.1.0/.lycheeignore +3 -0
  7. mat3ra-api-examples-0.1.0/.pre-commit-config.yaml +15 -0
  8. mat3ra-api-examples-0.1.0/PKG-INFO +146 -0
  9. mat3ra-api-examples-0.1.0/README.md +114 -0
  10. mat3ra-api-examples-0.1.0/examples/assets/README.md +7 -0
  11. mat3ra-api-examples-0.1.0/examples/assets/Si.pz-vbc.UPF +3 -0
  12. mat3ra-api-examples-0.1.0/examples/assets/bash_workflow_template.json +150 -0
  13. mat3ra-api-examples-0.1.0/examples/assets/mp-978534.poscar +12 -0
  14. mat3ra-api-examples-0.1.0/examples/config.py +44 -0
  15. mat3ra-api-examples-0.1.0/examples/job/create_and_submit_job.ipynb +275 -0
  16. mat3ra-api-examples-0.1.0/examples/job/create_and_submit_job.py +127 -0
  17. mat3ra-api-examples-0.1.0/examples/job/get-file-from-job.ipynb +400 -0
  18. mat3ra-api-examples-0.1.0/examples/job/get-file-from-job.py +227 -0
  19. mat3ra-api-examples-0.1.0/examples/job/ml-train-model-predict-properties.ipynb +715 -0
  20. mat3ra-api-examples-0.1.0/examples/job/ml-train-model-predict-properties.py +347 -0
  21. mat3ra-api-examples-0.1.0/examples/job/run-simulations-and-extract-properties.ipynb +658 -0
  22. mat3ra-api-examples-0.1.0/examples/job/run-simulations-and-extract-properties.py +343 -0
  23. mat3ra-api-examples-0.1.0/examples/material/api_interoperability_showcase.ipynb +259 -0
  24. mat3ra-api-examples-0.1.0/examples/material/api_interoperability_showcase.py +116 -0
  25. mat3ra-api-examples-0.1.0/examples/material/create_material.ipynb +225 -0
  26. mat3ra-api-examples-0.1.0/examples/material/create_material.py +115 -0
  27. mat3ra-api-examples-0.1.0/examples/material/get_materials_by_formula.ipynb +222 -0
  28. mat3ra-api-examples-0.1.0/examples/material/get_materials_by_formula.py +97 -0
  29. mat3ra-api-examples-0.1.0/examples/material/import_materials_from_materialsproject.ipynb +202 -0
  30. mat3ra-api-examples-0.1.0/examples/material/import_materials_from_materialsproject.py +93 -0
  31. mat3ra-api-examples-0.1.0/examples/material/upload_materials_from_file_poscar.ipynb +209 -0
  32. mat3ra-api-examples-0.1.0/examples/material/upload_materials_from_file_poscar.py +100 -0
  33. mat3ra-api-examples-0.1.0/examples/system/get_authentication_params.ipynb +150 -0
  34. mat3ra-api-examples-0.1.0/examples/system/get_authentication_params.py +67 -0
  35. mat3ra-api-examples-0.1.0/examples/workflow/get_workflows.ipynb +233 -0
  36. mat3ra-api-examples-0.1.0/examples/workflow/get_workflows.py +103 -0
  37. mat3ra-api-examples-0.1.0/examples/workflow/qe_scf_calculation.ipynb +363 -0
  38. mat3ra-api-examples-0.1.0/examples/workflow/qe_scf_calculation.py +240 -0
  39. mat3ra-api-examples-0.1.0/extra/css/custom.css +9 -0
  40. mat3ra-api-examples-0.1.0/images/reusable-kernel.png +0 -0
  41. mat3ra-api-examples-0.1.0/mat3ra_api_examples.egg-info/PKG-INFO +146 -0
  42. mat3ra-api-examples-0.1.0/mat3ra_api_examples.egg-info/SOURCES.txt +105 -0
  43. mat3ra-api-examples-0.1.0/mat3ra_api_examples.egg-info/dependency_links.txt +1 -0
  44. mat3ra-api-examples-0.1.0/mat3ra_api_examples.egg-info/entry_points.txt +2 -0
  45. mat3ra-api-examples-0.1.0/mat3ra_api_examples.egg-info/requires.txt +27 -0
  46. mat3ra-api-examples-0.1.0/mat3ra_api_examples.egg-info/top_level.txt +1 -0
  47. mat3ra-api-examples-0.1.0/mkdocs.yml +88 -0
  48. mat3ra-api-examples-0.1.0/other/assets/README.md +38 -0
  49. mat3ra-api-examples-0.1.0/other/assets/bitter-sweet.csv +4795 -0
  50. mat3ra-api-examples-0.1.0/other/assets/bittersweet_xgboost.pkl +3 -0
  51. mat3ra-api-examples-0.1.0/other/assets/deepchem_smiles_vocab.txt +3 -0
  52. mat3ra-api-examples-0.1.0/other/assets/gamma_alumina_digne_et_al.poscar +48 -0
  53. mat3ra-api-examples-0.1.0/other/assets/sci_adv_dean_data.csv +163 -0
  54. mat3ra-api-examples-0.1.0/other/experiments/create_interface_with_min_energy_by_miller_indices.ipynb +624 -0
  55. mat3ra-api-examples-0.1.0/other/experiments/create_interface_with_relaxation_alignn.ipynb +645 -0
  56. mat3ra-api-examples-0.1.0/other/experiments/create_interface_with_relaxation_ase_emt.ipynb +643 -0
  57. mat3ra-api-examples-0.1.0/other/experiments/create_interface_with_relaxation_matgl_m3gnet.ipynb +649 -0
  58. mat3ra-api-examples-0.1.0/other/experiments/uploads/Gr.json +1 -0
  59. mat3ra-api-examples-0.1.0/other/experiments/uploads/Ni.json +1 -0
  60. mat3ra-api-examples-0.1.0/other/jarvis/import_material_from_jarvis_db_entry.ipynb +137 -0
  61. mat3ra-api-examples-0.1.0/other/jarvis/run_job_using_material_from_jarvis_db.ipynb +574 -0
  62. mat3ra-api-examples-0.1.0/other/job/Smiles_Generation_Markov_Chain.ipynb +3 -0
  63. mat3ra-api-examples-0.1.0/other/job/Smiles_Generation_Markov_Chain.py +289 -0
  64. mat3ra-api-examples-0.1.0/other/jupyterlite/utils.py +196 -0
  65. mat3ra-api-examples-0.1.0/other/machine_learning/Classification_of_Bitterness_XGBoost.ipynb +3 -0
  66. mat3ra-api-examples-0.1.0/other/machine_learning/Classification_of_Bitterness_XGBoost.py +386 -0
  67. mat3ra-api-examples-0.1.0/other/machine_learning/Prediction_of_Perovskite_Unit_Cell_Volume.ipynb +3 -0
  68. mat3ra-api-examples-0.1.0/other/machine_learning/Prediction_of_Perovskite_Unit_Cell_Volume.py +306 -0
  69. mat3ra-api-examples-0.1.0/other/machine_learning/neural_network_train.ipynb +3 -0
  70. mat3ra-api-examples-0.1.0/other/machine_learning/neural_network_train.py +363 -0
  71. mat3ra-api-examples-0.1.0/other/materials_designer/Introduction.ipynb +43 -0
  72. mat3ra-api-examples-0.1.0/other/materials_designer/config.yml +55 -0
  73. mat3ra-api-examples-0.1.0/other/materials_designer/create_interface_with_min_strain_zsl.ipynb +458 -0
  74. mat3ra-api-examples-0.1.0/other/materials_designer/create_interface_with_relaxation_ase_emt.ipynb +740 -0
  75. mat3ra-api-examples-0.1.0/other/materials_designer/import_material_from_jarvis_db_entry.ipynb +283 -0
  76. mat3ra-api-examples-0.1.0/other/materials_designer/import_materials_from_files.ipynb +297 -0
  77. mat3ra-api-examples-0.1.0/other/materials_designer/src/pymatgen_coherent_interface_builder.py +309 -0
  78. mat3ra-api-examples-0.1.0/other/materials_designer/src/utils.py +350 -0
  79. mat3ra-api-examples-0.1.0/other/materials_designer/uploads/README +1 -0
  80. mat3ra-api-examples-0.1.0/other/python_transformations/1_layer_on_substrate.py +253 -0
  81. mat3ra-api-examples-0.1.0/other/python_transformations/2_strain_matching.py +559 -0
  82. mat3ra-api-examples-0.1.0/other/python_transformations/3_imports.py +42 -0
  83. mat3ra-api-examples-0.1.0/other/python_transformations/4_custom_transformation.py +32 -0
  84. mat3ra-api-examples-0.1.0/other/python_transformations/README.md +23 -0
  85. mat3ra-api-examples-0.1.0/other/webinar/adsorption-study.ipynb +3 -0
  86. mat3ra-api-examples-0.1.0/other/webinar/adsorption-study.py +295 -0
  87. mat3ra-api-examples-0.1.0/other/webinar/generate-al2o3-slab-structures.ipynb +3 -0
  88. mat3ra-api-examples-0.1.0/other/webinar/generate-al2o3-slab-structures.py +234 -0
  89. mat3ra-api-examples-0.1.0/other/webinar/predict_with_machine_learning.ipynb +3 -0
  90. mat3ra-api-examples-0.1.0/other/webinar/predict_with_machine_learning.py +162 -0
  91. mat3ra-api-examples-0.1.0/other/webinar/wulff-construction-surface-energy-study-cu.ipynb +3 -0
  92. mat3ra-api-examples-0.1.0/other/webinar/wulff-construction-surface-energy-study-cu.py +445 -0
  93. mat3ra-api-examples-0.1.0/pyproject.toml +83 -0
  94. mat3ra-api-examples-0.1.0/scripts/change-branch-in-urls.sh +52 -0
  95. mat3ra-api-examples-0.1.0/scripts/env.sh +40 -0
  96. mat3ra-api-examples-0.1.0/scripts/render-notebooks.sh +68 -0
  97. mat3ra-api-examples-0.1.0/setup.cfg +4 -0
  98. mat3ra-api-examples-0.1.0/utils/__init__.py +0 -0
  99. mat3ra-api-examples-0.1.0/utils/generic.py +225 -0
  100. mat3ra-api-examples-0.1.0/utils/material.py +209 -0
  101. mat3ra-api-examples-0.1.0/utils/notebook.py +46 -0
  102. mat3ra-api-examples-0.1.0/utils/settings.json +6 -0
  103. mat3ra-api-examples-0.1.0/utils/settings.py +56 -0
  104. mat3ra-api-examples-0.1.0/utils/web/renderjson.css +10 -0
  105. mat3ra-api-examples-0.1.0/utils/web/renderjson.js +205 -0
@@ -0,0 +1,17 @@
1
+ *.csv filter=lfs diff=lfs merge=lfs -text
2
+ *.vasp filter=lfs diff=lfs merge=lfs -text
3
+ *.poscar filter=lfs diff=lfs merge=lfs -text
4
+ examples/job/create_and_submit_job.ipynb !filter !diff !merge text
5
+ examples/job/get-file-from-job.ipynb !filter !diff !merge text
6
+ examples/job/ml-train-model-predict-properties.ipynb !filter !diff !merge text
7
+ examples/job/run-simulations-and-extract-properties.ipynb !filter !diff !merge text
8
+ examples/material/api_interoperability_showcase.ipynb !filter !diff !merge text
9
+ examples/material/create_material.ipynb !filter !diff !merge text
10
+ examples/material/get_materials_by_formula.ipynb !filter !diff !merge text
11
+ examples/material/import_materials_from_materialsproject.ipynb !filter !diff !merge text
12
+ examples/material/import_materials_from_poscar.ipynb !filter !diff !merge text
13
+ examples/system/get_authentication_params.ipynb !filter !diff !merge text
14
+ examples/workflow/get_workflows.ipynb !filter !diff !merge text
15
+ images/*.png filter=lfs diff=lfs merge=lfs -text
16
+ *.upf filter=lfs diff=lfs merge=lfs -text
17
+ examples/assets/bash_workflow_template.json filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,16 @@
1
+ name: check_links
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ check-links:
7
+ # Do not run this check if a PR is created from the same repo.
8
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
9
+ runs-on: ubuntu-latest
10
+ timeout-minutes: 10
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - name: Link Checker
14
+ uses: lycheeverse/lychee-action@v1.8.0
15
+ with:
16
+ fail: true
@@ -0,0 +1,133 @@
1
+ name: Continuous Testing and Docs Publication
2
+
3
+ on: [push]
4
+
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
9
+ jobs:
10
+ run-linter:
11
+ runs-on: ubuntu-20.04
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.8.6"]
15
+
16
+ steps:
17
+ - name: Checkout this repository
18
+ uses: actions/checkout@v3
19
+ with:
20
+ lfs: true
21
+
22
+ - uses: actions/setup-python@v4
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Run pre-commit hooks
27
+ run: |
28
+ python -m pip install pre-commit
29
+ pre-commit run --all-files --show-diff-on-failure
30
+
31
+ publish-py-package:
32
+ needs: [run-linter]
33
+ runs-on: ubuntu-latest
34
+ if: github.ref_name == 'dev'
35
+
36
+ steps:
37
+ - name: Checkout this repository
38
+ uses: actions/checkout@v4
39
+ with:
40
+ lfs: true
41
+
42
+ - name: Checkout actions repository
43
+ uses: actions/checkout@v4
44
+ with:
45
+ repository: Exabyte-io/actions
46
+ token: ${{ secrets.BOT_GITHUB_TOKEN }}
47
+ path: actions
48
+
49
+ - name: Publish python release
50
+ uses: ./actions/py/publish
51
+ with:
52
+ python-version: 3.8.x
53
+ github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
54
+ pypi-api-token: ${{ secrets.PYPI_API_TOKEN }}
55
+
56
+ # TODO: Add back when when fixed.
57
+ # build-and-deploy-docs:
58
+ # runs-on: ubuntu-20.04
59
+ # strategy:
60
+ # matrix:
61
+ # python-version: ["3.8.6"]
62
+ # env:
63
+ # ACCOUNT_ID: ${{ secrets.DEMO_ACCOUNT_ID }}
64
+ # AUTH_TOKEN: ${{ secrets.DEMO_AUTH_TOKEN }}
65
+ # MATERIALS_PROJECT_API_KEY: ${{ secrets.MATERIALS_PROJECT_API_KEY }}
66
+ # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
67
+ # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
68
+ # DOCS_MAT3RA_COM_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.DOCS_MAT3RA_COM_CLOUDFRONT_DISTRIBUTION_ID }}
69
+ # defaults:
70
+ # run:
71
+ # shell: bash -l {0}
72
+ #
73
+ # steps:
74
+ # - name: Checkout this repository
75
+ # uses: actions/checkout@v3
76
+ # with:
77
+ # lfs: true
78
+ #
79
+ # - uses: actions/setup-python@v4
80
+ # with:
81
+ # python-version: ${{ matrix.python-version }}
82
+ #
83
+ # - name: Install dependencies
84
+ # run: |
85
+ # set -euo pipefail
86
+ #
87
+ # python -m pip install -ve ".[localhost, docs]"
88
+ # python -m pip list
89
+ #
90
+ # - name: Export requirements.txt
91
+ # run: |
92
+ # pip install pip-tools
93
+ # for extra in colab localhost dev docs; do
94
+ # python -m piptools compile --resolver=backtracking --extra ${extra} -o requirements-${extra}.txt pyproject.toml
95
+ # done
96
+ #
97
+ # - name: Build documentation
98
+ # run : |
99
+ # mkdocs build -d site
100
+ #
101
+ # - uses: actions/upload-artifact@v3
102
+ # with:
103
+ # name: rendered-notebooks-py${{ matrix.python-version }}
104
+ # path: site
105
+ # - uses: actions/upload-artifact@v3
106
+ # with:
107
+ # name: requirements-py${{ matrix.python-version }}
108
+ # path: requirements-*.txt
109
+ #
110
+ # - name: Deploy documentation to Exabyte-io.github.io
111
+ # if: github.repository_owner == 'Exabyte-io' && github.ref_name == 'dev' && matrix.python-version == '3.8'
112
+ # # We pin to the SHA, not the tag, for security reasons.
113
+ # # https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
114
+ # uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
115
+ # with:
116
+ # github_token: ${{ secrets.GITHUB_TOKEN }}
117
+ # publish_branch: dev-with-documentation
118
+ # publish_dir: ./site
119
+ # destination_dir: ./docs
120
+ # keep_files: true # Keep old files.
121
+ # force_orphan: false # Keep git history.
122
+ #
123
+ # - name: S3 Deploy
124
+ # if: github.repository_owner == 'Exabyte-io' && github.ref_name == 'dev' && matrix.python-version == '3.8'
125
+ # uses: Exabyte-io/action-s3-deploy@v3
126
+ # with:
127
+ # folder: site
128
+ # bucket: docs.mat3ra.com/rest-api/api-examples/rendered-notebooks
129
+ # bucket-region: us-west-2
130
+ # dist-id: ${{ env.DOCS_MAT3RA_COM_CLOUDFRONT_DISTRIBUTION_ID }}
131
+ # invalidation: /*
132
+ # no-cache: true
133
+ # private: true
@@ -0,0 +1,51 @@
1
+ name: zip_release
2
+
3
+ # Controls when the action will run.
4
+ on:
5
+ # Triggers the workflow on push or pull request events but only for the master branch
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ master ]
10
+
11
+ # Allows you to run this workflow manually from the Actions tab
12
+ workflow_dispatch:
13
+
14
+ jobs:
15
+ build:
16
+ name: Upload Release
17
+ runs-on: ubuntu-latest
18
+
19
+ steps:
20
+ - name: Checkout Code
21
+ uses: actions/checkout@v2
22
+ with:
23
+ lfs: true
24
+
25
+ - name: Checkout LFS Objects
26
+ run: git lfs checkout
27
+
28
+ - name: Zip Files
29
+ run: zip -r release.zip . -x ".git/*" ".github/*"
30
+
31
+ - name: Create Release
32
+ id: create_release
33
+ uses: actions/create-release@v1
34
+ env:
35
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36
+ with:
37
+ tag_name: ${{ github.ref }}
38
+ release_name: Zip Archive, ${{ github.ref }}
39
+ draft: true
40
+ prerelease: false
41
+
42
+ - name: Upload Release Asset
43
+ id: upload-release-asset
44
+ uses: actions/upload-release-asset@v1
45
+ env:
46
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47
+ with:
48
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
49
+ asset_path: ./release.zip
50
+ asset_name: release.zip
51
+ asset_content_type: application/zip
@@ -0,0 +1,112 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ .hypothesis/
48
+ .pytest_cache/
49
+
50
+ # Translations
51
+ *.mo
52
+ *.pot
53
+
54
+ # Django stuff:
55
+ *.log
56
+ local_settings.py
57
+ db.sqlite3
58
+
59
+ # Flask stuff:
60
+ instance/
61
+ .webassets-cache
62
+
63
+ # Scrapy stuff:
64
+ .scrapy
65
+
66
+ # Sphinx documentation
67
+ docs/_build/
68
+
69
+ # PyBuilder
70
+ target/
71
+
72
+ # Jupyter Notebook
73
+ .ipynb_checkpoints
74
+
75
+ # pyenv
76
+ .python-version
77
+
78
+ # celery beat schedule file
79
+ celerybeat-schedule
80
+
81
+ # SageMath parsed files
82
+ *.sage.py
83
+
84
+ # Environments
85
+ .env
86
+ .venv
87
+ env/
88
+ venv/
89
+ ENV/
90
+ env.bak/
91
+ venv.bak/
92
+
93
+ # Spyder project settings
94
+ .spyderproject
95
+ .spyproject
96
+
97
+ # Rope project settings
98
+ .ropeproject
99
+
100
+ # mkdocs documentation
101
+ /site
102
+
103
+ # mypy
104
+ .mypy_cache/
105
+
106
+ .idea
107
+
108
+ # Miscellaneous
109
+ examples/assets/Molecules_Dataset_Collection
110
+ pw_scf.*
111
+ examples/**/*.html
112
+ .DS_Store
@@ -0,0 +1,3 @@
1
+ https://pubs.acs.org/doi/abs/10.1021/acs.nanolett.8b00670
2
+ https://advances.sciencemag.org/content/5/9/eaax5101.abstract
3
+ https://www.vasp.at/wiki/index.php/Input
@@ -0,0 +1,15 @@
1
+ exclude: ^((examples|other)\/.*\/.*\.(py|poscar|csv))
2
+ repos:
3
+ - repo: https://github.com/Exabyte-io/pre-commit-hooks
4
+ rev: 2023.6.28
5
+ hooks:
6
+ - id: ruff
7
+ - id: black
8
+ - id: black-jupyter
9
+ exclude: ^other\/.*\/.*\.ipynb
10
+ - id: isort
11
+ - id: mypy
12
+ exclude: ^examples\/config\.py
13
+ - id: check-yaml
14
+ - id: end-of-file-fixer
15
+ - id: trailing-whitespace
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.1
2
+ Name: mat3ra-api-examples
3
+ Version: 0.1.0
4
+ Summary: Mat3ra API Examples
5
+ Project-URL: homepage, https://exabyte-io.github.io/api-examples
6
+ Project-URL: documentation, https://exabyte-io.github.io/api-examples
7
+ Project-URL: repository, https://github.com/Exabyte-io/api-examples
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: ase>=3.21.1
11
+ Requires-Dist: exabyte-api-client>=2023.6.13.post0
12
+ Requires-Dist: matplotlib>=3.4.1
13
+ Requires-Dist: pandas>=1.5.3
14
+ Requires-Dist: pymatgen>=2023.5.31
15
+ Provides-Extra: colab
16
+ Requires-Dist: mat3ra-api-examples; extra == "colab"
17
+ Provides-Extra: jupyterlab
18
+ Requires-Dist: jupyterlab>=3.0.17; extra == "jupyterlab"
19
+ Requires-Dist: nbconvert>=6.0.7; extra == "jupyterlab"
20
+ Provides-Extra: localhost
21
+ Requires-Dist: mat3ra-api-examples[jupyterlab]; extra == "localhost"
22
+ Provides-Extra: dev
23
+ Requires-Dist: pre-commit>=3.3.3; extra == "dev"
24
+ Requires-Dist: pip-tools>=6.13.0; extra == "dev"
25
+ Provides-Extra: docs
26
+ Requires-Dist: mkdocs>=1.4.3; extra == "docs"
27
+ Requires-Dist: mkdocs-material>=9.1.17; extra == "docs"
28
+ Requires-Dist: mkdocs-same-dir>=0.1.2; extra == "docs"
29
+ Requires-Dist: mkdocs-exclude>=1.0.2; extra == "docs"
30
+ Requires-Dist: mkdocs-jupyter>=0.24.1; extra == "docs"
31
+ Requires-Dist: nbstripout>=0.6.1; extra == "docs"
32
+
33
+ # Mat3ra API Examples
34
+
35
+ ## Contents of this Repository
36
+
37
+ Below, we list the contents of this repository, in roughly the order that a user might want to go through it in order to learn how our API works.
38
+
39
+ | Folder | Notebook | Description |
40
+ | ------------------|-----------------------------------------| ----------- |
41
+ | [Examples/System](examples/system/) | [Get Authentication Params](examples/system/get_authentication_params.ipynb) | Demonstrates how to programatically find your user ID and access token, which is to [authenticate](https://docs.mat3ra.com/rest-api/authentication/) for many portions of the Mat3ra API.
42
+ | [Examples/Workflow](examples/workflow/) | [Get Workflows](examples/workflow/get_workflows.ipynb) | Walks through how to [query](https://docs.mat3ra.com/rest-api/query-structure/) the Mat3ra API to programatically search for workflows. In this example, we search for workflows that calculate the total energy of a material.
43
+ | [Examples/Workflow](examples/workflow/) | [Quantum Espresso Workflow and Job](examples/workflow/qe_scf_calculation.ipynb) | Create Quantum Espresso workflow starting from QE input file; create and submit job; after the job is finished, download output file, and finally perform postprocessing analysis.
44
+ | [Examples/Material](examples/material/) | [Get Materials by Formula](examples/material/get_materials_by_formula.ipynb) | Shows how [queries](https://docs.mat3ra.com/rest-api/query-structure/) can be made to search for materials stored on your account by their formula. In this example, we search for a system containing Si.
45
+ | [Examples/Material](examples/material/) | [Create Material](examples/material/create_material.ipynb) | Gives an overview of how materials can be generated in [JSON format](https://docs.mat3ra.com/materials/data/) and uploaded to your user account. In this example, we create an FCC Si crystal and upload it.
46
+ | [Examples/Material](examples/material/) | [Import Materials from Materials Project](examples/material/import_materials_from_materialsproject.ipynb) | Demonstrates how materials can be imported from [Materials Project](https://materialsproject.org/about), if their Materials Project ID is known. In this example, we import monoclinic and hexagonal SiGe cells.
47
+ | [Examples/Material](examples/material/) | [Import Materials from Poscar](examples/material/upload_materials_from_file_poscar.ipynb) | Provides an example of how materials can be imported directly from Poscar files (a common chemical file format best-known [for its use in VASP](https://www.vasp.at/wiki/index.php/Input)). In this example, we import the unit cell of SiGe.
48
+ | [Examples/Material](examples/material/) | [Interoperability between Mat3ra and Materials Project](examples/material/api_interoperability_showcase.ipynb) | In this notebook, we showcase a major advantage of APIs: interoperability. We begin by performing a query using the [Materials Project](https://materialsproject.org) API for all systems containing Iron and Oxygen. We then filter our results (for demonstraiton purposes, we keep only the first 10 materials found). Finally, we upload our results to the Mat3ra platform, where further calculations could be performed to characterize these materials.
49
+ | [Examples/Job](examples/job/) | [Create and Submit Job](examples/job/create_and_submit_job.ipynb) | Shows how to use the Mat3ra API to [create jobs](https://docs.mat3ra.com/jobs/data/) and run them on our cluster. In this example, we run a DFT calculation to get the total energy of an FCC Si unit cell using Quantum Espresso.
50
+ | [Examples/Job](examples/job/) | [Get File from Job](examples/job/get-file-from-job.ipynb) | Guides you through using the Mat3ra API to query for a list of files produced by a job, describes the metadata assigned to each file, and ends by demonstrating how to download any remote file generated by a job to the local disk.
51
+ | [Examples/Job](examples/job/) | [Run Simulations and Extract Properties](examples/job/run-simulations-and-extract-properties.ipynb) | Leads you through the process of copying a [bank workflow](https://docs.mat3ra.com/workflows/bank/) to your account and using it to automatically calculate the [properties](https://docs.mat3ra.com/properties/overview/) of multiple materials. In this example, we determine the [band gap](https://docs.mat3ra.com/properties-directory/non-scalar/band-gaps/) of Si and Ge.
52
+ | [Examples/Job](examples/job/) | [ML - Train Model Predict Properties](examples/job/ml-train-model-predict-properties.ipynb) | Walks you through automated dataset generation and the training/prediction of material properties using [machine learning](https://docs.mat3ra.com/software-directory/overview/#machine-learning). In this example, we calculate the band gaps of Si and SiGe, and using various materials properties as descriptors, train a model to predict their band gaps. Finally, we use this trained model to predict the band gap of Ge.
53
+
54
+
55
+
56
+ ## Setup
57
+
58
+ NOTE: tested with Python version 3.8 and 3.10, please assert that the virtual environment is created with it. Use [`pyenv`](https://github.com/pyenv/pyenv#installation) to manage Python versions.
59
+
60
+ Follow the steps below in order to setup and view the Jupyter notebooks:
61
+
62
+ 0. [Install git-lfs](https://help.github.com/articles/installing-git-large-file-storage/) [[3](#links)] in order to get access to the source code and notebook files.
63
+
64
+ 1. Clone repository:
65
+
66
+ ```bash
67
+ git clone https://github.com/Exabyte-io/api-examples.git
68
+ ```
69
+
70
+ Or, if you have set up SSH keys
71
+
72
+ ```bash
73
+ git clone git@github.com:Exabyte-io/api-examples.git
74
+ ```
75
+
76
+ In case for some reason git-lfs was not installed at the time of cloning, the files can be pulled after installing git-lfs, through `git lfs pull`.
77
+
78
+ Related to this, please be aware that as the `.ipynb` and `.poscar` files are stored on git-lfs, they are not part of the zip archive downloaded through GitHub's web interface.
79
+
80
+ 3. Install [virtualenv](https://virtualenv.pypa.io/en/stable/) using [pip](https://pip.pypa.io/en/stable/) if not already present:
81
+
82
+ ```bash
83
+ pip install virtualenv
84
+ ```
85
+
86
+ 4. Create virtual environment and install required packages:
87
+
88
+ ```bash
89
+ cd api-examples
90
+ virtualenv .env
91
+ source .env/bin/activate
92
+ pip install -e ."[localhost]"
93
+ ```
94
+
95
+ 5. Run Jupyter and open a notebook in a browser. In order for the post-save hook feature to work properly, one must launch their Jupyter Notebook environment in the folder that contains the file `config.py`, which is the `examples` folder shown below:
96
+
97
+ ```bash
98
+ cd examples
99
+ jupyter lab --config=config.py
100
+ ```
101
+
102
+ ## Usage
103
+
104
+ In order to run or edit the examples:
105
+
106
+ 1. Assert an existing Mat3ra.com account. Examples require an account to run. New users can register [here](https://platform.mat3ra.com/register) to obtain one.
107
+
108
+ 2. Open [settings](utils/settings.json) and adjust it to provide the API authentication parameters. See the [corresponding example](examples/system/get_authentication_params.ipynb) to learn how to obtain the authentication parameters. It is also possible to generate an API token by logging in to [Mat3ra platform](https://platform.mat3ra.com/), navigating to the Account Preferences, and clicking the 'Generate new token' button under API Tokens. More details can be found [here](https://docs.mat3ra.com/accounts/ui/preferences/api/).
109
+
110
+ 3. Open the desired example notebook, adjust it as necessary and run. One can speed up the notebooks execution after running the [Get Authentication Params](examples/system/get_authentication_params.ipynb) one by reusing the kernel from the first notebook.
111
+
112
+ <img src="images/reusable-kernel.png" width="250px" />
113
+
114
+ NOTE: The Materials Project API key should be obtained from [https://legacy.materialsproject.org/open](https://legacy.materialsproject.org/open).
115
+
116
+
117
+ ## Contribute
118
+
119
+ This is an open-source repository and we welcome contributions for other use cases. The original set of examples is only meant to demonstrate the capabilities and can be extended.
120
+
121
+ We suggest forking this repository and introducing the adjustments there. The changes in the fork can further be considered for merging into this repository as it is commonly used on GitHub. This process is explained in more details elsewhere online [[4](#links)].
122
+
123
+ If you would like to add new examples or adjust existing ones, please consider the following:
124
+
125
+ 1. Put examples into the corresponding directories by domain.
126
+
127
+ 2. Walk the readers through the examples by providing step-by-step explanation similar to [this](examples/material/get_materials_by_formula.ipynb) example.
128
+
129
+ 3. We use post-save hooks to automatically convert notebooks to python scripts. See [config](examples/config.py) file for more information. In order to facilitate code review, we exclude notebook sources in the `other/` directory from version control and store them in Git LFS [[3](#links)]. Please follow this convention.
130
+
131
+ 4. Apply code formatting by installing development requirements as follows:
132
+
133
+ ```bash
134
+ pip install -e ."[dev]"
135
+ pre-commit install
136
+ pre-commit run --all-files
137
+ ```
138
+
139
+ Check more details about `pre-commit` [here](https://pre-commit.com/).
140
+
141
+ ## Links
142
+
143
+ 1. Mat3ra.com RESTful API, description in the online documentation: [link](https://docs.mat3ra.com/rest-api/overview/)
144
+ 2. Jupyter.org, official website: [link](https://jupyter.org/)
145
+ 3. Git Large File Storage, official website: [link](https://git-lfs.github.com/)
146
+ 4. GitHub Standard Fork & Pull Request Workflow, online explanation: [link](https://gist.github.com/Chaser324/ce0505fbed06b947d962)
@@ -0,0 +1,114 @@
1
+ # Mat3ra API Examples
2
+
3
+ ## Contents of this Repository
4
+
5
+ Below, we list the contents of this repository, in roughly the order that a user might want to go through it in order to learn how our API works.
6
+
7
+ | Folder | Notebook | Description |
8
+ | ------------------|-----------------------------------------| ----------- |
9
+ | [Examples/System](examples/system/) | [Get Authentication Params](examples/system/get_authentication_params.ipynb) | Demonstrates how to programatically find your user ID and access token, which is to [authenticate](https://docs.mat3ra.com/rest-api/authentication/) for many portions of the Mat3ra API.
10
+ | [Examples/Workflow](examples/workflow/) | [Get Workflows](examples/workflow/get_workflows.ipynb) | Walks through how to [query](https://docs.mat3ra.com/rest-api/query-structure/) the Mat3ra API to programatically search for workflows. In this example, we search for workflows that calculate the total energy of a material.
11
+ | [Examples/Workflow](examples/workflow/) | [Quantum Espresso Workflow and Job](examples/workflow/qe_scf_calculation.ipynb) | Create Quantum Espresso workflow starting from QE input file; create and submit job; after the job is finished, download output file, and finally perform postprocessing analysis.
12
+ | [Examples/Material](examples/material/) | [Get Materials by Formula](examples/material/get_materials_by_formula.ipynb) | Shows how [queries](https://docs.mat3ra.com/rest-api/query-structure/) can be made to search for materials stored on your account by their formula. In this example, we search for a system containing Si.
13
+ | [Examples/Material](examples/material/) | [Create Material](examples/material/create_material.ipynb) | Gives an overview of how materials can be generated in [JSON format](https://docs.mat3ra.com/materials/data/) and uploaded to your user account. In this example, we create an FCC Si crystal and upload it.
14
+ | [Examples/Material](examples/material/) | [Import Materials from Materials Project](examples/material/import_materials_from_materialsproject.ipynb) | Demonstrates how materials can be imported from [Materials Project](https://materialsproject.org/about), if their Materials Project ID is known. In this example, we import monoclinic and hexagonal SiGe cells.
15
+ | [Examples/Material](examples/material/) | [Import Materials from Poscar](examples/material/upload_materials_from_file_poscar.ipynb) | Provides an example of how materials can be imported directly from Poscar files (a common chemical file format best-known [for its use in VASP](https://www.vasp.at/wiki/index.php/Input)). In this example, we import the unit cell of SiGe.
16
+ | [Examples/Material](examples/material/) | [Interoperability between Mat3ra and Materials Project](examples/material/api_interoperability_showcase.ipynb) | In this notebook, we showcase a major advantage of APIs: interoperability. We begin by performing a query using the [Materials Project](https://materialsproject.org) API for all systems containing Iron and Oxygen. We then filter our results (for demonstraiton purposes, we keep only the first 10 materials found). Finally, we upload our results to the Mat3ra platform, where further calculations could be performed to characterize these materials.
17
+ | [Examples/Job](examples/job/) | [Create and Submit Job](examples/job/create_and_submit_job.ipynb) | Shows how to use the Mat3ra API to [create jobs](https://docs.mat3ra.com/jobs/data/) and run them on our cluster. In this example, we run a DFT calculation to get the total energy of an FCC Si unit cell using Quantum Espresso.
18
+ | [Examples/Job](examples/job/) | [Get File from Job](examples/job/get-file-from-job.ipynb) | Guides you through using the Mat3ra API to query for a list of files produced by a job, describes the metadata assigned to each file, and ends by demonstrating how to download any remote file generated by a job to the local disk.
19
+ | [Examples/Job](examples/job/) | [Run Simulations and Extract Properties](examples/job/run-simulations-and-extract-properties.ipynb) | Leads you through the process of copying a [bank workflow](https://docs.mat3ra.com/workflows/bank/) to your account and using it to automatically calculate the [properties](https://docs.mat3ra.com/properties/overview/) of multiple materials. In this example, we determine the [band gap](https://docs.mat3ra.com/properties-directory/non-scalar/band-gaps/) of Si and Ge.
20
+ | [Examples/Job](examples/job/) | [ML - Train Model Predict Properties](examples/job/ml-train-model-predict-properties.ipynb) | Walks you through automated dataset generation and the training/prediction of material properties using [machine learning](https://docs.mat3ra.com/software-directory/overview/#machine-learning). In this example, we calculate the band gaps of Si and SiGe, and using various materials properties as descriptors, train a model to predict their band gaps. Finally, we use this trained model to predict the band gap of Ge.
21
+
22
+
23
+
24
+ ## Setup
25
+
26
+ NOTE: tested with Python version 3.8 and 3.10, please assert that the virtual environment is created with it. Use [`pyenv`](https://github.com/pyenv/pyenv#installation) to manage Python versions.
27
+
28
+ Follow the steps below in order to setup and view the Jupyter notebooks:
29
+
30
+ 0. [Install git-lfs](https://help.github.com/articles/installing-git-large-file-storage/) [[3](#links)] in order to get access to the source code and notebook files.
31
+
32
+ 1. Clone repository:
33
+
34
+ ```bash
35
+ git clone https://github.com/Exabyte-io/api-examples.git
36
+ ```
37
+
38
+ Or, if you have set up SSH keys
39
+
40
+ ```bash
41
+ git clone git@github.com:Exabyte-io/api-examples.git
42
+ ```
43
+
44
+ In case for some reason git-lfs was not installed at the time of cloning, the files can be pulled after installing git-lfs, through `git lfs pull`.
45
+
46
+ Related to this, please be aware that as the `.ipynb` and `.poscar` files are stored on git-lfs, they are not part of the zip archive downloaded through GitHub's web interface.
47
+
48
+ 3. Install [virtualenv](https://virtualenv.pypa.io/en/stable/) using [pip](https://pip.pypa.io/en/stable/) if not already present:
49
+
50
+ ```bash
51
+ pip install virtualenv
52
+ ```
53
+
54
+ 4. Create virtual environment and install required packages:
55
+
56
+ ```bash
57
+ cd api-examples
58
+ virtualenv .env
59
+ source .env/bin/activate
60
+ pip install -e ."[localhost]"
61
+ ```
62
+
63
+ 5. Run Jupyter and open a notebook in a browser. In order for the post-save hook feature to work properly, one must launch their Jupyter Notebook environment in the folder that contains the file `config.py`, which is the `examples` folder shown below:
64
+
65
+ ```bash
66
+ cd examples
67
+ jupyter lab --config=config.py
68
+ ```
69
+
70
+ ## Usage
71
+
72
+ In order to run or edit the examples:
73
+
74
+ 1. Assert an existing Mat3ra.com account. Examples require an account to run. New users can register [here](https://platform.mat3ra.com/register) to obtain one.
75
+
76
+ 2. Open [settings](utils/settings.json) and adjust it to provide the API authentication parameters. See the [corresponding example](examples/system/get_authentication_params.ipynb) to learn how to obtain the authentication parameters. It is also possible to generate an API token by logging in to [Mat3ra platform](https://platform.mat3ra.com/), navigating to the Account Preferences, and clicking the 'Generate new token' button under API Tokens. More details can be found [here](https://docs.mat3ra.com/accounts/ui/preferences/api/).
77
+
78
+ 3. Open the desired example notebook, adjust it as necessary and run. One can speed up the notebooks execution after running the [Get Authentication Params](examples/system/get_authentication_params.ipynb) one by reusing the kernel from the first notebook.
79
+
80
+ <img src="images/reusable-kernel.png" width="250px" />
81
+
82
+ NOTE: The Materials Project API key should be obtained from [https://legacy.materialsproject.org/open](https://legacy.materialsproject.org/open).
83
+
84
+
85
+ ## Contribute
86
+
87
+ This is an open-source repository and we welcome contributions for other use cases. The original set of examples is only meant to demonstrate the capabilities and can be extended.
88
+
89
+ We suggest forking this repository and introducing the adjustments there. The changes in the fork can further be considered for merging into this repository as it is commonly used on GitHub. This process is explained in more details elsewhere online [[4](#links)].
90
+
91
+ If you would like to add new examples or adjust existing ones, please consider the following:
92
+
93
+ 1. Put examples into the corresponding directories by domain.
94
+
95
+ 2. Walk the readers through the examples by providing step-by-step explanation similar to [this](examples/material/get_materials_by_formula.ipynb) example.
96
+
97
+ 3. We use post-save hooks to automatically convert notebooks to python scripts. See [config](examples/config.py) file for more information. In order to facilitate code review, we exclude notebook sources in the `other/` directory from version control and store them in Git LFS [[3](#links)]. Please follow this convention.
98
+
99
+ 4. Apply code formatting by installing development requirements as follows:
100
+
101
+ ```bash
102
+ pip install -e ."[dev]"
103
+ pre-commit install
104
+ pre-commit run --all-files
105
+ ```
106
+
107
+ Check more details about `pre-commit` [here](https://pre-commit.com/).
108
+
109
+ ## Links
110
+
111
+ 1. Mat3ra.com RESTful API, description in the online documentation: [link](https://docs.mat3ra.com/rest-api/overview/)
112
+ 2. Jupyter.org, official website: [link](https://jupyter.org/)
113
+ 3. Git Large File Storage, official website: [link](https://git-lfs.github.com/)
114
+ 4. GitHub Standard Fork & Pull Request Workflow, online explanation: [link](https://gist.github.com/Chaser324/ce0505fbed06b947d962)
@@ -0,0 +1,7 @@
1
+ # Assets for Notebooks
2
+
3
+ This directory contains various files for the example notebooks.
4
+
5
+ - `mp-978534.poscar` contains a SiGe structure from [https://materialsproject.org/materials/mp-978534/](https://materialsproject.org/materials/mp-978534/).
6
+ - `bash_workflow_template.json` contains the template JSON schema of Mat3ra workflow.
7
+ - `Si.pz-vbc.UPF` is the pseudo potential file of silicon used in the Quantum Espresso workflow example.
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7b4ab71aaf8e4a8b267f1349df21ef5a851d0da1d5f210bb7994ce6afb9f3e3
3
+ size 74553