Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frostedoyster committed Nov 10, 2024
1 parent 4146954 commit e93ac4a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 29 deletions.
63 changes: 38 additions & 25 deletions src/metatrain/share/schema-dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,37 +140,50 @@
},
"type": {
"oneOf": [
{ "enum": ["scalar"] },
{
"cartesian": {
"type": "object",
"properties": {
"rank": {
"type": "integer"
}
},
"additionalProperties": false
}
"type": "string",
"enum": ["scalar"]
},
{
"spherical": {
"type": "object",
"properties": {
"type": "array",
"items": {
"o3_lambda":
{
"type": "integer"
},
"o3_sigma":
{
"type": "number"
"type": "object",
"properties": {
"cartesian": {
"type": "object",
"properties": {
"rank": { "type": "integer" }
},
"required": ["rank"],
"additionalProperties": false
}
},
"required": ["cartesian"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"spherical": {
"type": "object",
"properties": {
"type": {
"type": "array"
},
"items": {
"type": "object",
"properties": {
"o3_lambda": { "type": "integer" },
"o3_sigma": { "type": "number" }
},
"required": ["o3_lambda", "o3_sigma"],
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"required": ["type", "items"],
"additionalProperties": false
}
},
"required": ["spherical"],
"additionalProperties": false
}
]
},
Expand Down
4 changes: 1 addition & 3 deletions tests/utils/test_additive.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,7 @@ def test_composition_model_wrong_target():
length_unit="angstrom",
atomic_types=[1],
targets={
"energy": get_energy_target_info(
{"quantity": "energy", "unit": "eV"}
)
"energy": get_energy_target_info({"quantity": "force", "unit": ""})
},
),
)
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_external_naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_to_external_name():
"mtt::free_energy": get_energy_target_info(
{"quantity": "energy", "unit": "eV"}
),
"mtt::foo": get_energy_target_info({"quantity": "energy", "unit": "eV"}),
"mtt::foo": get_energy_target_info({"quantity": "bar", "unit": "eV"}),
}

assert to_external_name("energy_positions_gradients", quantities) == "forces"
Expand Down

0 comments on commit e93ac4a

Please sign in to comment.