Skip to content

Commit

Permalink
Update to 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
InnocentBug committed Apr 24, 2024
1 parent 306428c commit 78fbdea
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions tests/fixtures/primary_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def simple_project_node(simple_collection_node) -> cript.Project:
def complex_project_dict(complex_collection_node, simple_material_node, complex_user_node) -> dict:
project_dict = {"node": ["Project"]}
project_dict["locked"] = True
project_dict["model_version"] = "1.0.0"
project_dict["model_version"] = "1.0.1"
project_dict["updated_by"] = json.loads(copy.deepcopy(complex_user_node).get_expanded_json())
project_dict["created_by"] = json.loads(complex_user_node.get_expanded_json())
project_dict["public"] = True
Expand Down Expand Up @@ -60,7 +60,7 @@ def fixed_cyclic_project_node() -> cript.Project:
project_json_string += '"created_at": "2024-03-12 15:58:12.486673",\n'
project_json_string += '"updated_at": "2024-03-12 15:58:12.486681",\n'
project_json_string += '"email": "test@emai.com",\n'
project_json_string += '"model_version": "1.0.0",\n'
project_json_string += '"model_version": "1.0.1",\n'
project_json_string += '"orcid": "0000-0002-0000-0000",\n'
project_json_string += '"picture": "/my/picture/path",\n'
project_json_string += '"username": "testuser"\n'
Expand All @@ -72,13 +72,13 @@ def fixed_cyclic_project_node() -> cript.Project:
project_json_string += '"created_at": "2024-03-12 15:58:12.486673",\n'
project_json_string += '"updated_at": "2024-03-12 15:58:12.486681",\n'
project_json_string += '"email": "test@emai.com",\n'
project_json_string += '"model_version": "1.0.0",\n'
project_json_string += '"model_version": "1.0.1",\n'
project_json_string += '"orcid": "0000-0002-0000-0000",\n'
project_json_string += '"picture": "/my/picture/path",\n'
project_json_string += '"username": "testuser"\n'
project_json_string += "},\n"
project_json_string += '"locked": true,\n'
project_json_string += '"model_version": "1.0.0",\n'
project_json_string += '"model_version": "1.0.1",\n'
project_json_string += '"public": true,\n'
project_json_string += '"name": "my project name",\n'
project_json_string += '"notes": "my project notes",\n'
Expand Down Expand Up @@ -126,7 +126,7 @@ def fixed_cyclic_project_node() -> cript.Project:
project_json_string += '"node": ["Property"],\n'
project_json_string += '"uid": "_:fc504202-6fdd-43c7-830d-40c7d3f0cb8c",\n'
project_json_string += '"uuid": "fc504202-6fdd-43c7-830d-40c7d3f0cb8c",\n'
project_json_string += '"key": "modulus_shear",\n'
project_json_string += '"key": "enthalpy",\n'
project_json_string += '"type": "value",\n'
project_json_string += '"value": 5.0,\n'
project_json_string += '"unit": "GPa",\n'
Expand Down Expand Up @@ -213,7 +213,7 @@ def fixed_cyclic_project_node() -> cript.Project:
project_json_string += '"node": ["Property"],\n'
project_json_string += '"uid": "_:fde629f5-8d3a-4546-8cd3-9de63b990187",\n'
project_json_string += '"uuid": "fde629f5-8d3a-4546-8cd3-9de63b990187",\n'
project_json_string += '"key": "modulus_shear",\n'
project_json_string += '"key": "enthalpy",\n'
project_json_string += '"type": "value",\n'
project_json_string += '"value": 5.0,\n'
project_json_string += '"unit": "GPa",\n'
Expand Down
8 changes: 4 additions & 4 deletions tests/fixtures/subobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def complex_property_node(complex_material_node, complex_condition_node, complex
a maximal property sub-object with all possible fields filled
"""
my_complex_property = cript.Property(
key="modulus_shear",
key="enthalpy",
type="value",
value=5.0,
unit="GPa",
Expand All @@ -144,7 +144,7 @@ def complex_property_node(complex_material_node, complex_condition_node, complex
def complex_property_dict(complex_material_node, complex_condition_dict, complex_citation_dict, complex_data_node, simple_process_node, simple_computation_node) -> dict:
ret_dict = {
"node": ["Property"],
"key": "modulus_shear",
"key": "enthalpy",
"type": "value",
"value": 5.0,
"unit": "GPa",
Expand All @@ -165,7 +165,7 @@ def complex_property_dict(complex_material_node, complex_condition_dict, complex
@pytest.fixture(scope="function")
def simple_property_node() -> cript.Property:
my_property = cript.Property(
key="modulus_shear",
key="enthalpy",
type="value",
value=5.0,
unit="GPa",
Expand All @@ -177,7 +177,7 @@ def simple_property_node() -> cript.Property:
def simple_property_dict() -> dict:
ret_dict = {
"node": ["Property"],
"key": "modulus_shear",
"key": "enthalpy",
"type": "value",
"value": 5.0,
"unit": "GPa",
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/supporting_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def complex_local_file_node(tmp_path_factory) -> cript.File:
def complex_user_dict() -> dict:
user_dict = {"node": ["User"]}
user_dict["created_at"] = str(datetime.datetime.now())
user_dict["model_version"] = "1.0.0"
user_dict["model_version"] = "1.0.1"
user_dict["picture"] = "/my/picture/path"
user_dict["updated_at"] = str(datetime.datetime.now())
user_dict["username"] = "testuser"
Expand Down
2 changes: 1 addition & 1 deletion tests/nodes/primary_nodes/test_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_create_complex_material(cript_api, simple_material_node, simple_computa
component = [simple_material_node]
forcefield = simple_computational_forcefield_node

my_property = [cript.Property(key="modulus_shear", type="min", value=1.23, unit="gram")]
my_property = [cript.Property(key="rho_z", type="min", value=1.23, unit="gram")]

my_material = cript.Material(
name=material_name,
Expand Down
4 changes: 2 additions & 2 deletions tests/nodes/subobjects/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def test_json(complex_property_node, complex_property_dict):


def test_setter_getter(complex_property_node, simple_material_node, simple_process_node, complex_condition_node, simple_data_node, simple_computation_node, complex_citation_node):
complex_property_node.key = "modulus_loss"
assert complex_property_node.key == "modulus_loss"
complex_property_node.key = "rho_z"
assert complex_property_node.key == "rho_z"

complex_property_node.type = "min"
assert complex_property_node.type == "min"
Expand Down
12 changes: 6 additions & 6 deletions tests/test_node_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def test_uid_deserialization(simple_algorithm_node, complex_parameter_node, simp
material = cript.Material(name="my material", bigsmiles="{[][$]CC[$][]}")

computation = cript.Computation(name="my computation name", type="analysis")
property1 = cript.Property("modulus_shear", "value", 5.0, "GPa", computation=[computation])
property2 = cript.Property("modulus_loss", "value", 5.0, "GPa", computation=[computation])
property1 = cript.Property("enthalpy", "value", 5.0, "GPa", computation=[computation])
property2 = cript.Property("rho_z", "value", 5.0, "GPa", computation=[computation])
material.property = [property1, property2]

material2 = cript.load_nodes_from_json(material.json)
Expand All @@ -50,7 +50,7 @@ def test_uid_deserialization(simple_algorithm_node, complex_parameter_node, simp
"node": ["Property"],
"uid": "_:82e7270e-9f35-4b35-80a2-faa6e7f670be",
"uuid": "82e7270e-9f35-4b35-80a2-faa6e7f670be",
"key": "modulus_shear",
"key": "enthalpy",
"type": "value",
"value": 5.0,
"unit": "GPa",
Expand All @@ -60,7 +60,7 @@ def test_uid_deserialization(simple_algorithm_node, complex_parameter_node, simp
"node": ["Property"],
"uid": "_:fc4dfa5e-742c-4d0b-bb66-2185461f4582",
"uuid": "fc4dfa5e-742c-4d0b-bb66-2185461f4582",
"key": "modulus_loss",
"key": "rho_z",
"type": "value",
"value": 5.0,
"unit": "GPa",
Expand Down Expand Up @@ -92,7 +92,7 @@ def test_uid_deserialization(simple_algorithm_node, complex_parameter_node, simp
# ],
# "uid": "_:82e7270e-9f35-4b35-80a2-faa6e7f670be",
# "uuid": "82e7270e-9f35-4b35-80a2-faa6e7f670be",
# "key": "modulus_shear",
# "key": "enthalpy",
# "type": "value",
# "value": 5.0,
# "unit": "GPa",
Expand All @@ -111,7 +111,7 @@ def test_uid_deserialization(simple_algorithm_node, complex_parameter_node, simp
# ],
# "uid": "_:fc4dfa5e-742c-4d0b-bb66-2185461f4582",
# "uuid": "fc4dfa5e-742c-4d0b-bb66-2185461f4582",
# "key": "modulus_loss",
# "key": "rho_z",
# "type": "value",
# "value": 5.0,
# "unit": "GPa",
Expand Down

0 comments on commit 78fbdea

Please sign in to comment.