Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,24 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Build package
run: |
python -m pip install --upgrade pip
pip install build
python -m pip install build
python -m build

- name: Install package and dependencies
shell: bash
run: |
pip install dist/plams-*.whl
pip install ".[chem,ams,analysis,dev]"
python -m pip install dist/plams-*.whl
python -m pip install ".[chem,ams,analysis,dev]"

- name: Run Unit Tests
working-directory: unit_tests
Expand All @@ -68,20 +69,23 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install ".[chem,ams,analysis,dev]"
python -m pip install ".[chem,ams,analysis,dev]"
# Reinstall specific rdkit version on 3.8 to avoid bug in stubs on last supported version
if [ "${{ matrix.python-version }}" = "3.8" ]; then
pip install rdkit==2023.9.5 --force-reinstall
python -m pip install rdkit==2023.9.5 --force-reinstall
fi
if [ "${{ matrix.python-version }}" = "3.13" ]; then
python -m pip install rdkit==2026.3.2 --force-reinstall
fi

- name: Run Black
Expand All @@ -102,17 +106,17 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set Up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.x"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install ".[docs]" snowballstemmer==2.2.0 # See: https://github.com/sphinx-doc/sphinx/issues/13533
python -m pip install ".[docs]"

- name: Build Sphinx Docs
working-directory: doc
Expand Down
9 changes: 2 additions & 7 deletions src/scm/plams/tools/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,12 +1004,7 @@ def generate_image(cls, system: Union[Molecule, "ChemicalSystem"], config: ViewC
elif _has_scm_chemsys and isinstance(system, ChemicalSystem):
regions = [system.get_regions_of_atom(at) for at in system]

try:
import matplotlib.colormaps as colormaps
except ImportError:
import matplotlib.cm as colormaps

cmap = colormaps.get_cmap("tab10")
cmap = plt.get_cmap("tab10")
color_counter = 0
region_cmap: Dict[str, colors.Colormap] = {}
for patch in ax.patches:
Expand All @@ -1026,7 +1021,7 @@ def generate_image(cls, system: Union[Molecule, "ChemicalSystem"], config: ViewC
if region in region_cmap:
region_color = region_cmap[region]
else:
region_color = cmap.colors[color_counter]
region_color = cmap.colors[color_counter] # type: ignore[attr-defined,index]
region_cmap[region] = region_color
color_counter += 1
region_patch = patches.Circle(
Expand Down
12 changes: 6 additions & 6 deletions unit_tests/test_tools_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def iterate_options(molecules, options):
remove_text=True,
extensions=["png"],
style="mpl20",
tol=3,
tol=10,
)
def test_plot_band_structure(run_calculations, rkf_tools_plot):
plt.close("all")
Expand Down Expand Up @@ -224,7 +224,7 @@ def test_plot_band_structure(run_calculations, rkf_tools_plot):
remove_text=True,
extensions=["png"],
style="mpl20",
tol=3,
tol=10,
)
def test_plot_phonons_band_structure(run_calculations, rkf_tools_plot):
plt.close("all")
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_plot_phonons_band_structure(run_calculations, rkf_tools_plot):
remove_text=True,
extensions=["png"],
style="mpl20",
tol=3,
tol=12,
)
def test_plot_phonons_dos(run_calculations, rkf_tools_plot):
plt.close("all")
Expand Down Expand Up @@ -306,7 +306,7 @@ def test_plot_phonons_dos(run_calculations, rkf_tools_plot):
remove_text=True,
extensions=["png"],
style="mpl20",
tol=1.0,
tol=12,
)
def test_plot_correlation(run_calculations, rkf_tools_plot):
plt.close("all")
Expand Down Expand Up @@ -414,7 +414,7 @@ def test_plot_correlation(run_calculations, rkf_tools_plot):
remove_text=True,
extensions=["png"],
style="mpl20",
tol=4,
tol=20,
)
def test_plot_msd(run_calculations, rkf_tools_plot, xyz_folder):
plt.close("all")
Expand Down Expand Up @@ -529,7 +529,7 @@ def test_plot_msd_with_pisa(run_calculations, rkf_tools_plot, xyz_folder):
remove_text=True,
extensions=["png"],
style="mpl20",
tol=11,
tol=20,
)
def test_plot_work_function(run_calculations, rkf_tools_plot):
plt.close("all")
Expand Down
Loading