Skip to content
Prev Previous commit
Next Next commit
Rename table_labels to loop_labels
  • Loading branch information
janbridley committed Jan 18, 2025
commit 71a1da673fb39bb01e009324b013e441f44e407f
2 changes: 1 addition & 1 deletion parsnip/parsnip.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def loops(self):
return self._loops

@property
def table_labels(self):
def loop_labels(self):
"""A list of column labels for each data array.

This property is equivalent to :code:`[arr.dtype.names for arr in self.loops]`.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_table_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_reads_all_keys(cif_data):
loop_keys = [*flatten(pycif.loops.values())]
all_keys = [key for key in pycif.true_case.values() if key.lower() in loop_keys]

found_labels = [*flatten(cif_data.file.table_labels)]
found_labels = [*flatten(cif_data.file.loop_labels)]
for key in all_keys:
assert key in found_labels, f"Missing label: {found_labels}"

Expand All @@ -50,7 +50,7 @@ def test_read_atom_sites(cif_data):
parsnip_data = cif_data.file.get_from_loops(cif_data.atom_site_keys)
gemmi_data = _gemmi_read_table(cif_data.filename, cif_data.atom_site_keys)
np.testing.assert_array_equal(parsnip_data, gemmi_data)
assert (key in cif_data.file.table_labels for key in cif_data.atom_site_keys)
assert (key in cif_data.file.loop_labels for key in cif_data.atom_site_keys)

if not any(s in cif_data.filename for s in ["CCDC", "PDB", "AMCSD", "zeolite"]):
import sys
Expand Down