coflandscaper.VisualizeCOF¶
- class coflandscaper.VisualizeCOF(width=800, height=600, background='white', style='stick')[source]¶
Visualize optimized COF structures with py3Dmol.
The viewer can render single files, folders, or selected mode outputs and supports optional supercell expansion before display.
Attributes
backgroundheightstylewidthMethods
Visualize every CIF in one folder and return py3Dmol views.
Visualize optimized COF structures for the selected stacking mode(s).
Visualize all single-layer CIFs in one folder.
- view(folder, add_unit_cell=True, style=None, print_names=True)[source]¶
Visualize every CIF in one folder and return py3Dmol views.
- Parameters:
- Returns:
List of py3Dmol view objects.
- Raises:
FileNotFoundError – If folder is missing or has no CIF files.
ValueError – If folder is not a directory.
- visualize_cof(cof_name, mode='both', input_base=None, dft=False, add_unit_cell=True, supercell_size_serr=(2, 2, 1), supercell_size_incl=(2, 2, 2))[source]¶
Visualize optimized COF structures for the selected stacking mode(s).
- Parameters:
cof_name (str) – COF name used for folder naming.
mode (str) – Mode selector. Allowed values are “incl”, “serr”, or “both”. Defaults to “both”.
input_base (str | Path | None) – Optional base folder containing per-mode subfolders. Defaults to None (uses {cof_name}/4_{cof_name}_optimization).
dft (bool) – If True, read structures from dft_{mode} subfolders. Defaults to False.
add_unit_cell (bool) – If True, draw the unit cell. Defaults to True.
supercell_size_serr (tuple[int, int, int]) – Supercell size for serrated structures. Defaults to (2, 2, 1).
supercell_size_incl (tuple[int, int, int]) – Supercell size for inclined structures. Defaults to (2, 2, 2).
- Returns:
List of py3Dmol views.
Notes
Viewer appearance is fixed to defaults (width=800, height=600, background=”white”, style=”stick”).
- visualize_single_layer(input_folder='1_ILCOF-1_single_layer', add_unit_cell=True, supercell_size=(2, 2, 1))[source]¶
Visualize all single-layer CIFs in one folder.
- Parameters:
- Returns:
List of py3Dmol views.
Notes
No mode argument is used.
All .cif files are read directly from input_folder (no subfolder traversal).
ILS is computed with inclined logic for reporting.