Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmshn committed May 24, 2024
2 parents fa0a788 + c1f0aed commit f71521b
Show file tree
Hide file tree
Showing 10 changed files with 1,413 additions and 1,107 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -35,7 +38,7 @@ jobs:
python${{ matrix.python-version }} -m pip install `grep numpy== requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt`
python${{ matrix.python-version }} -m pip install -r requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt
python${{ matrix.python-version }} -m pip install --upgrade pip
python${{ matrix.python-version }} -m pip install --no-deps .
python${{ matrix.python-version }} -m pip install --no-deps .[server]
- name: Test modules
run: python${{ matrix.python-version }} -m pytest --cov=crystal_toolkit --cov-report=xml tests
- name: Test example apps
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ jobs:
fetch-depth: 0
token: ${{ secrets.PAT }}

- uses: actions/setup-python@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: '**/pyproject.toml'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install `grep numpy== requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt`
python -m pip install -r requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt
python -m pip install --upgrade pip
python -m pip install --no-deps .[server]
python -m pip install build
python${{ matrix.python-version }} -m pip install --upgrade pip packaging wheel build
python${{ matrix.python-version }} -m pip install `grep numpy== requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt`
python${{ matrix.python-version }} -m pip install -r requirements/ubuntu-latest_py${{ matrix.python-version }}_extras.txt
python${{ matrix.python-version }} -m pip install --upgrade pip
python${{ matrix.python-version }} -m pip install --no-deps .[server]
- name: Build package
run: python -m build
run: python${{ matrix.python-version }} -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.5
Expand Down
4 changes: 2 additions & 2 deletions crystal_toolkit/core/legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from itertools import chain
from typing import TYPE_CHECKING, Any

from matplotlib import colormaps
from matplotlib.pyplot import get_cmap
from monty.json import MSONable
from monty.serialization import loadfn
from palettable.colorbrewer.qualitative import Set1_9
Expand Down Expand Up @@ -286,7 +286,7 @@ def get_color(self, sp: Species | Element, site: Site | None = None) -> str:
prop = site.properties[self.color_scheme]

if prop:
cmap = colormaps.get_cmap(self.cmap)
cmap = get_cmap(self.cmap)

# normalize in [0, 1] range, as expected by cmap
prop_min, prop_max = self.cmap_range
Expand Down
4 changes: 2 additions & 2 deletions crystal_toolkit/renderables/structuregraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Sequence

import numpy as np
from matplotlib import colormaps
from matplotlib.pyplot import get_cmap
from pymatgen.analysis.graphs import StructureGraph
from pymatgen.core import PeriodicSite

Expand Down Expand Up @@ -132,7 +132,7 @@ def get_structure_graph_scene(
weights = np.array([w for w in weights if w])

if any(weights):
cmap = colormaps.get_cmap(edge_weight_color_scale)
cmap = get_cmap(edge_weight_color_scale)

# try to keep color scheme symmetric around 0
weight_max = max(*min(weights), *weights)
Expand Down
Loading

0 comments on commit f71521b

Please sign in to comment.