Skip to content

Commit

Permalink
SOF-7449: refactor accuracy levels into a reusable schema
Browse files Browse the repository at this point in the history
  • Loading branch information
pranabdas committed Feb 21, 2025
1 parent ad772e7 commit 72ef2c7
Show file tree
Hide file tree
Showing 14 changed files with 209 additions and 137 deletions.
22 changes: 22 additions & 0 deletions dist/js/schema/core/reusable/accuracy_level.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$id": "core/reusable/accuracy-level",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Reusable accuracy levels schema",
"description": "Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.",
"type": "object",
"additionalProperties": false,
"properties": {
"standard": {
"type": "number",
"description": "Parameter value for standard or default accuracy calculation."
},
"high": {
"type": "number",
"description": "Parameter value for high precision calculation."
},
"low": {
"type": "number",
"description": "Parameter value for low precision calculation."
}
}
}
19 changes: 13 additions & 6 deletions dist/js/schema/methods_directory/physical/psp.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,37 +314,44 @@
"additionalProperties": false,
"properties": {
"wfc": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Reusable accuracy levels schema",
"description": "Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.",
"type": "object",
"additionalProperties": false,
"properties": {
"standard": {
"type": "number",
"description": "Suggested default cutoff for wave function in Ry."
"description": "Parameter value for standard or default accuracy calculation."
},
"high": {
"type": "number",
"description": "Suggested stringent cutoff for wave function in Ry for high precision calculation."
"description": "Parameter value for high precision calculation."
},
"low": {
"type": "number",
"description": "Suggested cutoff for wave function in Ry for low precision calculation."
"description": "Parameter value for low precision calculation."
}
}
},
"rho": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Reusable accuracy levels schema",
"description": "Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.",
"type": "object",
"additionalProperties": false,
"properties": {
"standard": {
"type": "number",
"description": "Suggested default cutoff for charge density in Ry."
"description": "Parameter value for standard or default accuracy calculation."
},
"high": {
"type": "number",
"description": "Suggested stringent cutoff for charge density in Ry for high precision calculation."
"description": "Parameter value for high precision calculation."
},
"low": {
"type": "number",
"description": "Suggested cutoff for charge density in Ry for low precision calculation."
"description": "Parameter value for low precision calculation."
}
}
}
Expand Down
19 changes: 13 additions & 6 deletions dist/js/schema/methods_directory/physical/psp/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,37 +129,44 @@
"additionalProperties": false,
"properties": {
"wfc": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Reusable accuracy levels schema",
"description": "Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.",
"type": "object",
"additionalProperties": false,
"properties": {
"standard": {
"type": "number",
"description": "Suggested default cutoff for wave function in Ry."
"description": "Parameter value for standard or default accuracy calculation."
},
"high": {
"type": "number",
"description": "Suggested stringent cutoff for wave function in Ry for high precision calculation."
"description": "Parameter value for high precision calculation."
},
"low": {
"type": "number",
"description": "Suggested cutoff for wave function in Ry for low precision calculation."
"description": "Parameter value for low precision calculation."
}
}
},
"rho": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Reusable accuracy levels schema",
"description": "Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.",
"type": "object",
"additionalProperties": false,
"properties": {
"standard": {
"type": "number",
"description": "Suggested default cutoff for charge density in Ry."
"description": "Parameter value for standard or default accuracy calculation."
},
"high": {
"type": "number",
"description": "Suggested stringent cutoff for charge density in Ry for high precision calculation."
"description": "Parameter value for high precision calculation."
},
"low": {
"type": "number",
"description": "Suggested cutoff for charge density in Ry for low precision calculation."
"description": "Parameter value for low precision calculation."
}
}
}
Expand Down
19 changes: 13 additions & 6 deletions dist/js/schema/methods_directory/physical/psp/file_data_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,37 +119,44 @@
"additionalProperties": false,
"properties": {
"wfc": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Reusable accuracy levels schema",
"description": "Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.",
"type": "object",
"additionalProperties": false,
"properties": {
"standard": {
"type": "number",
"description": "Suggested default cutoff for wave function in Ry."
"description": "Parameter value for standard or default accuracy calculation."
},
"high": {
"type": "number",
"description": "Suggested stringent cutoff for wave function in Ry for high precision calculation."
"description": "Parameter value for high precision calculation."
},
"low": {
"type": "number",
"description": "Suggested cutoff for wave function in Ry for low precision calculation."
"description": "Parameter value for low precision calculation."
}
}
},
"rho": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Reusable accuracy levels schema",
"description": "Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.",
"type": "object",
"additionalProperties": false,
"properties": {
"standard": {
"type": "number",
"description": "Suggested default cutoff for charge density in Ry."
"description": "Parameter value for standard or default accuracy calculation."
},
"high": {
"type": "number",
"description": "Suggested stringent cutoff for charge density in Ry for high precision calculation."
"description": "Parameter value for high precision calculation."
},
"low": {
"type": "number",
"description": "Suggested cutoff for charge density in Ry for low precision calculation."
"description": "Parameter value for low precision calculation."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/schemas.json

Large diffs are not rendered by default.

72 changes: 54 additions & 18 deletions dist/js/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2467,6 +2467,24 @@ export type ReferenceSchemaUsingAnyOfInsteadOfOneOfBelowBCCurrentReferenceSchema
*/
reference?: {}[];
};
/** Schema dist/js/schema/core/reusable/accuracy_level.json */
/**
* Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.
*/
export interface ReusableAccuracyLevelsSchema {
/**
* Parameter value for standard or default accuracy calculation.
*/
standard?: number;
/**
* Parameter value for high precision calculation.
*/
high?: number;
/**
* Parameter value for low precision calculation.
*/
low?: number;
}
/** Schema dist/js/schema/core/reusable/atomic_data/per_orbital.json */
/**
* Atomic properties per orbital e.g., Hubbard U parameters.
Expand Down Expand Up @@ -11818,31 +11836,37 @@ export interface PseudopotentialFile {
* Suggested cutoff values for wave function and charge density.
*/
cutoffs?: {
/**
* Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.
*/
wfc?: {
/**
* Suggested default cutoff for wave function in Ry.
* Parameter value for standard or default accuracy calculation.
*/
standard?: number;
/**
* Suggested stringent cutoff for wave function in Ry for high precision calculation.
* Parameter value for high precision calculation.
*/
high?: number;
/**
* Suggested cutoff for wave function in Ry for low precision calculation.
* Parameter value for low precision calculation.
*/
low?: number;
};
/**
* Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.
*/
rho?: {
/**
* Suggested default cutoff for charge density in Ry.
* Parameter value for standard or default accuracy calculation.
*/
standard?: number;
/**
* Suggested stringent cutoff for charge density in Ry for high precision calculation.
* Parameter value for high precision calculation.
*/
high?: number;
/**
* Suggested cutoff for charge density in Ry for low precision calculation.
* Parameter value for low precision calculation.
*/
low?: number;
};
Expand Down Expand Up @@ -11922,31 +11946,37 @@ export interface FileDataItem {
* Suggested cutoff values for wave function and charge density.
*/
cutoffs?: {
/**
* Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.
*/
wfc?: {
/**
* Suggested default cutoff for wave function in Ry.
* Parameter value for standard or default accuracy calculation.
*/
standard?: number;
/**
* Suggested stringent cutoff for wave function in Ry for high precision calculation.
* Parameter value for high precision calculation.
*/
high?: number;
/**
* Suggested cutoff for wave function in Ry for low precision calculation.
* Parameter value for low precision calculation.
*/
low?: number;
};
/**
* Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.
*/
rho?: {
/**
* Suggested default cutoff for charge density in Ry.
* Parameter value for standard or default accuracy calculation.
*/
standard?: number;
/**
* Suggested stringent cutoff for charge density in Ry for high precision calculation.
* Parameter value for high precision calculation.
*/
high?: number;
/**
* Suggested cutoff for charge density in Ry for low precision calculation.
* Parameter value for low precision calculation.
*/
low?: number;
};
Expand Down Expand Up @@ -12094,31 +12124,37 @@ export interface UnitMethodPseudopotential {
* Suggested cutoff values for wave function and charge density.
*/
cutoffs?: {
/**
* Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.
*/
wfc?: {
/**
* Suggested default cutoff for wave function in Ry.
* Parameter value for standard or default accuracy calculation.
*/
standard?: number;
/**
* Suggested stringent cutoff for wave function in Ry for high precision calculation.
* Parameter value for high precision calculation.
*/
high?: number;
/**
* Suggested cutoff for wave function in Ry for low precision calculation.
* Parameter value for low precision calculation.
*/
low?: number;
};
/**
* Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.
*/
rho?: {
/**
* Suggested default cutoff for charge density in Ry.
* Parameter value for standard or default accuracy calculation.
*/
standard?: number;
/**
* Suggested stringent cutoff for charge density in Ry for high precision calculation.
* Parameter value for high precision calculation.
*/
high?: number;
/**
* Suggested cutoff for charge density in Ry for low precision calculation.
* Parameter value for low precision calculation.
*/
low?: number;
};
Expand Down
10 changes: 5 additions & 5 deletions example/methods_directory/physical/psp/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
"type": "nc",
"version": "0.4",
"cutoffs": {
"wfc": {
"standard": 42.0,
"high": 50.0,
"low": 38.0
}
"wfc": {
"standard": 42.0,
"high": 50.0,
"low": 38.0
}
}
}
}
22 changes: 22 additions & 0 deletions schema/core/reusable/accuracy_levels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$id": "core/reusable/accuracy-level",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Reusable accuracy levels schema",
"description": "Used to specify different accuracy levels of a parameter, e.g., wavefunction and charge density cutoffs.",
"type": "object",
"additionalProperties": false,
"properties": {
"standard": {
"type": "number",
"description": "Parameter value for standard or default accuracy calculation."
},
"high": {
"type": "number",
"description": "Parameter value for high precision calculation."
},
"low": {
"type": "number",
"description": "Parameter value for low precision calculation."
}
}
}
Loading

0 comments on commit 72ef2c7

Please sign in to comment.