Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Matplotlib warning when building docs (backport #820) #822

Merged
merged 4 commits into from
Feb 27, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/docs_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel tox
pip install -U virtualenv setuptools wheel 'tox<4'
sudo apt-get install graphviz pandoc
- name: Build and publish
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U virtualenv setuptools wheel tox
pip install -U virtualenv setuptools wheel 'tox<4'
sudo apt-get install graphviz pandoc
- name: Build and publish
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
profile: minimal
default: true
- name: 'Install dependencies'
run: python -m pip install --upgrade tox
run: python -m pip install --upgrade 'tox<4'
- name: 'Install binary dependencies'
run: sudo apt-get install -y graphviz
if: runner.os == 'Linux'
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
profile: minimal
default: true
- name: 'Install dependencies'
run: python -m pip install --upgrade tox
run: python -m pip install --upgrade 'tox<4'
- name: 'Install binary dependencies'
run: sudo apt-get install -y graphviz
if: runner.os == 'Linux'
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
- name: Install binary deps
run: sudo apt-get install -y graphviz
- name: Install deps
run: pip install -U tox
run: pip install -U 'tox<4'
- name: Build Docs
run: tox -edocs
- uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.56.1"
2 changes: 1 addition & 1 deletion docs/source/tutorial/betweenness_centrality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Alternatively, you can use :func:`~rustworkx.visualization.graphviz_draw`:
graph[node] = btw

# Leverage matplotlib for color map
colormap = matplotlib.cm.get_cmap("magma")
colormap = matplotlib.colormaps["magma"]
norm = matplotlib.colors.Normalize(
vmin=min(centrality.values()),
vmax=max(centrality.values())
Expand Down
6 changes: 3 additions & 3 deletions src/digraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2688,14 +2688,14 @@ impl PyDiGraph {
}

fn __getitem__(&self, idx: usize) -> PyResult<&PyObject> {
match self.graph.node_weight(NodeIndex::new(idx as usize)) {
match self.graph.node_weight(NodeIndex::new(idx)) {
Some(data) => Ok(data),
None => Err(PyIndexError::new_err("No node found for index")),
}
}

fn __setitem__(&mut self, idx: usize, value: PyObject) -> PyResult<()> {
let data = match self.graph.node_weight_mut(NodeIndex::new(idx as usize)) {
let data = match self.graph.node_weight_mut(NodeIndex::new(idx)) {
Some(node_data) => node_data,
None => return Err(PyIndexError::new_err("No node found for index")),
};
Expand All @@ -2704,7 +2704,7 @@ impl PyDiGraph {
}

fn __delitem__(&mut self, idx: usize) -> PyResult<()> {
match self.graph.remove_node(NodeIndex::new(idx as usize)) {
match self.graph.remove_node(NodeIndex::new(idx)) {
Some(_) => Ok(()),
None => Err(PyIndexError::new_err("No node found for index")),
}
Expand Down
2 changes: 1 addition & 1 deletion src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ impl PyGraph {
}

fn __delitem__(&mut self, idx: usize) -> PyResult<()> {
match self.graph.remove_node(NodeIndex::new(idx as usize)) {
match self.graph.remove_node(NodeIndex::new(idx)) {
Some(_) => Ok(()),
None => Err(PyIndexError::new_err("No node found for index")),
}
Expand Down