picogl.tests.test_molecular_mesh

Tests for molecular mesh data builders.

Classes

_Atom

_AtomCoords

Functions

test_atom_xyz_prefers_coords_over_xyz() → None

atom_xyz lives on entities.coords, not the sphere mesh module.

test_atom_radius_uses_atom3d_field_or_fallback() → None

test_atoms_mesh_single_atom_counts() → None

test_atoms_mesh_accepts_coords_attribute() → None

MoLib Atom3D-style objects expose coords, not x/y/z.

test_atoms_mesh_color_fn_receives_atom() → None

test_atoms_mesh_two_atoms_vectorized_expand() → None

Two atoms expand one template: tiled normals, repeated colors, offset EBO.

test_atoms_mesh_per_atom_radii_override_uniform_radius() → None

Per-atom radii scale the template independently of geometry.radius.

test_atoms_mesh_default_color_fn_uses_chain_palette() → None

Omitting color_fn must not crash; colors follow make_chain_color_fn.

test_bonds_mesh_single_bond() → None

test_bonds_mesh_cylinder_normals_perpendicular_to_axis() → None

test_bonds_mesh_custom_radius_and_color_fn() → None

test_atoms_mesh_custom_geometry() → None

test_bonds_mesh_custom_geometry() → None

test_bonds_mesh_two_bonds_vectorized_expand() → None

Two shafts: doubled vertex count, per-shaft colors, offset EBO.

test_bonds_mesh_skips_zero_length_without_repeating_color() → None

A collapsed pair adds neither vertices nor a color block.

test_bonds_mesh_item_keys_match_surviving_pairs() → None

Pair metadata omits collapsed shafts and gathers from atom A.

test_bonds_mesh_empty_has_empty_pair_metadata() → None

test_bonds_mesh_color_bonds_false_broadcasts_bond_color() → None

test_atoms_mesh_empty_uses_geometry_draw_info() → None

test_to_legacy_glmesh_without_upload() → None

test_to_glmesh_without_upload() → None

test_atom_point_geometry_is_one_origin_vertex() → None

test_atom_points_mesh_two_atoms_unindexed() → None

Two atoms: one vertex each, colors not repeated, no EBO.

test_atom_points_mesh_color_fn_called_once_per_atom() → None

test_atom_points_mesh_empty_is_unindexed_points() → None

test_bond_lines_mesh_two_atoms_one_pair() → None

Two atoms and one pair: one vertex each, LINES indices [0, 1].

test_bond_lines_mesh_color_bonds_false_broadcasts_bond_color() → None

test_bond_lines_mesh_color_fn_called_once_per_atom() → None

test_bond_lines_mesh_empty_is_indexed_lines() → None

Module Contents

class picogl.tests.test_molecular_mesh._Atom[source]
x: float[source]
y: float[source]
z: float[source]
chain_id: str[source]
picogl.tests.test_molecular_mesh.test_atom_xyz_prefers_coords_over_xyz() → None[source]

atom_xyz lives on entities.coords, not the sphere mesh module.

picogl.tests.test_molecular_mesh.test_atom_radius_uses_atom3d_field_or_fallback() → None[source]
picogl.tests.test_molecular_mesh.test_atoms_mesh_single_atom_counts() → None[source]
class picogl.tests.test_molecular_mesh._AtomCoords[source]
coords: tuple[float, float, float][source]
chain_id: str[source]
picogl.tests.test_molecular_mesh.test_atoms_mesh_accepts_coords_attribute() → None[source]

MoLib Atom3D-style objects expose coords, not x/y/z.

picogl.tests.test_molecular_mesh.test_atoms_mesh_color_fn_receives_atom() → None[source]
picogl.tests.test_molecular_mesh.test_atoms_mesh_two_atoms_vectorized_expand() → None[source]

Two atoms expand one template: tiled normals, repeated colors, offset EBO.

picogl.tests.test_molecular_mesh.test_atoms_mesh_per_atom_radii_override_uniform_radius() → None[source]

Per-atom radii scale the template independently of geometry.radius.

picogl.tests.test_molecular_mesh.test_atoms_mesh_default_color_fn_uses_chain_palette() → None[source]

Omitting color_fn must not crash; colors follow make_chain_color_fn.

picogl.tests.test_molecular_mesh.test_bonds_mesh_single_bond() → None[source]
picogl.tests.test_molecular_mesh.test_bonds_mesh_cylinder_normals_perpendicular_to_axis() → None[source]
picogl.tests.test_molecular_mesh.test_bonds_mesh_custom_radius_and_color_fn() → None[source]
picogl.tests.test_molecular_mesh.test_atoms_mesh_custom_geometry() → None[source]
picogl.tests.test_molecular_mesh.test_bonds_mesh_custom_geometry() → None[source]
picogl.tests.test_molecular_mesh.test_bonds_mesh_two_bonds_vectorized_expand() → None[source]

Two shafts: doubled vertex count, per-shaft colors, offset EBO.

picogl.tests.test_molecular_mesh.test_bonds_mesh_skips_zero_length_without_repeating_color() → None[source]

A collapsed pair adds neither vertices nor a color block.

picogl.tests.test_molecular_mesh.test_bonds_mesh_item_keys_match_surviving_pairs() → None[source]

Pair metadata omits collapsed shafts and gathers from atom A.

picogl.tests.test_molecular_mesh.test_bonds_mesh_empty_has_empty_pair_metadata() → None[source]
picogl.tests.test_molecular_mesh.test_bonds_mesh_color_bonds_false_broadcasts_bond_color() → None[source]
picogl.tests.test_molecular_mesh.test_atoms_mesh_empty_uses_geometry_draw_info() → None[source]
picogl.tests.test_molecular_mesh.test_to_legacy_glmesh_without_upload() → None[source]
picogl.tests.test_molecular_mesh.test_to_glmesh_without_upload() → None[source]
picogl.tests.test_molecular_mesh.test_atom_point_geometry_is_one_origin_vertex() → None[source]
picogl.tests.test_molecular_mesh.test_atom_points_mesh_two_atoms_unindexed() → None[source]

Two atoms: one vertex each, colors not repeated, no EBO.

picogl.tests.test_molecular_mesh.test_atom_points_mesh_color_fn_called_once_per_atom() → None[source]
picogl.tests.test_molecular_mesh.test_atom_points_mesh_empty_is_unindexed_points() → None[source]
picogl.tests.test_molecular_mesh.test_bond_lines_mesh_two_atoms_one_pair() → None[source]

Two atoms and one pair: one vertex each, LINES indices [0, 1].

picogl.tests.test_molecular_mesh.test_bond_lines_mesh_color_bonds_false_broadcasts_bond_color() → None[source]
picogl.tests.test_molecular_mesh.test_bond_lines_mesh_color_fn_called_once_per_atom() → None[source]
picogl.tests.test_molecular_mesh.test_bond_lines_mesh_empty_is_indexed_lines() → None[source]