From 732c42330048d6dd5a6beec169b28c9d397cf820 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:09:12 -0800 Subject: [PATCH 01/19] chore: nest py sources under mat3ra subfolder --- src/__init__.py | 0 src/py/__init__.py | 0 src/py/mat3ra/__init__.py | 0 src/py/{ => mat3ra}/standata/__init__.py | 0 src/py/{ => mat3ra}/standata/base.py | 0 src/py/{ => mat3ra}/standata/cli.py | 3 +-- 6 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 src/__init__.py create mode 100644 src/py/__init__.py create mode 100644 src/py/mat3ra/__init__.py rename src/py/{ => mat3ra}/standata/__init__.py (100%) rename src/py/{ => mat3ra}/standata/base.py (100%) rename src/py/{ => mat3ra}/standata/cli.py (96%) diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/py/__init__.py b/src/py/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/py/mat3ra/__init__.py b/src/py/mat3ra/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/py/standata/__init__.py b/src/py/mat3ra/standata/__init__.py similarity index 100% rename from src/py/standata/__init__.py rename to src/py/mat3ra/standata/__init__.py diff --git a/src/py/standata/base.py b/src/py/mat3ra/standata/base.py similarity index 100% rename from src/py/standata/base.py rename to src/py/mat3ra/standata/base.py diff --git a/src/py/standata/cli.py b/src/py/mat3ra/standata/cli.py similarity index 96% rename from src/py/standata/cli.py rename to src/py/mat3ra/standata/cli.py index 7a38647..ff404bc 100644 --- a/src/py/standata/cli.py +++ b/src/py/mat3ra/standata/cli.py @@ -2,8 +2,7 @@ from typing import Optional import typer - -from standata import Standata +from mat3ra.standata import Standata def main( From 228262a9b12df3eb68b331b053fe428a7db6368d Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:09:35 -0800 Subject: [PATCH 02/19] chore: fix tests imports --- tests/py/unit/conftest.py | 3 +-- tests/py/unit/materials/test_find_entity.py | 2 +- tests/py/unit/materials/test_init.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/py/unit/conftest.py b/tests/py/unit/conftest.py index 21a7b2d..82e9b16 100644 --- a/tests/py/unit/conftest.py +++ b/tests/py/unit/conftest.py @@ -1,8 +1,7 @@ from pathlib import Path import pytest - -from standata import Standata +from mat3ra.standata import Standata @pytest.fixture diff --git a/tests/py/unit/materials/test_find_entity.py b/tests/py/unit/materials/test_find_entity.py index bc2a9e9..8e4301b 100644 --- a/tests/py/unit/materials/test_find_entity.py +++ b/tests/py/unit/materials/test_find_entity.py @@ -1,4 +1,4 @@ -from standata import Standata +from mat3ra.standata import Standata def test_find_entity_tag(materials_standata: Standata): diff --git a/tests/py/unit/materials/test_init.py b/tests/py/unit/materials/test_init.py index 4e2d126..3a2305d 100644 --- a/tests/py/unit/materials/test_init.py +++ b/tests/py/unit/materials/test_init.py @@ -1,6 +1,6 @@ from pathlib import Path -from standata import Standata +from mat3ra.standata import Standata def test_standata_init_path(materials_config_path: Path): From 7723cbebb777ee5f90feec51672b00ea05294dc5 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:11:11 -0800 Subject: [PATCH 03/19] chore: update package name in package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8202e17..73fa91a 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "@exabyte-io/standata", + "name": "@mat3ra/standata", "version": "0.0.0", "description": "Examples of entities following the Mat3ra data standard.", - "author": "Exabyte Inc.", - "license": "ISC", + "author": "Mat3ra.com", + "license": "Apache-2.0", "main": "lib/index.js", "files": [ "/lib", From 1cbc26b4658347616b2384efa9596f4eacfa7d8b Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:11:27 -0800 Subject: [PATCH 04/19] chore: update package setup in pyproject.toml --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 43ecbc8..d81aeb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] -name = "standata" +name = "mat3ra-standata" dynamic = ["version"] -description = "Examples of entities following the Mat3ra data standard." +description = "Standard data for digital Materials R&D." readme = "README.md" requires-python = ">=3.8" license = {file = "LICENSE.md"} @@ -27,7 +27,7 @@ tests = ["pytest", "pytest-cov", "pytest-mock"] # Entrypoint scripts can be defined here, see examples below. [project.scripts] -standata-symlinks = "standata.cli:typer_app" +create-symlinks = "mat3ra.standata.cli:typer_app" [build-system] From 85d85f3acd80df3b463edbee451e7186b191a47d Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:12:22 -0800 Subject: [PATCH 05/19] feat: build python modules at the same time as JavaScript ones --- build_runtime_data.js | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/build_runtime_data.js b/build_runtime_data.js index 6db285a..6eb6681 100644 --- a/build_runtime_data.js +++ b/build_runtime_data.js @@ -9,7 +9,11 @@ const fs = require("fs"); const path = require("path"); const yaml = require("js-yaml"); -function buildAsset({ assetPath, targetPath }) { +function buildAsset({ + assetPath, + targetPath, + contentGenerator = (content) => `${JSON.stringify(content)}\n`, +}) { const fileContent = fs.readFileSync(assetPath, { encoding: "utf-8" }); const obj = {}; obj.standataConfig = yaml.load(fileContent); @@ -20,27 +24,52 @@ function buildAsset({ assetPath, targetPath }) { const content = fs.readFileSync(path.resolve(entityPath), { encoding: "utf-8" }); obj.filesMapByName[entity.filename] = JSON.parse(content); }); - - fs.writeFileSync(targetPath, JSON.stringify(obj) + "\n", "utf8"); + fs.writeFileSync(targetPath, contentGenerator(obj), "utf8"); console.log(`Written entity category map to "${assetPath}" to "${targetPath}"`); } +// JS Modules + buildAsset({ assetPath: "./materials/categories.yml", targetPath: "./src/js/runtime_data/materials.json", }); - buildAsset({ assetPath: "./properties/categories.yml", targetPath: "./src/js/runtime_data/properties.json", }); - buildAsset({ assetPath: "./applications/categories.yml", targetPath: "./src/js/runtime_data/applications.json", }); - buildAsset({ assetPath: "./workflows/categories.yml", targetPath: "./src/js/runtime_data/workflows.json", }); + +// Py Modules + +buildAsset({ + assetPath: "./materials/categories.yml", + targetPath: "./src/py/mat3ra/standata/materials.py", + contentGenerator: (content) => + `import json\nmaterials_data = json.loads(r'''${JSON.stringify(content)}''')`, +}); +buildAsset({ + assetPath: "./properties/categories.yml", + targetPath: "./src/py/mat3ra/standata/properties.py", + contentGenerator: (content) => + `import json\nproperties_data = json.loads(r'''${JSON.stringify(content)}''')`, +}); +buildAsset({ + assetPath: "./applications/categories.yml", + targetPath: "./src/py/mat3ra/standata/applications.py", + contentGenerator: (content) => + `import json\napplications_data = json.loads(r'''${JSON.stringify(content)}''')`, +}); +buildAsset({ + assetPath: "./workflows/categories.yml", + targetPath: "./src/py/mat3ra/standata/workflows.py", + contentGenerator: (content) => + `import json\nworkflows_data = json.loads(r'''${JSON.stringify(content)}''')`, +}); From 5e20b6901c202ea7c6b82c0d06197b2fe701cc8d Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:12:37 -0800 Subject: [PATCH 06/19] chore: update README --- README.md | 77 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 3967ed0..5493932 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,57 @@ # Standata +Standard data for digital materials R&D entities in the [ESSE](https://github.com/Exabyte-io/esse) data format. -Examples of entity data structures in the [ESSE](https://github.com/Exabyte-io/esse) data format (Essential Source -of Schemas and Examples). -## Installation +## 1. Installation -### Python - -The `standata` package is compatible with Python 3.8+. It can be installed as a Python package either via PyPI -or as an editable local installation as below. +### 1.1. Python +The package is compatible with Python 3.8+. It can be installed as a Python package either via PyPI: ```shell -pip install standata +pip install mat3ra-standata ``` -Editable local installation in a virtual environment: +Or as an editable local installation in a virtual environment after cloning the repository: ```shell virtualenv .venv source .venv/bin/activate pip install -e PATH_TO_STANDATA_REPOSITORY ``` -### Node +### 1.2. JavaScript Standata can be installed as a Node.js package via NPM (node package manager). ```shell -npm install @exabyte-io/standata +npm install @mat3ra/standata ``` -#### Runtime Data + +## 2. Usage + +### 2.1. Python + +```python +from mat3ra.standata.materials import materials_data +# This returns a list of JSON configs for all materials. +materialConfigs = materials_data["filesMapByName"].values(); +``` + + +### 2.2. JavaScript + +```javascript +// Direct import can be used to avoid importing all data at once. +import data from "@mat3ra/standata/lib/runtime_data/materials"; +// This creates a list of JSON configs for all materials. +const materialConfigs = Object.values(data.filesMapByName); +``` + + +## 3. Conventions + +#### 3.1. Runtime Modules To avoid file system calls on the client, the entity categories and data structures are made available at runtime via the files in `src/js/runtime_data`. These files are generated automatically using the following command: @@ -38,26 +59,26 @@ the files in `src/js/runtime_data`. These files are generated automatically usin npm run build:runtime-data ``` -## CLI Script +## 3.2. CLI Scripts for Creating Symlinks + +### 3.2.1. Python -### Python -The Python package adds a command line script `standata-symlinks` that creates a category-based file tree where +The Python package adds a command line script `create-symlinks` that creates a category-based file tree where entity data files are symbolically linked in directories named after the categories associated with the entity. The resulting file tree will be contained in a directory names `by_category`. The script expects the (relative or absolute) path to an entity config file (`categories.yml`). The destination of the file tree can be modified by passing the `--destination`/`-d` option. ```shell # consult help page to view all options -standata-symlinks --help - +create-symlinks --help # creates symbolic links in materials/by_category -standata-symlinks materials/categories.yml - +create-symlinks materials/categories.yml # creates symbolic links for materials in tmp/by_category -standata-symlinks materials/categories.yml +create-symlinks materials/categories.yml -d tmp ``` -### Node +### 3.2.1 JavaScript/Node + Analogous to the command line script in Python, the repository also features a script in TypeScript (`src/js/cli.ts`) and (after transpiling) in JavaScript (`lib/cli.js`). The script takes the entity config file as a mandatory positional argument and the @@ -65,14 +86,20 @@ alternative location for the directory containing the symbolic links (`--destina ```shell # creates symbolic links in materials/by_category (node) node lib/cli.js materials/categories.yml - # creates symbolic links in materials/by_category (ts-node) ts-node src/js/cli.ts materials/categories.yml - # creates symbolic links for materials in tmp/by_category ts-node src/js/cli.ts -d tmp materials/categories.yml - # run via npm npm run build:categories -- materials/categories.yml - ``` + + +## 4. Development + +See [ESSE](https://github.com/Exabyte-io/esse) for the notes about development and testing. + + +## 5. Links + +To be added here. From 4dd1ac1c74dbf84eb54207e3012e6d657985a58f Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:23:13 -0800 Subject: [PATCH 07/19] chore: ignore linting for the Py autogenerated assets --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index d81aeb2..38cd2f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,10 @@ extend-exclude = ''' # Exclude a variety of commonly ignored directories. extend-exclude = [ "src/js", + "src/py/mat3ra/standata/materials.py", + "src/py/mat3ra/standata/workflows.py", + "src/py/mat3ra/standata/applications.py", + "src/py/mat3ra/standata/properties.py", "tests/js", ] line-length = 120 From 689232c3f18f3715fff956cd14deb5af7ec99be3 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:23:40 -0800 Subject: [PATCH 08/19] chore: update cicd.yml GH workflow file --- .github/workflows/cicd.yml | 107 ++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index ba6e12d..f56dad1 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -48,7 +48,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.8.6] + python-version: [3.8.6, 3.9.x] steps: - name: Checkout this repository @@ -73,7 +73,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 20.x] steps: - name: Checkout this repository @@ -99,55 +99,54 @@ jobs: with: node-version: ${{ matrix.node-version }} -# publish-js-package: -# needs: [run-js-tests] -# runs-on: ubuntu-latest -# yamllint disable-line rule:line-length -# if: (github.repository != 'Exabyte-io/template-definitions-js-py') && (github.ref_name == 'main') -# -# steps: -# - name: Checkout this repository -# uses: actions/checkout@v3 -# -# - name: Checkout actions repository -# uses: actions/checkout@v3 -# with: -# repository: Exabyte-io/actions -# token: ${{ secrets.BOT_GITHUB_TOKEN }} -# path: actions -# -# - name: Publish JS release -# uses: ./actions/js/publish -# with: -# node-version: 14.19.x -# npm-token: ${{ secrets.NPM_TOKEN }} -# github-token: ${{ secrets.BOT_GITHUB_TOKEN }} -# - publish-py-package: - needs: publish-js-package - runs-on: ubuntu-latest -# yamllint disable-line rule:line-length - if: (github.repository != 'Exabyte-io/template-definitions-js-py') && (github.ref_name == 'main') - publish-to-pypi: 'false' - - steps: - - name: Checkout this repository - uses: actions/checkout@v3 - with: - lfs: true - - - name: Checkout actions repository - uses: actions/checkout@v3 - with: - repository: Exabyte-io/actions - token: ${{ secrets.BOT_GITHUB_TOKEN }} - path: actions - - - name: Publish python release - uses: ./actions/py/publish - with: - python-version: 3.x - github-token: ${{ secrets.BOT_GITHUB_TOKEN }} - # pypi-username: ${{ secrets.PYPI_USERNAME }} - # pypi-password: ${{ secrets.PYPI_PASSWORD }} - publish-tag: 'true' + publish-js-package: + needs: [run-js-tests] + runs-on: ubuntu-latest + # yamllint disable-line rule:line-length + if: (github.repository != 'Exabyte-io/template-definitions-js-py') && (github.ref_name == 'main') + + steps: + - name: Checkout this repository + uses: actions/checkout@v3 + + - name: Checkout actions repository + uses: actions/checkout@v3 + with: + repository: Exabyte-io/actions + token: ${{ secrets.BOT_GITHUB_TOKEN }} + path: actions + + - name: Publish JS release + uses: ./actions/js/publish + with: + node-version: 14.19.x + npm-token: ${{ secrets.NPM_TOKEN }} + github-token: ${{ secrets.BOT_GITHUB_TOKEN }} + publish-tag: 'true' + + publish-py-package: + needs: [publish-js-package] + runs-on: ubuntu-latest + # yamllint disable-line rule:line-length + if: (github.repository != 'Exabyte-io/template-definitions-js-py') && (github.ref_name == 'main') + steps: + - name: Checkout this repository + uses: actions/checkout@v3 + with: + lfs: true + + - name: Checkout actions repository + uses: actions/checkout@v3 + with: + repository: Exabyte-io/actions + token: ${{ secrets.BOT_GITHUB_TOKEN }} + path: actions + + - name: Publish python release + uses: ./actions/py/publish + with: + python-version: 3.x + github-token: ${{ secrets.BOT_GITHUB_TOKEN }} + pypi-username: ${{ secrets.PYPI_USERNAME }} + pypi-password: ${{ secrets.PYPI_PASSWORD }} + publish-tag: 'false' From 08d9bc7c464c3ad0147dcc81498cee1c8aa8afa7 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:25:14 -0800 Subject: [PATCH 09/19] chore: add test --- tests/py/unit/materials/test_materials_data.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/py/unit/materials/test_materials_data.py diff --git a/tests/py/unit/materials/test_materials_data.py b/tests/py/unit/materials/test_materials_data.py new file mode 100644 index 0000000..8aabff2 --- /dev/null +++ b/tests/py/unit/materials/test_materials_data.py @@ -0,0 +1,9 @@ +from mat3ra.standata.materials import materials_data + + +def test_find_entity_tag(): + """Assert correct information if found about a material.""" + material = materials_data["filesMapByName"]["Graphene.json"] + assert type(material) == dict + assert material["name"] == "Graphene (mp-1040425)" + assert material["isNonPeriodic"] is False From 13137c854773c39ea0f7a6c83a450328d362d694 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:28:35 -0800 Subject: [PATCH 10/19] chore: ignore autogenerated files for black tool --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 38cd2f6..e1afdc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ target-version = ['py38'] # 'extend-exclude' excludes files or directories in addition to the defaults extend-exclude = ''' ( - examples\/.*\/.*\.py + src/py/mat3ra/standata/(materials|applications|properties|workflows).py | other\/.*\/.*\.(py|ipynb) ) ''' From 5222a37697eeda373637872a86ec2c75c94aaf46 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:30:08 -0800 Subject: [PATCH 11/19] chore: update exclusion pattern --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e1afdc6..eca4d5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,10 @@ target-version = ['py38'] # 'extend-exclude' excludes files or directories in addition to the defaults extend-exclude = ''' ( - src/py/mat3ra/standata/(materials|applications|properties|workflows).py + src/py/mat3ra/standata/materials.py + | src/py/mat3ra/standata/workflows.py + | src/py/mat3ra/standata/applications.py + | src/py/mat3ra/standata/properties.py | other\/.*\/.*\.(py|ipynb) ) ''' From 37c03f79d0c0701864bff8b79b779fb6d15f235a Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:54:24 -0800 Subject: [PATCH 12/19] chore: tmp disable pre-commit hooks --- .pre-commit-config.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5992512..b7536b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,8 +2,10 @@ repos: - repo: https://github.com/Exabyte-io/pre-commit-hooks rev: 2023.8.18 hooks: - - id: ruff - - id: black +# TB temporary disable to avoid firing for autogenerated files +# TODO: figure out how to ignore the files properly and re-enable +# - id: ruff +# - id: black - id: isort - id: mypy - id: check-yaml From b59bd489e44b932fea97f78442fab0d56e10ed31 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:56:00 -0800 Subject: [PATCH 13/19] chore: update pyproject.toml --- pyproject.toml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index eca4d5f..c6be38b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,11 +49,10 @@ target-version = ['py38'] # 'extend-exclude' excludes files or directories in addition to the defaults extend-exclude = ''' ( - src/py/mat3ra/standata/materials.py - | src/py/mat3ra/standata/workflows.py - | src/py/mat3ra/standata/applications.py - | src/py/mat3ra/standata/properties.py - | other\/.*\/.*\.(py|ipynb) + src\/py\/mat3ra\/standata\/materials.py + | src\/py\/mat3ra\/standata\/workflows.py + | src\/py\/mat3ra\/standata\/applications.py + | src\/py\/mat3ra\/standata\/properties.py ) ''' From c5f14302afd786157e68621ca2f94cb628ed1707 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:57:40 -0800 Subject: [PATCH 14/19] chore: update autogen py files newline --- build_runtime_data.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_runtime_data.js b/build_runtime_data.js index 6eb6681..25bb721 100644 --- a/build_runtime_data.js +++ b/build_runtime_data.js @@ -53,23 +53,23 @@ buildAsset({ assetPath: "./materials/categories.yml", targetPath: "./src/py/mat3ra/standata/materials.py", contentGenerator: (content) => - `import json\nmaterials_data = json.loads(r'''${JSON.stringify(content)}''')`, + `import json\n\nmaterials_data = json.loads(r'''${JSON.stringify(content)}''')`, }); buildAsset({ assetPath: "./properties/categories.yml", targetPath: "./src/py/mat3ra/standata/properties.py", contentGenerator: (content) => - `import json\nproperties_data = json.loads(r'''${JSON.stringify(content)}''')`, + `import json\n\nproperties_data = json.loads(r'''${JSON.stringify(content)}''')`, }); buildAsset({ assetPath: "./applications/categories.yml", targetPath: "./src/py/mat3ra/standata/applications.py", contentGenerator: (content) => - `import json\napplications_data = json.loads(r'''${JSON.stringify(content)}''')`, + `import json\n\napplications_data = json.loads(r'''${JSON.stringify(content)}''')`, }); buildAsset({ assetPath: "./workflows/categories.yml", targetPath: "./src/py/mat3ra/standata/workflows.py", contentGenerator: (content) => - `import json\nworkflows_data = json.loads(r'''${JSON.stringify(content)}''')`, + `import json\n\nworkflows_data = json.loads(r'''${JSON.stringify(content)}''')`, }); From d47aae919a22cc39e8f645eaa3febebd6c98d652 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:58:57 -0800 Subject: [PATCH 15/19] chore: update build_runtime_data.js --- build_runtime_data.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_runtime_data.js b/build_runtime_data.js index 25bb721..1b9d460 100644 --- a/build_runtime_data.js +++ b/build_runtime_data.js @@ -53,23 +53,23 @@ buildAsset({ assetPath: "./materials/categories.yml", targetPath: "./src/py/mat3ra/standata/materials.py", contentGenerator: (content) => - `import json\n\nmaterials_data = json.loads(r'''${JSON.stringify(content)}''')`, + `import json\n\nmaterials_data = json.loads(r'''${JSON.stringify(content)}''')\n`, }); buildAsset({ assetPath: "./properties/categories.yml", targetPath: "./src/py/mat3ra/standata/properties.py", contentGenerator: (content) => - `import json\n\nproperties_data = json.loads(r'''${JSON.stringify(content)}''')`, + `import json\n\nproperties_data = json.loads(r'''${JSON.stringify(content)}''')\n`, }); buildAsset({ assetPath: "./applications/categories.yml", targetPath: "./src/py/mat3ra/standata/applications.py", contentGenerator: (content) => - `import json\n\napplications_data = json.loads(r'''${JSON.stringify(content)}''')`, + `import json\n\napplications_data = json.loads(r'''${JSON.stringify(content)}''')\n`, }); buildAsset({ assetPath: "./workflows/categories.yml", targetPath: "./src/py/mat3ra/standata/workflows.py", contentGenerator: (content) => - `import json\n\nworkflows_data = json.loads(r'''${JSON.stringify(content)}''')`, + `import json\n\nworkflows_data = json.loads(r'''${JSON.stringify(content)}''')\n`, }); From 31f38c7fcd82e55390eaf967396ee17b36788865 Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 03:59:20 -0800 Subject: [PATCH 16/19] important: add Py modules for applications, materials, properties, workflows --- src/py/mat3ra/standata/applications.py | 3 +++ src/py/mat3ra/standata/materials.py | 3 +++ src/py/mat3ra/standata/properties.py | 3 +++ src/py/mat3ra/standata/workflows.py | 3 +++ 4 files changed, 12 insertions(+) create mode 100644 src/py/mat3ra/standata/applications.py create mode 100644 src/py/mat3ra/standata/materials.py create mode 100644 src/py/mat3ra/standata/properties.py create mode 100644 src/py/mat3ra/standata/workflows.py diff --git a/src/py/mat3ra/standata/applications.py b/src/py/mat3ra/standata/applications.py new file mode 100644 index 0000000..f82dc2a --- /dev/null +++ b/src/py/mat3ra/standata/applications.py @@ -0,0 +1,3 @@ +import json + +applications_data = json.loads(r'''{"standataConfig":{"categories":{"model":["atomistic","macroscopic","mesoscopic","quantum-mechanical","statistical"],"language_type":["scripting","compiled"],"purpose":["command_line_interface","interactive_computing_environment","programming_language"]},"entities":[{"filename":"espresso_gnu_540.json","categories":["quantum-mechanical"]},{"filename":"python_386.json","categories":["scripting","programming_language"]}]},"filesMapByName":{"espresso_gnu_540.json":{"name":"espresso","shortName":"qe","summary":"Quantum Espresso","version":"5.4.0","build":"GNU","hasAdvancedComputeOptions":true,"isLicensed":false},"python_386.json":{"name":"python","shortName":"py","summary":"Python Script","version":"3.8.6","build":"Default","hasAdvancedComputeOptions":false,"isLicensed":false}}}''') diff --git a/src/py/mat3ra/standata/materials.py b/src/py/mat3ra/standata/materials.py new file mode 100644 index 0000000..abde6ba --- /dev/null +++ b/src/py/mat3ra/standata/materials.py @@ -0,0 +1,3 @@ +import json + +materials_data = json.loads(r'''{"standataConfig":{"categories":{"type":["semiconductor","solar energy material","storage medium","organic electronics","battery/energy storage","composite","polymer","metals & alloys","solvent","catalysis","consumer packaged goods","glass","ceramic"],"form_factor":["bulk","surface","interface"],"dimensionality":["0D","1D","2D","3D","4D"],"electrical_conductivity":["metal","semi-metal","semiconductor","insulator"],"magnetism":["ferromagnetic","anti-ferromagnetic","paramagnetic","diamagnetic","non-magnetic"],"superconductivity":["type I","type II"],"composition":["oxide","nitride","carbide"]},"entities":[{"filename":"Graphene.json","categories":["2D","surface","semi-metal","non-magnetic"]},{"filename":"h-BN.json","categories":["2D","surface","insulator","non-magnetic"]},{"filename":"Na4Cl4.json","categories":["3D","bulk","insulator","non-magnetic"]},{"filename":"Si.json","categories":["3D","bulk","semiconductor"]},{"filename":"WS2.json","categories":["2D","surface","semiconductor","non-magnetic"]},{"filename":"Ni.json","categories":["3D","bulk","metal","ferromagnetic"]}]},"filesMapByName":{"Graphene.json":{"lattice":{"a":2.467291,"b":2.467291,"c":20,"alpha":90,"beta":90,"gamma":120,"units":{"length":"angstrom","angle":"degree"},"type":"HEX","vectors":{"a":[2.467291,0,0],"b":[-1.233645,2.136737,0],"c":[0,0,20],"alat":1,"units":"angstrom"}},"basis":{"elements":[{"id":0,"value":"C"},{"id":1,"value":"C"}],"coordinates":[{"id":0,"value":[0,0,0]},{"id":1,"value":[0.333333,0.666667,0]}],"units":"crystal","cell":[[2.467291,0,0],[-1.2336454999999995,2.136736684528712,0],[0,0,20]],"constraints":[]},"name":"Graphene (mp-1040425)","isNonPeriodic":false,"external":{"id":"mp-1040425","source":"materials project","doi":"10.17188/1405723","url":"https://next-gen.materialsproject.org/materials/mp-1040425/","origin":true}},"h-BN.json":{"lattice":{"a":2.50899515,"b":2.50899515,"c":7.71,"alpha":90,"beta":90,"gamma":120,"units":{"length":"angstrom","angle":"degree"},"type":"HEX","vectors":{"a":[2.467291,0,0],"b":[-1.233645,2.136737,0],"c":[0,0,7.71],"alat":1,"units":"angstrom"}},"basis":{"elements":[{"id":0,"value":"B"},{"id":1,"value":"N"}],"coordinates":[{"id":0,"value":[0,0,0]},{"id":1,"value":[0.333333,0.666667,0]}],"units":"crystal","cell":[[2.467291,0,0],[-1.2336454999999995,2.136736684528712,0],[0,0,7.71]],"constraints":[]},"name":"h-BN (mp-984)","isNonPeriodic":false,"external":{"id":"mp-984","source":"materials project","doi":"10.17188/1281942","url":"https://next-gen.materialsproject.org/materials/mp-984/","origin":true}},"Na4Cl4.json":{"basis":{"elements":[{"id":0,"value":"Na"},{"id":1,"value":"Na"},{"id":2,"value":"Na"},{"id":3,"value":"Na"},{"id":4,"value":"Cl"},{"id":5,"value":"Cl"},{"id":6,"value":"Cl"},{"id":7,"value":"Cl"}],"coordinates":[{"id":0,"value":[0,0,0]},{"id":1,"value":[0,0.5,0.5]},{"id":2,"value":[0.5,0,0.5]},{"id":3,"value":[0.5,0.5,0]},{"id":4,"value":[0,0,0.5]},{"id":5,"value":[0,0.5,0]},{"id":6,"value":[0.5,0,0]},{"id":7,"value":[0.5,0.5,0.5]}],"units":"crystal","cell":[[1,0,0],[0,1,0],[0,0,1]]},"lattice":{"a":5.58813,"b":5.58813,"c":5.58813,"alpha":90,"beta":90,"gamma":90,"units":{"length":"angstrom","angle":"degree"},"type":"CUB","vectors":{"a":[5.58813,0,0],"b":[0,5.58813,0],"c":[0,0,5.58813],"alat":1,"units":"angstrom"}},"name":"Na4Cl4 (mp-22862)","isNonPeriodic":false,"external":{"id":"mp-22862","source":"materials project","doi":"10.17188/1199028","url":"https://next-gen.materialsproject.org/materials/mp-22862/","origin":true}},"Si.json":{"basis":{"elements":[{"id":0,"value":"Si"},{"id":1,"value":"Si"}],"coordinates":[{"id":0,"value":[0,0,0]},{"id":1,"value":[0.25,0.25,0.25]}]},"lattice":{"a":3.867,"b":3.867,"c":3.867,"alpha":60,"beta":60,"gamma":60,"type":"TRI","units":{"length":"angstrom","angle":"degree"}},"name":"Si (mp-149)","isNonPeriodic":false,"external":{"id":"mp-149","source":"materials project","doi":"10.17188/1190959","url":"https://next-gen.materialsproject.org/materials/mp-149/","origin":true}},"WS2.json":{"lattice":{"a":3.184222,"b":3.184222,"c":12.97828,"alpha":90,"beta":90,"gamma":120,"units":{"length":"angstrom","angle":"degree"},"type":"HEX","vectors":{"a":[1.5921114461115318,-2.7576179159771317,0],"b":[1.5921114461115318,2.7576179159771317,0],"c":[0,0,12.97828236],"alat":1,"units":"angstrom"}},"basis":{"elements":[{"id":0,"value":"W"},{"id":1,"value":"S"},{"id":2,"value":"S"}],"coordinates":[{"id":0,"value":[0.333333,0.666667,0.120195]},{"id":1,"value":[0,0,0]},{"id":2,"value":[0,0,0.24039]}],"units":"crystal","cell":[[1.5921114461115318,-2.7576179159771317,0],[1.5921114461115318,2.7576179159771317,0],[0,0,12.97828236]],"constraints":[]},"name":"WS2 (mp-224)","isNonPeriodic":false,"external":{"id":"mp-224","source":"materials project","doi":"10.17188/1197614","url":"https://next-gen.materialsproject.org/materials/mp-224/","origin":true}},"Ni.json":{"name":"Ni (mp-23)","basis":{"elements":[{"id":0,"value":"Ni"}],"coordinates":[{"id":0,"value":[0,0,0]}],"units":"crystal","cell":[[2.1304222786341884,0,1.2300003718288512],[0.7101406879862482,2.008581639681698,1.2300000000000002],[0,0,2.46]],"constraints":[{"id":0,"value":[true,true,true]}]},"lattice":{"a":2.46,"b":2.46,"c":2.46,"alpha":60,"beta":60,"gamma":60,"units":{"length":"angstrom","angle":"degree"},"type":"FCC","vectors":{"a":[2.130422,0,1.23],"b":[0.7101407,2.008582,1.23],"c":[0,0,2.46],"alat":1,"units":"angstrom"}},"isNonPeriodic":false,"external":{"id":"mp-224","source":"materials project","doi":"10.17188/1199153","url":"https://next-gen.materialsproject.org/materials/mp-23/","origin":true}}}}''') diff --git a/src/py/mat3ra/standata/properties.py b/src/py/mat3ra/standata/properties.py new file mode 100644 index 0000000..f7bb537 --- /dev/null +++ b/src/py/mat3ra/standata/properties.py @@ -0,0 +1,3 @@ +import json + +properties_data = json.loads(r'''{"standataConfig":{"categories":{"type":["mechanical","electronic","magnetic","thermal","optical","dynamic","transport","radiological","acoustic","manufacturing","chemical","structural","surface"],"property_class":["meta-property","proto-property"],"value_type":["scalar","vector","matrix","tensor_rank3","tensor_rank4","non-scalar"],"measurement":["angle-resolved-photoemission-spectroscopy","atomic-force-microscopy","x-ray-diffraction","x-ray-fluorescence","transmission-electron-microscopy","scanning-electron-microscopy","thermogravimetric-analysis"],"application":["espresso","vasp","python","shell"]},"entities":[{"filename":"valence_band_offset.json","categories":["scalar","electronic","angle-resolved-photoemission-spectroscopy"]},{"filename":"band_structure.json","categories":["matrix","electronic"]}]},"filesMapByName":{"valence_band_offset.json":{"name":"valence_band_offset","units":"eV","value":0.28},"band_structure.json":{"name":"band_structure","spin":[0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5],"xAxis":{"label":"kpoints","units":"crystal"},"xDataArray":[[0,0,0],[0.28867514,0.20412412,-0.49999997],[0,-0.61237246,0],[0.28867514,-0.40824834,-0.49999997],[-0.57735028,0.20412421,0],[-0.57735028,-0.40824824,0]],"yAxis":{"label":"energy","units":"eV"},"yDataSeries":[[-5.5990059,-3.30219959,-3.30220019,-1.51073812,-3.30221054,-1.51074222],[6.26931638,-0.66503974,-0.6650363,-1.51072293,-0.66501391,-1.5107195],[6.26931998,5.06084876,5.06084821,3.41069883,5.06085301,3.41069761],[6.26934533,5.0608702,5.06086954,3.41070722,5.06085524,3.41071003],[8.71135349,7.69496909,7.69496137,6.91957625,7.69495606,6.91957636],[8.71135587,9.49274379,9.49273868,6.91958498,9.49273487,6.91958424],[8.71135838,9.49275618,9.49275401,16.14829919,9.49273798,16.14830113],[9.41550185,13.89571002,13.89571914,16.1483028,13.89571883,16.14830247]]}}}''') diff --git a/src/py/mat3ra/standata/workflows.py b/src/py/mat3ra/standata/workflows.py new file mode 100644 index 0000000..0510bcb --- /dev/null +++ b/src/py/mat3ra/standata/workflows.py @@ -0,0 +1,3 @@ +import json + +workflows_data = json.loads(r'''{"standataConfig":{"categories":{"application":["espresso","exabyteml","jupyterLab","nwchem","python","shell","vasp"],"property":["band_gap","band_gap_dos","band_structure","phonon_dispersions","reaction_energy_profile","total_energy"],"material_count":["single-material","multi-material"]},"entities":[{"filename":"total_energy.json","categories":["espresso","single-material","total_energy"]},{"filename":"band_gap.json","categories":["espresso","vasp","band_gap"]}]},"filesMapByName":{"total_energy.json":{"_id":"000000000000000000000000","name":"Total Energy","subworkflows":[{"_id":"000000000000000000000000","name":"Total Energy","application":{"_id":"00000000000000000","name":"espresso","version":"5.4.0","build":"Default","isDefault":true,"summary":"Quantum Espresso","updatedAt":"2023-08-17T23:02:20.494Z","shortName":"qe","hasAdvancedComputeOptions":true,"updatedBy":"0"},"properties":["atomic_forces","fermi_energy","pressure","stress_tensor","total_energy","total_energy_contributions","total_force"],"model":{"type":"dft","subtype":"gga","method":{"type":"pseudopotential","subtype":"us","data":{}},"functional":{"slug":"pbe"}},"units":[{"type":"execution","name":"pw_scf","head":true,"results":[{"name":"atomic_forces"},{"name":"fermi_energy"},{"name":"pressure"},{"name":"stress_tensor"},{"name":"total_energy"},{"name":"total_energy_contributions"},{"name":"total_force"}],"monitors":[{"name":"standard_output"},{"name":"convergence_electronic"}],"flowchartId":"9c216f92-2917-47e5-8f09-8513ada8330a","preProcessors":[],"postProcessors":[],"application":{"_id":"00000000000000000","name":"espresso","version":"5.4.0","build":"Default","isDefault":true,"summary":"Quantum Espresso","updatedAt":"2023-08-17T23:02:20.494Z","shortName":"qe","hasAdvancedComputeOptions":true,"updatedBy":"0"},"executable":{"isDefault":true,"hasAdvancedComputeOptions":true,"postProcessors":["remove_non_zero_weight_kpoints"],"monitors":["standard_output","convergence_ionic","convergence_electronic"],"results":["atomic_forces","band_gaps","charge_density_profile","density_of_states","fermi_energy","final_structure","magnetic_moments","potential_profile","pressure","reaction_energy_barrier","reaction_energy_profile","stress_tensor","total_energy","total_energy_contributions","total_force"],"name":"pw.x"},"flavor":{"isDefault":true,"input":[{"name":"pw_scf.in"}],"results":["atomic_forces","fermi_energy","pressure","stress_tensor","total_energy","total_energy_contributions","total_force"],"monitors":["standard_output","convergence_electronic"],"applicationName":"espresso","executableName":"pw.x","name":"pw_scf","executable":{"isDefault":true,"hasAdvancedComputeOptions":true,"postProcessors":["remove_non_zero_weight_kpoints"],"monitors":["standard_output","convergence_ionic","convergence_electronic"],"results":["atomic_forces","band_gaps","charge_density_profile","density_of_states","fermi_energy","final_structure","magnetic_moments","potential_profile","pressure","reaction_energy_barrier","reaction_energy_profile","stress_tensor","total_energy","total_energy_contributions","total_force"],"name":"pw.x"}},"status":"idle","statusTrack":[],"input":[{"content":"{% if subworkflowContext.MATERIAL_INDEX %}\n{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}\n{% endif -%}\n&CONTROL\n calculation = 'scf'\n title = ''\n verbosity = 'low'\n restart_mode = '{{ input.RESTART_MODE }}'\n wf_collect = .true.\n tstress = .true.\n tprnfor = .true.\n outdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}\n wfcdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}\n prefix = '__prefix__'\n pseudo_dir = {% raw %}'{{ JOB_WORK_DIR }}/pseudo'{% endraw %}\n/\n&SYSTEM\n ibrav = {{ input.IBRAV }}\n nat = {{ input.NAT }}\n ntyp = {{ input.NTYP }}\n ecutwfc = {{ cutoffs.wavefunction }}\n ecutrho = {{ cutoffs.density }}\n occupations = 'smearing'\n degauss = 0.005\n/\n&ELECTRONS\n diagonalization = 'david'\n diago_david_ndim = 4\n diago_full_acc = .true.\n mixing_beta = 0.3\n startingwfc = 'atomic+random'\n/\n&IONS\n/\n&CELL\n/\nATOMIC_SPECIES\n{{ input.ATOMIC_SPECIES }}\nATOMIC_POSITIONS crystal\n{{ input.ATOMIC_POSITIONS }}\nCELL_PARAMETERS angstrom\n{{ input.CELL_PARAMETERS }}\nK_POINTS automatic\n{% for d in kgrid.dimensions %}{{d}} {% endfor %}{% for s in kgrid.shifts %}{{s}} {% endfor %}","name":"pw_scf.in","contextProviders":[{"name":"KGridFormDataManager"},{"name":"QEPWXInputDataManager"},{"name":"PlanewaveCutoffDataManager"}],"applicationName":"espresso","executableName":"pw.x","updatedAt":"2023-08-17T23:02:17.337Z","updatedBy":"0","rendered":"&CONTROL\n calculation = 'scf'\n title = ''\n verbosity = 'low'\n restart_mode = 'from_scratch'\n wf_collect = .true.\n tstress = .true.\n tprnfor = .true.\n outdir = '{{ JOB_WORK_DIR }}/outdir'\n wfcdir = '{{ JOB_WORK_DIR }}/outdir'\n prefix = '__prefix__'\n pseudo_dir = '{{ JOB_WORK_DIR }}/pseudo'\n/\n&SYSTEM\n ibrav = 0\n nat = 2\n ntyp = 1\n ecutwfc = 40\n ecutrho = 200\n occupations = 'smearing'\n degauss = 0.005\n/\n&ELECTRONS\n diagonalization = 'david'\n diago_david_ndim = 4\n diago_full_acc = .true.\n mixing_beta = 0.3\n startingwfc = 'atomic+random'\n/\n&IONS\n/\n&CELL\n/\nATOMIC_SPECIES\nSi 28.0855 \nATOMIC_POSITIONS crystal\nSi 0.000000000 0.000000000 0.000000000 \nSi 0.250000000 0.250000000 0.250000000 \nCELL_PARAMETERS angstrom\n3.348920236 0.000000000 1.933500000\n1.116306745 3.157392278 1.933500000\n0.000000000 0.000000000 3.867000000\nK_POINTS automatic\n2 2 2 0 0 0 "}]}],"compute":null,"isDraft":false}],"units":[{"name":"Total Energy","type":"subworkflow","_id":"000000000000000000000000","flowchartId":"e9109d498900aad592ba68b5","status":"idle","statusTrack":[],"results":[],"monitors":[],"preProcessors":[],"postProcessors":[],"head":true,"schemaVersion":"2022.8.16","isDefault":false}],"properties":["atomic_forces","fermi_energy","pressure","stress_tensor","total_energy","total_energy_contributions","total_force"],"isDefault":true,"hash":"b5ed1cf151e828dfec234c5bf1be5b02","isOutdated":false,"createdAt":"2017-11-04T06:32:04.926Z","updatedAt":"2023-08-17T23:05:45.202Z","workflows":[],"schemaVersion":"2022.8.16","tags":[],"owner":{"_id":"00000000000000000","slug":"user-000000","cls":"Account"},"creator":{"_id":"00000000000000000","slug":"exadmin","cls":"User"},"compute":null,"exabyteId":"00000000000000000","isEntitySet":false},"band_gap.json":{"_id":"00000000000000000","name":"Band Gap","subworkflows":[{"_id":"000000000000000000000000","name":"Band Gap","application":{"_id":"00000000000000000","name":"vasp","version":"5.3.5","build":"Default","isDefault":true,"summary":"Vienna Ab-initio Simulation Package","updatedAt":"2023-08-17T23:02:32.576Z","shortName":"vasp","isLicensed":true,"updatedBy":"0"},"properties":["total_energy","total_energy_contributions","pressure","fermi_energy","atomic_forces","total_force","stress_tensor","band_gaps","fermi_energy"],"model":{"type":"dft","subtype":"gga","method":{"type":"pseudopotential","subtype":"us","data":{}},"functional":{"slug":"pbe"}},"units":[{"type":"execution","name":"vasp","head":true,"results":[{"name":"total_energy"},{"name":"total_energy_contributions"},{"name":"pressure"},{"name":"fermi_energy"},{"name":"atomic_forces"},{"name":"total_force"},{"name":"stress_tensor"}],"monitors":[{"name":"standard_output"},{"name":"convergence_electronic"}],"flowchartId":"0d35c419-ba29-44e7-94f0-690ff1f7976b","preProcessors":[],"postProcessors":[],"application":{"_id":"00000000000000000","name":"vasp","version":"5.3.5","build":"Default","isDefault":true,"summary":"Vienna Ab-initio Simulation Package","updatedAt":"2023-08-17T23:02:32.576Z","shortName":"vasp","isLicensed":true,"updatedBy":"0"},"executable":{"isDefault":true,"postProcessors":["error_handler","prepare_restart","remove_non_zero_weight_kpoints"],"monitors":["standard_output","convergence_ionic","convergence_electronic"],"results":["atomic_forces","band_gaps","band_structure","density_of_states","fermi_energy","pressure","stress_tensor","total_energy","total_energy_contributions","total_force","zero_point_energy","final_structure","magnetic_moments","reaction_energy_barrier","reaction_energy_profile","potential_profile","charge_density_profile"],"name":"vasp"},"flavor":{"isDefault":true,"input":[{"name":"INCAR"},{"name":"KPOINTS"},{"name":"POSCAR"}],"results":["total_energy","total_energy_contributions","pressure","fermi_energy","atomic_forces","total_force","stress_tensor"],"monitors":["standard_output","convergence_electronic"],"applicationName":"vasp","executableName":"vasp","name":"vasp","executable":{"isDefault":true,"postProcessors":["error_handler","prepare_restart","remove_non_zero_weight_kpoints"],"monitors":["standard_output","convergence_ionic","convergence_electronic"],"results":["atomic_forces","band_gaps","band_structure","density_of_states","fermi_energy","pressure","stress_tensor","total_energy","total_energy_contributions","total_force","zero_point_energy","final_structure","magnetic_moments","reaction_energy_barrier","reaction_energy_profile","potential_profile","charge_density_profile"],"name":"vasp"}},"status":"idle","statusTrack":[],"input":[{"content":"ISMEAR = 0\nSIGMA = 0.05\nLORBIT = 11","name":"INCAR","contextProviders":[{"name":"VASPInputDataManager"}],"applicationName":"vasp","executableName":"vasp","updatedAt":"2023-08-17T23:02:18.614Z","updatedBy":"0","rendered":"ISMEAR = 0\nSIGMA = 0.05\nLORBIT = 11"},{"content":"Automatic mesh\n0\nGamma\n {% for d in kgrid.dimensions %}{{d}} {% endfor %}\n {% for s in kgrid.shifts %}{{s}} {% endfor %}","name":"KPOINTS","contextProviders":[{"name":"KGridFormDataManager"},{"name":"VASPInputDataManager"}],"applicationName":"vasp","executableName":"vasp","updatedAt":"2023-08-17T23:02:18.670Z","updatedBy":"0","rendered":"Automatic mesh\n0\nGamma\n 2 2 2 \n 0 0 0 "},{"content":"{{ input.POSCAR }}","name":"POSCAR","contextProviders":[{"name":"VASPInputDataManager"}],"applicationName":"vasp","executableName":"vasp","updatedAt":"2023-08-17T23:02:18.693Z","updatedBy":"0","rendered":"Silicon FCC\n1.0\n 3.348920000\t 0.000000000\t 1.933500000\n 1.116307000\t 3.157392000\t 1.933500000\n 0.000000000\t 0.000000000\t 3.867000000\nSi\n2\ndirect\n 0.000000000 0.000000000 0.000000000 Si\n 0.250000000 0.250000000 0.250000000 Si"}],"next":"061929a3-368a-4c42-95fd-4144d31b6692"},{"type":"execution","name":"vasp_nscf","head":false,"results":[{"name":"band_gaps"},{"name":"fermi_energy"}],"monitors":[{"name":"standard_output"},{"name":"convergence_electronic"}],"flowchartId":"061929a3-368a-4c42-95fd-4144d31b6692","preProcessors":[],"postProcessors":[],"application":{"_id":"00000000000000000","name":"vasp","version":"5.3.5","build":"Default","isDefault":true,"summary":"Vienna Ab-initio Simulation Package","updatedAt":"2023-08-17T23:02:32.576Z","shortName":"vasp","isLicensed":true,"updatedBy":"0"},"executable":{"isDefault":true,"postProcessors":["error_handler","prepare_restart","remove_non_zero_weight_kpoints"],"monitors":["standard_output","convergence_ionic","convergence_electronic"],"results":["atomic_forces","band_gaps","band_structure","density_of_states","fermi_energy","pressure","stress_tensor","total_energy","total_energy_contributions","total_force","zero_point_energy","final_structure","magnetic_moments","reaction_energy_barrier","reaction_energy_profile","potential_profile","charge_density_profile"],"name":"vasp"},"flavor":{"input":[{"name":"INCAR","templateName":"INCAR_BANDS"},{"name":"KPOINTS","templateName":"KPOINTS"},{"name":"POSCAR","templateName":"POSCAR"}],"results":["band_gaps","fermi_energy"],"monitors":["standard_output","convergence_electronic"],"applicationName":"vasp","executableName":"vasp","name":"vasp_nscf","executable":{"isDefault":true,"postProcessors":["error_handler","prepare_restart","remove_non_zero_weight_kpoints"],"monitors":["standard_output","convergence_ionic","convergence_electronic"],"results":["atomic_forces","band_gaps","band_structure","density_of_states","fermi_energy","pressure","stress_tensor","total_energy","total_energy_contributions","total_force","zero_point_energy","final_structure","magnetic_moments","reaction_energy_barrier","reaction_energy_profile","potential_profile","charge_density_profile"],"name":"vasp"}},"status":"idle","statusTrack":[],"input":[{"content":"ISMEAR = 0\nSIGMA = 0.05\nISTART = 1\nICHARG = 11","name":"INCAR","contextProviders":[{"name":"VASPInputDataManager"}],"applicationName":"vasp","executableName":"vasp","updatedAt":"2023-08-17T23:02:18.622Z","updatedBy":"0","rendered":"ISMEAR = 0\nSIGMA = 0.05\nISTART = 1\nICHARG = 11"},{"content":"Automatic mesh\n0\nGamma\n {% for d in kgrid.dimensions %}{{d}} {% endfor %}\n {% for s in kgrid.shifts %}{{s}} {% endfor %}","name":"KPOINTS","contextProviders":[{"name":"KGridFormDataManager"},{"name":"VASPInputDataManager"}],"applicationName":"vasp","executableName":"vasp","updatedAt":"2023-08-17T23:02:18.670Z","updatedBy":"0","rendered":"Automatic mesh\n0\nGamma\n 2 2 2 \n 0 0 0 "},{"content":"{{ input.POSCAR }}","name":"POSCAR","contextProviders":[{"name":"VASPInputDataManager"}],"applicationName":"vasp","executableName":"vasp","updatedAt":"2023-08-17T23:02:18.693Z","updatedBy":"0","rendered":"Silicon FCC\n1.0\n 3.348920000\t 0.000000000\t 1.933500000\n 1.116307000\t 3.157392000\t 1.933500000\n 0.000000000\t 0.000000000\t 3.867000000\nSi\n2\ndirect\n 0.000000000 0.000000000 0.000000000 Si\n 0.250000000 0.250000000 0.250000000 Si"}]}],"compute":null,"isDraft":false}],"units":[{"name":"Band Gap","type":"subworkflow","_id":"000000000000000000000000","flowchartId":"509bb16a21dfb6806cbf4022","status":"idle","statusTrack":[],"results":[],"monitors":[],"preProcessors":[],"postProcessors":[],"head":true,"schemaVersion":"2022.8.16","isDefault":false}],"properties":["total_energy","total_energy_contributions","pressure","fermi_energy","atomic_forces","total_force","stress_tensor","band_gaps","fermi_energy"],"hash":"9a0499d15894c106d6115c132f67b47c","isOutdated":false,"workflows":[],"schemaVersion":"2022.8.16","tags":[],"owner":{"_id":"00000000000000000","slug":"user-000000","cls":"Account"},"creator":{"_id":"00000000000000000","slug":"user-000000","cls":"User"},"compute":null,"exabyteId":"00000000000000000","isDefault":false,"isEntitySet":false,"createdAt":"2023-08-23T02:56:18.620Z","createdBy":"00000000000000000","updatedAt":"2023-08-23T02:56:18.894Z","updatedBy":"00000000000000000"}}}''') From 78f1ea327314e321624bd7759f1035a0c6e769ff Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 04:01:49 -0800 Subject: [PATCH 17/19] chore: fix typo --- tests/py/unit/materials/test_materials_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/py/unit/materials/test_materials_data.py b/tests/py/unit/materials/test_materials_data.py index 8aabff2..28a258f 100644 --- a/tests/py/unit/materials/test_materials_data.py +++ b/tests/py/unit/materials/test_materials_data.py @@ -1,7 +1,7 @@ from mat3ra.standata.materials import materials_data -def test_find_entity_tag(): +def test_get_material_data(): """Assert correct information if found about a material.""" material = materials_data["filesMapByName"]["Graphene.json"] assert type(material) == dict From 1800257a3cc1b50394fa78d0f266a461281df19a Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 04:04:35 -0800 Subject: [PATCH 18/19] chore: remove bootstrap.js --- bootstrap.js | 17 ----------------- package.json | 1 - 2 files changed, 18 deletions(-) delete mode 100644 bootstrap.js diff --git a/bootstrap.js b/bootstrap.js deleted file mode 100644 index bf1136d..0000000 --- a/bootstrap.js +++ /dev/null @@ -1,17 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires -const { execSync } = require("child_process"); - -// INIT_CWD is used during npm install - see https://docs.npmjs.com/cli/v9/using-npm/scripts#best-practices -const isDependency = !process.env.INIT_CWD ? false : process.env.INIT_CWD !== process.cwd(); - -if (isDependency) { - process.exit(); -} - -try { - const stdout = execSync("pre-commit install", { encoding: "utf8" }); - console.log(stdout); -} catch (_) { - console.warn("Unable to install pre-commit hooks!"); - console.log("Please install pre-commit, e.g. 'pip install pre-commit'"); -} diff --git a/package.json b/package.json index 73fa91a..f6dd3f2 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "lint:fix": "eslint --fix --cache src/js tests/js && prettier --write src/js tests/js", "lint:staged": "lint-staged", "postinstall": "npm run transpile && cp -r src/js/runtime_data lib/", - "prepare": "node bootstrap.js", "prettier": "prettier --check src/js tests/js", "test": "mocha", "transpile": "tsc" From 90f8c7a642ed264d1f32d210f4bd83ac3935c85e Mon Sep 17 00:00:00 2001 From: Timur Bazhirov Date: Tue, 26 Dec 2023 04:04:58 -0800 Subject: [PATCH 19/19] chore: remove requirements.txt files --- requirements-local.txt | 85 ------------------------------------------ requirements.txt | 20 ---------- 2 files changed, 105 deletions(-) delete mode 100644 requirements-local.txt delete mode 100644 requirements.txt diff --git a/requirements-local.txt b/requirements-local.txt deleted file mode 100644 index b5419c7..0000000 --- a/requirements-local.txt +++ /dev/null @@ -1,85 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.8 -# by the following command: -# -# pip-compile --extra=dev --output-file=requirements-local.txt pyproject.toml -# -black==23.7.0 - # via exabyte-standata (pyproject.toml) -build==0.10.0 - # via pip-tools -cfgv==3.3.1 - # via pre-commit -click==8.1.6 - # via - # black - # pip-tools -distlib==0.3.7 - # via virtualenv -filelock==3.12.2 - # via virtualenv -identify==2.5.26 - # via pre-commit -isort==5.12.0 - # via exabyte-standata (pyproject.toml) -mypy==1.4.1 - # via exabyte-standata (pyproject.toml) -mypy-extensions==1.0.0 - # via - # black - # mypy -nodeenv==1.8.0 - # via pre-commit -numpy==1.24.4 - # via pandas -packaging==23.1 - # via - # black - # build -pandas==2.0.3 - # via exabyte-standata (pyproject.toml) -pathspec==0.11.1 - # via black -pip-tools==7.1.0 - # via exabyte-standata (pyproject.toml) -platformdirs==3.9.1 - # via - # black - # virtualenv -pre-commit==3.3.3 - # via exabyte-standata (pyproject.toml) -pyproject-hooks==1.0.0 - # via build -python-dateutil==2.8.2 - # via pandas -pytz==2023.3 - # via pandas -pyyaml==5.4.1 - # via - # exabyte-standata (pyproject.toml) - # pre-commit -ruff==0.0.280 - # via exabyte-standata (pyproject.toml) -six==1.16.0 - # via python-dateutil -tomli==2.0.1 - # via - # black - # build - # mypy - # pip-tools - # pyproject-hooks -typing-extensions==4.7.1 - # via - # black - # mypy -tzdata==2023.3 - # via pandas -virtualenv==20.24.2 - # via pre-commit -wheel==0.41.0 - # via pip-tools - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f67a264..0000000 --- a/requirements.txt +++ /dev/null @@ -1,20 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.8 -# by the following command: -# -# pip-compile --output-file=requirements.txt pyproject.toml -# -numpy==1.24.4 - # via pandas -pandas==2.0.3 - # via exabyte-standata (pyproject.toml) -python-dateutil==2.8.2 - # via pandas -pytz==2023.3 - # via pandas -pyyaml==6.0.1 - # via exabyte-standata (pyproject.toml) -six==1.16.0 - # via python-dateutil -tzdata==2023.3 - # via pandas