Skip to content

Commit

Permalink
Merge pull request #15 from Exabyte-io/update/SOF-7515
Browse files Browse the repository at this point in the history
update/SOF 7515
  • Loading branch information
timurbazhirov authored Nov 27, 2024
2 parents 415fdf9 + 70c6e83 commit fd9f8ef
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 3 deletions.
1 change: 1 addition & 0 deletions materials/C-[Diamond]-FCC_[Fd-3m]_3D_[Bulk]-[mp-66].json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name": "C, Diamond, FCC (Fd-3m) 3D (Bulk), mp-66", "lattice": {"type": "CUB", "a": 3.560745, "b": 3.560745, "c": 3.560745, "alpha": 90.0, "beta": 90.0, "gamma": 90.0, "units": {"length": "angstrom", "angle": "degree"}}, "basis": {"units": "crystal", "elements": [{"id": 0, "value": "C"}, {"id": 1, "value": "C"}, {"id": 2, "value": "C"}, {"id": 3, "value": "C"}, {"id": 4, "value": "C"}, {"id": 5, "value": "C"}, {"id": 6, "value": "C"}, {"id": 7, "value": "C"}], "coordinates": [{"id": 0, "value": [0.0, 0.0, 0.5]}, {"id": 1, "value": [0.25, 0.25, 0.75]}, {"id": 2, "value": [0.0, 0.5, 0.0]}, {"id": 3, "value": [0.25, 0.75, 0.25]}, {"id": 4, "value": [0.5, 0.0, 0.0]}, {"id": 5, "value": [0.75, 0.25, 0.25]}, {"id": 6, "value": [0.5, 0.5, 0.5]}, {"id": 7, "value": [0.75, 0.75, 0.75]}]}, "external": {"id": "mp-66", "source": "Materials Project", "doi": "10.1063/1.4812323", "url": "https://next-gen.materialsproject.org/materials/mp-66", "origin": true}, "isNonPeriodic": false}
6 changes: 6 additions & 0 deletions materials/categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,9 @@ entities:
- non-magnetic
- nitride
- ceramic
- filename: C-[Diamond]-FCC_[Fd-3m]_3D_[Bulk]-[mp-66].json
categories:
- 3D
- bulk
- insulator
- non-magnetic
11 changes: 11 additions & 0 deletions materials/sources/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,14 @@ sources:
source: Materials Project
doi:
url: https://next-gen.materialsproject.org/materials/mp-492

- filename: mp-66.poscar
common_name: Diamond
lattice_type: FCC
space_group: Fd-3m
dimensionality: 3D
form_factor: Bulk
source_id: mp-66
source: Materials Project
doi: 10.1063/1.4812323
url: https://next-gen.materialsproject.org/materials/mp-66
16 changes: 16 additions & 0 deletions materials/sources/mp-66.poscar
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
C8
1.0
3.5607451090903233 0.0000000000000000 0.0000000000000002
0.0000000000000006 3.5607451090903233 0.0000000000000002
0.0000000000000000 0.0000000000000000 3.5607451090903233
C
8
direct
0.0000000000000000 0.0000000000000000 0.5000000000000000 C
0.2500000000000000 0.2500000000000000 0.7500000000000000 C
0.0000000000000000 0.5000000000000000 0.0000000000000000 C
0.2500000000000000 0.7500000000000000 0.2500000000000000 C
0.5000000000000000 0.0000000000000000 0.0000000000000000 C
0.7500000000000000 0.2500000000000000 0.2500000000000000 C
0.5000000000000000 0.5000000000000000 0.5000000000000000 C
0.7500000000000000 0.7500000000000000 0.7500000000000000 C
2 changes: 1 addition & 1 deletion src/js/runtime_data/materials.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/py/mat3ra/standata/data/materials.py

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion tests/js/material.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { expect } from "chai";
import * as fs from "fs";
import * as yaml from "js-yaml";

import h_BN from "../../materials/BN-[Hexagonal_Boron_Nitride]-HEX_[P6%2Fmmm]_2D_[Monolayer]-[2dm-4991].json";
import Graphene from "../../materials/C-[Graphene]-HEX_[P6%2Fmmm]_2D_[Monolayer]-[2dm-3993].json";
Expand All @@ -7,7 +9,20 @@ import Si from "../../materials/Si-[Silicon]-FCC_[Fd-3m]_3D_[Bulk]-[mp-149].json
import WS2 from "../../materials/WS2-[Tungsten_Disulfide]-HEX_[P-6m2]_2D_[Monolayer]-[2dm-3749].json";
import { MaterialStandata } from "../../src/js";

const TOTAL_NUMBER_OF_MATERIALS = 30;
function countEntitiesInYAML(filePath: string, entityKey: string): number {
try {
const fileContents = fs.readFileSync(filePath, "utf8");
const data = yaml.load(fileContents) as { [key: string]: any[] };
return data[entityKey]?.length || 0;
} catch (e) {
console.error(e);
return 0;
}
}

const materialsCategoriesFilePath = "materials/categories.yml";
const TOTAL_NUMBER_OF_MATERIALS = countEntitiesInYAML(materialsCategoriesFilePath, "entities");
console.log(`Total number of materials: ${TOTAL_NUMBER_OF_MATERIALS}`);

describe("Materials Standata", () => {
it("can return the list of all materials", () => {
Expand Down

0 comments on commit fd9f8ef

Please sign in to comment.