Skip to content

Commit

Permalink
bump Gh action versions
Browse files Browse the repository at this point in the history
actions/checkout@v2->3
github/codeql-action/init@v1->2
github/codeql-action/autobuild@v1->2
github/codeql-action/analyze@v1->2
  • Loading branch information
janosh committed May 2, 2023
1 parent 2d87ecb commit bf7aedd
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 63 deletions.
77 changes: 38 additions & 39 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,47 @@ on:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 13 * * 3' # run at 13:00 every Wednesday
- cron: "0 13 * * 3" # run at 13:00 every Wednesday

jobs:
CodeQL-Build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: github.event_name == 'pull_request'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: github.event_name == 'pull_request'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
16 changes: 7 additions & 9 deletions crystal_toolkit/components/phonon.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,13 @@ def get_ph_dos_traces(dos: CompletePhononDos, freq_range: tuple[float, float]):
def get_figure(
ph_bs: PhononBandStructureSymmLine | None = None,
ph_dos: CompletePhononDos | None = None,
freq_range: tuple[float, float] | tuple[None, None] = (None, None),
freq_range: tuple[float | None, float | None] = (None, None),
) -> go.Figure:
y_range = list(freq_range)

if freq_range[0] is None:
y_range[0] = np.min(ph_bs.bands) * 1.05
freq_range = (np.min(ph_bs.bands) * 1.05, freq_range[1])

if freq_range[1] is None:
y_range[1] = np.max(ph_bs.bands) * 1.05
freq_range = (freq_range[0], np.max(ph_bs.bands) * 1.05)

if (not ph_dos) and (not ph_bs):
empty_plot_style = {
Expand All @@ -457,12 +455,12 @@ def get_figure(
bs_traces,
bs_data,
) = PhononBandstructureAndDosComponent.get_ph_bandstructure_traces(
ph_bs, freq_range=y_range
ph_bs, freq_range=freq_range
)

if ph_dos:
dos_traces = PhononBandstructureAndDosComponent.get_ph_dos_traces(
ph_dos, freq_range=y_range
ph_dos, freq_range=freq_range
)

# TODO: add logic to handle if bs_traces and/or dos_traces not present
Expand Down Expand Up @@ -503,7 +501,7 @@ def get_figure(
yaxis_style = dict(
**in_common_axis_styles,
mirror="ticks",
range=y_range,
range=freq_range,
title=dict(text="Frequency (THz)", font=dict(size=16)),
zeroline=True,
zerolinecolor="white",
Expand All @@ -526,7 +524,7 @@ def get_figure(
showticklabels=False,
mirror="ticks",
zerolinewidth=2,
range=y_range,
range=freq_range,
zerolinecolor="white",
matches="y",
anchor="x2",
Expand Down
28 changes: 14 additions & 14 deletions crystal_toolkit/components/pourbaix.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class PourbaixDiagramComponent(MPComponent):
#
# if not heatmap_as_contour:
# # Plotly needs a list here for validation
# hmap = go.Heatmap(
# h_map = go.Heatmap(
# x=list(ph_range),
# y=list(v_range),
# z=decomposition_e,
Expand All @@ -176,11 +176,11 @@ class PourbaixDiagramComponent(MPComponent):
# zmin=0,
# zmax=1,
# )
# data.append(hmap)
# data.append(h_map)
#
# else:
#
# hmap = go.Contour(
# h_map = go.Contour(
# z=decomposition_e,
# x=list(ph_range),
# y=list(v_range),
Expand All @@ -193,18 +193,18 @@ class PourbaixDiagramComponent(MPComponent):
# contours_coloring="heatmap",
# text=hovertexts,
# )
# data.insert(0, hmap)
# data.insert(0, h_map)
#
# shapes = []
# xydata = []
# xy_data = []
# labels = []
#
# for entry, vertices in pourbaix_diagram._stable_domain_vertices.items():
# formula = entry.name
# clean_formula = PourbaixDiagramComponent.clean_formula(formula)
#
# # Generate annotation
# xydata.append(np.average(vertices, axis=0))
# xy_data.append(np.average(vertices, axis=0))
# labels.append(clean_formula)
#
# # Info on SVG paths: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
Expand Down Expand Up @@ -262,11 +262,11 @@ class PourbaixDiagramComponent(MPComponent):
# "y": y,
# "yref": "y",
# }
# for (x, y), label in zip(xydata, labels)
# for (x, y), label in zip(xy_data, labels)
# ]
# layout.update({"annotations": annotations})
# else:
# x, y = zip(*xydata)
# x, y = zip(*xy_data)
# data.append(
# go.Scatter(x=x, y=y, text=labels, hoverinfo="text", mode="markers")
# )
Expand All @@ -292,7 +292,7 @@ def get_figure(
data = []

shapes = []
xydata = []
xy_data = []
labels = []
domain_heights = []

Expand All @@ -309,7 +309,7 @@ def get_figure(

# Ensure label is within plot area
# TODO: remove hard-coded value here and make sure it's set dynamically
xydata.append([centroid.x, centroid.y])
xy_data.append([centroid.x, centroid.y])
labels.append(clean_formula)
domain_heights.append(height)

Expand Down Expand Up @@ -389,7 +389,7 @@ def get_figure(
layout.update({"shapes": shapes})

if heatmap_entry is None:
x, y = zip(*xydata)
x, y = zip(*xy_data)
data.append(
go.Scatter(
x=x, y=y, text=labels, hoverinfo="text", mode="text", name="Labels"
Expand Down Expand Up @@ -437,7 +437,7 @@ def get_text_size(available_vertical_space):
"y": y,
"yref": "y",
}
for (x, y), label, height in zip(xydata, labels, domain_heights)
for (x, y), label, height in zip(xy_data, labels, domain_heights)
]
layout.update({"annotations": annotations})

Expand Down Expand Up @@ -473,7 +473,7 @@ def get_text_size(available_vertical_space):
Composition(heatmap_entry.composition).reduced_formula
)

hmap = go.Contour(
h_map = go.Contour(
z=decomposition_e,
x=list(ph_range),
y=list(v_range),
Expand All @@ -492,7 +492,7 @@ def get_text_size(available_vertical_space):
name=f"{heatmap_formula} ({heatmap_entry.entry_id}) Heatmap",
showlegend=True,
)
data.append(hmap)
data.append(h_map)

if show_water_lines:
ph_range = [-2, 16]
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab-extension/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
Expand Down

0 comments on commit bf7aedd

Please sign in to comment.