Skip to content

Commit

Permalink
Merge pull request #230 from SCM-NV/DavidOrmrodMorley/mol-formats-exa…
Browse files Browse the repository at this point in the history
…mple-fix

Molecule Formats Example Fixes
  • Loading branch information
dormrod authored Feb 25, 2025
2 parents 1d2b7ae + 617fd9b commit 6515567
Show file tree
Hide file tree
Showing 16 changed files with 309 additions and 22 deletions.
258 changes: 256 additions & 2 deletions doc/source/examples/MoleculeFormats/MoleculeFormats.ipynb.rst

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 47 additions & 19 deletions examples/MoleculeFormats/MoleculeFormats.ipynb

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion examples/MoleculeFormats/MoleculeFormats.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def head(filename, n: int = 4):
from scm.plams import toASE
from ase import Atoms
from ase.visualize.plot import plot_atoms
import matplotlib.pyplot as plt

print(f"{type(mol)=}")
print(f"{mol.get_formula()=}")
Expand All @@ -148,7 +149,8 @@ def head(filename, n: int = 4):
print(f"{type(ase_atoms)=}")
print(f"{ase_atoms.get_chemical_formula()=}")

plot_atoms(ase_atoms, rotation="-85x,5y,0z")
_, ax = plt.subplots(figsize=(2, 2))
plot_atoms(ase_atoms, rotation="-85x,5y,0z", ax=ax)


# #### Convert ASE Atoms to PLAMS Molecule
Expand Down Expand Up @@ -240,6 +242,9 @@ def head(filename, n: int = 4):

# ### pymatgen Structure and Molecule Python classes

# Note that for this part of the example, the `pymatgen` package needs to be installed. This can be done via `amspackages`.


# #### Convert PLAMS Molecule to pymatgen Structure (periodic)
#
# There is no builtin converter between PLAMS Molecule and pymatgen Structure (periodic crystal). Instead, you need to go through the ASE interface to both packages:
Expand Down

0 comments on commit 6515567

Please sign in to comment.