From f240a45584210ef683d483f74429952349a82ccd Mon Sep 17 00:00:00 2001 From: Pranab Das <31024886+pranabdas@users.noreply.github.com> Date: Fri, 8 Dec 2023 08:39:45 +0800 Subject: [PATCH] SOF-6892: refactoring atomic data per orbital and orbital pair --- schema/core/reusable/atomic_data/numeric.json | 14 +------ .../reusable/atomic_data/per_orbital.json | 22 +++++++++++ .../atomic_data/per_orbital_pair.json | 39 +++++++++++++++++++ schema/core/reusable/atomic_data/string.json | 20 ++-------- .../reusable/atomic_data_per_orbital.json | 16 -------- .../atomic_data_per_orbital_numeric.json | 15 +++++++ .../atomic_data_per_orbital_pair.json | 16 -------- .../atomic_data_per_orbital_pair_numeric.json | 15 +++++++ .../non-scalar/hubbard_u.json | 5 ++- .../non-scalar/hubbard_v.json | 5 ++- 10 files changed, 101 insertions(+), 66 deletions(-) create mode 100644 schema/core/reusable/atomic_data/per_orbital.json create mode 100644 schema/core/reusable/atomic_data/per_orbital_pair.json delete mode 100644 schema/core/reusable/atomic_data_per_orbital.json create mode 100644 schema/core/reusable/atomic_data_per_orbital_numeric.json delete mode 100644 schema/core/reusable/atomic_data_per_orbital_pair.json create mode 100644 schema/core/reusable/atomic_data_per_orbital_pair_numeric.json diff --git a/schema/core/reusable/atomic_data/numeric.json b/schema/core/reusable/atomic_data/numeric.json index e708cfdff..acd43c13f 100644 --- a/schema/core/reusable/atomic_data/numeric.json +++ b/schema/core/reusable/atomic_data/numeric.json @@ -2,21 +2,9 @@ "$id": "core/reusable/atomic-data/numeric-data", "$schema": "http://json-schema.org/draft-04/schema#", "title": "Atomic data numeric properties", - "description": "Numeric fields used in atomic data", + "description": "Numeric value specific to atomic data", "type": "object", "properties": { - "id": { - "type": "integer", - "description": "Site number or index in the lattice" - }, - "id2": { - "type": "integer", - "description": "Site number or index in the lattice of second site" - }, - "distance": { - "type": "number", - "description": "Distance between two sites in angstrom." - }, "value": { "type": "number", "description": "Value related to a specific property, e.g., Hubbard U, V etc." diff --git a/schema/core/reusable/atomic_data/per_orbital.json b/schema/core/reusable/atomic_data/per_orbital.json new file mode 100644 index 000000000..8617bdde6 --- /dev/null +++ b/schema/core/reusable/atomic_data/per_orbital.json @@ -0,0 +1,22 @@ +{ + "$id": "core/reusable/atomic-data/per-orbital", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Atomic data per orbital", + "description": "Atomic properties per orbital e.g., Hubbard U parameters.", + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Site number or index in the lattice" + }, + "atomicSpecies": { + "type": "string", + "pattern": "^[a-zA-Z]{1,2}[\\d+]?$", + "description": "Example: Co1, Mn" + }, + "orbitalName": { + "type": "string", + "pattern": "^[1-7][sSpPdDfF]$" + } + } +} diff --git a/schema/core/reusable/atomic_data/per_orbital_pair.json b/schema/core/reusable/atomic_data/per_orbital_pair.json new file mode 100644 index 000000000..edb91a1b5 --- /dev/null +++ b/schema/core/reusable/atomic_data/per_orbital_pair.json @@ -0,0 +1,39 @@ +{ + "$id": "core/reusable/atomic-data/per-orbital-pair", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Atomic data per orbital pair", + "description": "Atomic properties per orbital pair e.g., Hubbard V parameters.", + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Site number or index in the lattice" + }, + "id2": { + "type": "integer", + "description": "Site number or index in the lattice of second site" + }, + "atomicSpecies": { + "type": "string", + "pattern": "^[a-zA-Z]{1,2}[\\d+]?$", + "description": "Example: Co1, Mn" + }, + "atomicSpecies2": { + "type": "string", + "pattern": "^[a-zA-Z]{1,2}[\\d+]?$", + "description": "Example: Co2, O" + }, + "orbitalName": { + "type": "string", + "pattern": "^[1-7][sSpPdDfF]$" + }, + "orbitalName2": { + "type": "string", + "pattern": "^[1-7][sSpPdDfF]$" + }, + "distance": { + "type": "number", + "description": "Distance between two sites in angstrom." + } + } +} diff --git a/schema/core/reusable/atomic_data/string.json b/schema/core/reusable/atomic_data/string.json index 7aaaab7ba..492e22fba 100644 --- a/schema/core/reusable/atomic_data/string.json +++ b/schema/core/reusable/atomic_data/string.json @@ -2,26 +2,12 @@ "$id": "core/reusable/atomic-data/string-data", "$schema": "http://json-schema.org/draft-04/schema#", "title": "Atomic data string properties", - "description": "String fields used in atomic data", + "description": "String value specific to atomic data", "type": "object", "properties": { - "atomicSpecies": { + "value": { "type": "string", - "pattern": "^[a-zA-Z]{1,2}[\\d+]?$", - "description": "Example: Co1, Mn" - }, - "atomicSpecies2": { - "type": "string", - "pattern": "^[a-zA-Z]{1,2}[\\d+]?$", - "description": "Example: Co2, O" - }, - "orbitalName": { - "type": "string", - "pattern": "^[1-7][sSpPdDfF]$" - }, - "orbitalName2": { - "type": "string", - "pattern": "^[1-7][sSpPdDfF]$" + "description": "String value specific to atomic data" } } } diff --git a/schema/core/reusable/atomic_data_per_orbital.json b/schema/core/reusable/atomic_data_per_orbital.json deleted file mode 100644 index 63ba16210..000000000 --- a/schema/core/reusable/atomic_data_per_orbital.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$id": "core/reusable/atomic-data-per-orbital", - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Atomic data per orbital", - "description": "Atomic properties per orbital e.g., Hubbard U parameters.", - "type": "object", - "allOf": [ - { - "$ref": "atomic_data/numeric.json" - }, - { - "$ref": "atomic_data/string.json" - } - ], - "required": ["id", "atomicSpecies", "orbitalName", "value"] -} diff --git a/schema/core/reusable/atomic_data_per_orbital_numeric.json b/schema/core/reusable/atomic_data_per_orbital_numeric.json new file mode 100644 index 000000000..3cc2dbd23 --- /dev/null +++ b/schema/core/reusable/atomic_data_per_orbital_numeric.json @@ -0,0 +1,15 @@ +{ + "$id": "core/reusable/atomic-data-per-orbital-numeric", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Atomic data per orbital numeric", + "description": "Atomic properties per orbital pair with numeric value e.g., Hubbard V parameters.", + "type": "object", + "allOf":[ + { + "$ref": "atomic_data/per_orbital.json" + }, + { + "$ref": "atomic_data/numeric.json" + } + ] +} diff --git a/schema/core/reusable/atomic_data_per_orbital_pair.json b/schema/core/reusable/atomic_data_per_orbital_pair.json deleted file mode 100644 index d0a5aa2a1..000000000 --- a/schema/core/reusable/atomic_data_per_orbital_pair.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$id": "core/reusable/atomic-data-per-orbital-pair", - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Atomic data per orbital pair", - "description": "Atomic properties per orbital pair e.g., Hubbard V parameters.", - "type": "object", - "allOf": [ - { - "$ref": "atomic_data/numeric.json" - }, - { - "$ref": "atomic_data/string.json" - } - ], - "required": ["id", "id2", "atomicSpecies", "atomicSpecies2", "value"] -} diff --git a/schema/core/reusable/atomic_data_per_orbital_pair_numeric.json b/schema/core/reusable/atomic_data_per_orbital_pair_numeric.json new file mode 100644 index 000000000..4190b2846 --- /dev/null +++ b/schema/core/reusable/atomic_data_per_orbital_pair_numeric.json @@ -0,0 +1,15 @@ +{ + "$id": "core/reusable/atomic-data-per-orbital-pair-numeric", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Atomic data per orbital pair numeric", + "description": "Atomic properties per orbital pair with numeric value e.g., Hubbard V parameters.", + "type": "object", + "allOf":[ + { + "$ref": "atomic_data/per_orbital_pair.json" + }, + { + "$ref": "atomic_data/numeric.json" + } + ] +} diff --git a/schema/properties_directory/non-scalar/hubbard_u.json b/schema/properties_directory/non-scalar/hubbard_u.json index 8da10b025..e34b39c5d 100644 --- a/schema/properties_directory/non-scalar/hubbard_u.json +++ b/schema/properties_directory/non-scalar/hubbard_u.json @@ -16,9 +16,10 @@ "type": "object", "allOf": [ { - "$ref": "../../core/reusable/atomic_data_per_orbital.json" + "$ref": "../../core/reusable/atomic_data_per_orbital_numeric.json" } - ] + ], + "required": ["id", "atomicSpecies", "orbitalName", "value"] } } }, diff --git a/schema/properties_directory/non-scalar/hubbard_v.json b/schema/properties_directory/non-scalar/hubbard_v.json index 6deceacc6..022cf738b 100644 --- a/schema/properties_directory/non-scalar/hubbard_v.json +++ b/schema/properties_directory/non-scalar/hubbard_v.json @@ -16,9 +16,10 @@ "type": "object", "allOf": [ { - "$ref": "../../core/reusable/atomic_data_per_orbital_pair.json" + "$ref": "../../core/reusable/atomic_data_per_orbital_pair_numeric.json" } - ] + ], + "required": ["id", "id2", "atomicSpecies", "atomicSpecies2", "value"] } } },