Skip to content

Commit a646aec

Browse files
authored
Merge branch 'main' into fix_cov
2 parents c75bbb3 + 09423e8 commit a646aec

File tree

8 files changed

+20
-9
lines changed

8 files changed

+20
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
libhdf5-serial-dev
4545
4646
- name: Install Python dependencies
47-
run: pip install -r requirements_dev.txt
47+
run: pip install -r requirements_dev.txt -r requirements_upsetplot.txt
4848

4949
- name: Run tox
5050
run: python -m tox

.readthedocs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ python:
1717
path: .
1818
extra_requirements:
1919
- doc
20+
# keep until upsetplot can be installed from pypi
21+
- requirements: requirements_upsetplot.txt
2022

2123
build:
2224
os: "ubuntu-22.04"

doc/analysis.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ Model hashes are special objects in the library, that are generated from model-s
1717

1818
This means you can reconstruct the model given some model hash. For example, with this model hash `M1-000`, you can reconstruct the :class:`petab_select.ModelHash` from a string, then reconstruct the :class:`petab_select.Model`.
1919

20-
.. code-block:: language
20+
.. code-block:: python
2121
2222
ModelHash.from_hash("M1-000").get_model(petab_select_problem)
2323
2424
You can use this to get the uncalibrated version of a calibrated model.
2525

26-
.. code-block:: language
26+
.. code-block:: python
2727
2828
model.hash.get_model(petab_select_problem)

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2121

2222
extensions = [
23-
"readthedocs_ext.readthedocs",
2423
"sphinx.ext.napoleon",
2524
"sphinx.ext.autodoc",
2625
"sphinx.ext.intersphinx",

petab_select/analyze.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ def get_best_by_iteration(
142142
*args,
143143
**kwargs,
144144
) -> dict[int, Models]:
145-
"""Get the best model of each iteration.
145+
r"""Get the best model of each iteration.
146146
147147
See :func:``get_best`` for additional required arguments.
148148
149149
Args:
150150
models:
151151
The models.
152-
*args, **kwargs:
152+
*args, \**kwargs:
153153
Forwarded to :func:``get_best``.
154154
155155
Returns:

petab_select/plot.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
import matplotlib.ticker
1616
import networkx as nx
1717
import numpy as np
18-
import upsetplot
18+
19+
try:
20+
import upsetplot
21+
except ImportError:
22+
upsetplot = None
1923

2024
from . import analyze
2125
from .constants import Criterion
@@ -218,6 +222,11 @@ def upset(plot_data: PlotData) -> dict[str, matplotlib.axes.Axes | None]:
218222
The plot axes (see documentation from the
219223
`upsetplot <https://upsetplot.readthedocs.io/>`__ package).
220224
"""
225+
if upsetplot is None:
226+
raise ImportError(
227+
"Please install upsetplot, e.g. with the following command: "
228+
"pip install git+https://github.com/jnothman/UpSetPlot.git@08f0648368122303075cbb2835ae7fea0f7f07df"
229+
)
221230
# Get delta criterion values
222231
values = np.array(
223232
plot_data.models.get_criterion(

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ dependencies = [
2929
[project.optional-dependencies]
3030
plot = [
3131
"matplotlib>=2.2.3",
32-
"upsetplot",
32+
# disabled with a manual install message until https://github.com/jnothman/UpSetPlot/issues/303
33+
# "upsetplot",
3334
]
3435
test = [
3536
"pytest >= 5.4.3",
@@ -50,7 +51,6 @@ doc = [
5051
"nbconvert>=7.16.4",
5152
"ipykernel>= 6.23.1",
5253
"ipython>=7.21.0",
53-
"readthedocs-sphinx-ext>=2.2.5",
5454
"sphinx-autodoc-typehints",
5555
"petab_select[plot]",
5656
]

requirements_upsetplot.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git+https://github.com/jnothman/UpSetPlot.git@08f0648368122303075cbb2835ae7fea0f7f07df

0 commit comments

Comments
 (0)