diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b953a3d36..4c609ec24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 diff --git a/src/scm/plams/tools/view.py b/src/scm/plams/tools/view.py index 5988f5534..fc9573765 100644 --- a/src/scm/plams/tools/view.py +++ b/src/scm/plams/tools/view.py @@ -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: @@ -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( diff --git a/unit_tests/test_tools_plot.py b/unit_tests/test_tools_plot.py index 341e59ad0..f6c823cc0 100644 --- a/unit_tests/test_tools_plot.py +++ b/unit_tests/test_tools_plot.py @@ -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") @@ -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") @@ -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") @@ -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") @@ -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") @@ -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")