diff --git a/molecularnodes/assets/MN_data_file.blend b/molecularnodes/assets/MN_data_file.blend index 00583a75..3b80f9b0 100644 Binary files a/molecularnodes/assets/MN_data_file.blend and b/molecularnodes/assets/MN_data_file.blend differ diff --git a/molecularnodes/io/cellpack.py b/molecularnodes/io/cellpack.py index 28e794a8..ce90779e 100644 --- a/molecularnodes/io/cellpack.py +++ b/molecularnodes/io/cellpack.py @@ -59,7 +59,7 @@ def parse(file, name="NewModel", get_transforms=True, instance_nodes=True): chain_names = np.unique(mol.chain_id) - obj_data['chain_id'] = chain_names + obj_data['chain_id_unique'] = chain_names coll_cellpack = coll.cellpack(f"{name}") diff --git a/tests/snapshots/test_cellpack/test_load_cellpack/bcif/chain_id_unique.txt b/tests/snapshots/test_cellpack/test_load_cellpack/bcif/chain_id_unique.txt new file mode 100644 index 00000000..d5221b51 --- /dev/null +++ b/tests/snapshots/test_cellpack/test_load_cellpack/bcif/chain_id_unique.txt @@ -0,0 +1 @@ +['Cv0', 'Cv1', 'Cv10', 'Cv11', 'Cv12', 'Cv13', 'Cv2', 'Cv3', 'Cv4', 'Cv5', 'Cv6', 'Cv7', 'Cv8', 'Cv9', 'Ed0', 'Ed1', 'Ed2', 'Ed3', 'Ed4', 'Ed5', 'Ed6', 'Ed7', 'Ed8', 'Gb0', 'Gb1', 'Gb2', 'Gb3', 'Gg01', 'Gg02', 'Gg03', 'Gg04', 'Gg11', 'Gg12', 'Gg13', 'Gg14', 'Gh01', 'Gh02', 'Gh03', 'Gh04', 'Gi01', 'Gi02', 'Gi03', 'Gi04'] \ No newline at end of file diff --git a/tests/snapshots/test_cellpack/test_load_cellpack/bcif/instance_names.txt b/tests/snapshots/test_cellpack/test_load_cellpack/bcif/instance_names.txt index 6fc188ce..9b85243b 100644 --- a/tests/snapshots/test_cellpack/test_load_cellpack/bcif/instance_names.txt +++ b/tests/snapshots/test_cellpack/test_load_cellpack/bcif/instance_names.txt @@ -1,43 +1,43 @@ -0000_Cv0.002 -0001_Cv1.002 -0002_Cv10.002 -0003_Cv11.002 -0004_Cv12.002 -0005_Cv13.002 -0006_Cv2.002 -0007_Cv3.002 -0008_Cv4.002 -0009_Cv5.002 -0010_Cv6.002 -0011_Cv7.002 -0012_Cv8.002 -0013_Cv9.002 -0014_Ed0.002 -0015_Ed1.002 -0016_Ed2.002 -0017_Ed3.002 -0018_Ed4.002 -0019_Ed5.002 -0020_Ed6.002 -0021_Ed7.002 -0022_Ed8.002 -0023_Gb0.002 -0024_Gb1.002 -0025_Gb2.002 -0026_Gb3.002 -0027_Gg01.002 -0028_Gg02.002 -0029_Gg03.002 -0030_Gg04.002 -0031_Gg11.002 -0032_Gg12.002 -0033_Gg13.002 -0034_Gg14.002 -0035_Gh01.002 -0036_Gh02.002 -0037_Gh03.002 -0038_Gh04.002 -0039_Gi01.002 -0040_Gi02.002 -0041_Gi03.002 -0042_Gi04.002 \ No newline at end of file +0000_Cv0 +0001_Cv1 +0002_Cv10 +0003_Cv11 +0004_Cv12 +0005_Cv13 +0006_Cv2 +0007_Cv3 +0008_Cv4 +0009_Cv5 +0010_Cv6 +0011_Cv7 +0012_Cv8 +0013_Cv9 +0014_Ed0 +0015_Ed1 +0016_Ed2 +0017_Ed3 +0018_Ed4 +0019_Ed5 +0020_Ed6 +0021_Ed7 +0022_Ed8 +0023_Gb0 +0024_Gb1 +0025_Gb2 +0026_Gb3 +0027_Gg01 +0028_Gg02 +0029_Gg03 +0030_Gg04 +0031_Gg11 +0032_Gg12 +0033_Gg13 +0034_Gg14 +0035_Gh01 +0036_Gh02 +0037_Gh03 +0038_Gh04 +0039_Gi01 +0040_Gi02 +0041_Gi03 +0042_Gi04 \ No newline at end of file diff --git a/tests/snapshots/test_cellpack/test_load_cellpack/cif/chain_id_unique.txt b/tests/snapshots/test_cellpack/test_load_cellpack/cif/chain_id_unique.txt new file mode 100644 index 00000000..d5221b51 --- /dev/null +++ b/tests/snapshots/test_cellpack/test_load_cellpack/cif/chain_id_unique.txt @@ -0,0 +1 @@ +['Cv0', 'Cv1', 'Cv10', 'Cv11', 'Cv12', 'Cv13', 'Cv2', 'Cv3', 'Cv4', 'Cv5', 'Cv6', 'Cv7', 'Cv8', 'Cv9', 'Ed0', 'Ed1', 'Ed2', 'Ed3', 'Ed4', 'Ed5', 'Ed6', 'Ed7', 'Ed8', 'Gb0', 'Gb1', 'Gb2', 'Gb3', 'Gg01', 'Gg02', 'Gg03', 'Gg04', 'Gg11', 'Gg12', 'Gg13', 'Gg14', 'Gh01', 'Gh02', 'Gh03', 'Gh04', 'Gi01', 'Gi02', 'Gi03', 'Gi04'] \ No newline at end of file diff --git a/tests/snapshots/test_cellpack/test_load_cellpack/cif/instance_names.txt b/tests/snapshots/test_cellpack/test_load_cellpack/cif/instance_names.txt index 5d3869e3..9b85243b 100644 --- a/tests/snapshots/test_cellpack/test_load_cellpack/cif/instance_names.txt +++ b/tests/snapshots/test_cellpack/test_load_cellpack/cif/instance_names.txt @@ -1,43 +1,43 @@ -0000_Cv0.003 -0001_Cv1.003 -0002_Cv10.003 -0003_Cv11.003 -0004_Cv12.003 -0005_Cv13.003 -0006_Cv2.003 -0007_Cv3.003 -0008_Cv4.003 -0009_Cv5.003 -0010_Cv6.003 -0011_Cv7.003 -0012_Cv8.003 -0013_Cv9.003 -0014_Ed0.003 -0015_Ed1.003 -0016_Ed2.003 -0017_Ed3.003 -0018_Ed4.003 -0019_Ed5.003 -0020_Ed6.003 -0021_Ed7.003 -0022_Ed8.003 -0023_Gb0.003 -0024_Gb1.003 -0025_Gb2.003 -0026_Gb3.003 -0027_Gg01.003 -0028_Gg02.003 -0029_Gg03.003 -0030_Gg04.003 -0031_Gg11.003 -0032_Gg12.003 -0033_Gg13.003 -0034_Gg14.003 -0035_Gh01.003 -0036_Gh02.003 -0037_Gh03.003 -0038_Gh04.003 -0039_Gi01.003 -0040_Gi02.003 -0041_Gi03.003 -0042_Gi04.003 \ No newline at end of file +0000_Cv0 +0001_Cv1 +0002_Cv10 +0003_Cv11 +0004_Cv12 +0005_Cv13 +0006_Cv2 +0007_Cv3 +0008_Cv4 +0009_Cv5 +0010_Cv6 +0011_Cv7 +0012_Cv8 +0013_Cv9 +0014_Ed0 +0015_Ed1 +0016_Ed2 +0017_Ed3 +0018_Ed4 +0019_Ed5 +0020_Ed6 +0021_Ed7 +0022_Ed8 +0023_Gb0 +0024_Gb1 +0025_Gb2 +0026_Gb3 +0027_Gg01 +0028_Gg02 +0029_Gg03 +0030_Gg04 +0031_Gg11 +0032_Gg12 +0033_Gg13 +0034_Gg14 +0035_Gh01 +0036_Gh02 +0037_Gh03 +0038_Gh04 +0039_Gi01 +0040_Gi02 +0041_Gi03 +0042_Gi04 \ No newline at end of file diff --git a/tests/test_cellpack.py b/tests/test_cellpack.py index caa15494..96c969f4 100644 --- a/tests/test_cellpack.py +++ b/tests/test_cellpack.py @@ -23,6 +23,7 @@ def test_cellpack_data(snapshot, file_format): @pytest.mark.parametrize('file_format', ['bcif', 'cif']) def test_load_cellpack(snapshot, file_format): + bpy.ops.wm.read_homefile(app_template="") name = f"Cellpack_{file_format}" ens = mn.io.cellpack.load( test_data_directory / f"square1.{file_format}", @@ -39,9 +40,9 @@ def test_load_cellpack(snapshot, file_format): ens.modifiers['MolecularNodes'].node_group.nodes['MN_pack_instances'].inputs['As Points'].default_value = False mn.blender.nodes.realize_instances(ens) apply_mods(ens) - for attribute in ens.data.attributes.keys(): snapshot.assert_match( sample_attribute_to_string(ens, attribute), f"att_{attribute}_values.txt" - ) \ No newline at end of file + ) + snapshot.assert_match(str(ens['chain_id_unique']), f"chain_id_unique.txt") \ No newline at end of file