Skip to content

Commit

Permalink
refactor: generalize frequency component schema
Browse files Browse the repository at this point in the history
  • Loading branch information
azech-hqs committed Sep 9, 2023
1 parent 2bb4559 commit 0494f58
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
23 changes: 23 additions & 0 deletions schema/core/reusable/frequency_function_matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$id": "core/reusable/frequency-function-matrix",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "",
"description": "Schema for a function of frequency yielding a nx3 matrix",
"type": "object",
"properties": {
"frequencies": {
"description": "Frequencies",
"type": "array",
"items": {
"type": "number"
}
},
"components": {
"description": "Matrix with 3 columns, e.g. x, y, z",
"type": "array",
"items": {
"$ref": "../primitive/array_of_3_numbers.json"
}
}
}
}
31 changes: 8 additions & 23 deletions schema/properties_directory/non-scalar/dielectric_tensor.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,17 @@
},
"diagonalReal": {
"description": "Real parts of the dielectric tensor diagonal components",
"$ref": "#/definitions/dielectric-function"
"$ref": "../../core/reusable/frequency_function_matrix.json"
},
"diagonalImaginary": {
"description": "Imaginary parts of the dielectric tensor diagonal components",
"$ref": "#/definitions/dielectric-function"
"$ref": "../../core/reusable/frequency_function_matrix.json"
},
"spin": {
"type": "number"
}
},
"definitions": {
"dielectric-function": {
"type": "object",
"properties": {
"frequencies": {
"description": "Frequencies in eV",
"type": "array",
"items": {
"type": "number"
}
},
"dielectricComponents": {
"description": "Dielectric components, e.g. espr_x, espr_y, espr_z",
"type": "array",
"items": {
"$ref": "../../core/primitive/array_of_3_numbers.json"
}
}
}
}
}
"required": [
"name"
]
}

0 comments on commit 0494f58

Please sign in to comment.