Skip to content

Commit

Permalink
Remove python 3.8 from CI (#2233)
Browse files Browse the repository at this point in the history
* Update test environments from 3.8 to 3.11

Remove 3.8 python and add 3.11. Move preview mode to 3.10.

* Use 3.10 in benchmarks

* Drop pystan 2 testing and update python to 3.10

* Update python env to 3.10

* Fix naming issue

* Update readthedocs python env to 3.10

* Update and rename .readthedocs.yml to .readthedocs.yaml

* fix typo

* fix rtd config

* Remove 3.11

* fix tsplot np.tile behaviour

* fix np.tile call

* fix pylint

* fix missing tile array change

---------

Co-authored-by: Oriol (ZBook) <oriol.abril.pla@gmail.com>
  • Loading branch information
ahartikainen and OriolAbril committed Apr 22, 2023
1 parent ea887cb commit 4631611
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 59 deletions.
12 changes: 4 additions & 8 deletions .azure-pipelines/azure-pipelines-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ jobs:
python.version: "3.10"
PyPIGithub: false
name: "Python 3.10"
Python_310_preview:
python.version: "3.10"
PyPIGithub: true
name: "Python 3.10"
Python_39:
python.version: "3.9"
PyPIGithub: false
name: "Python 3.9"
Python_39_preview:
python.version: "3.9"
PyPIGithub: true
name: "Python 3.9"
Python_38:
python.version: "3.8"
PyPIGithub: false
name: "Python 3.8"


steps:
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines/azure-pipelines-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jobs:
timeoutInMinutes: 360
strategy:
matrix:
Python_39:
python.version: "3.9"
name: "Python 3.9 - benchmarks"
Python_310:
python.version: "3.10"
name: "Python 3.10 - benchmarks"

steps:

Expand Down
26 changes: 5 additions & 21 deletions .azure-pipelines/azure-pipelines-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ jobs:
timeoutInMinutes: 360
strategy:
matrix:
Python_39_Latest:
python.version: "3.9"
pystan.version: "latest"
Python_310_Latest:
python.version: "3.10"
cmdstanpy.version: "latest"
emcee.version: "latest"
name: "External latest"

Python_39_Special_versions:
python.version: "3.9"
pystan.version: 2.19.1.1
Python_310_Special_versions:
python.version: "3.10"
cmdstanpy.version: "github"
emcee.version: 2
name: "External special"
Expand All @@ -46,16 +44,6 @@ jobs:
python -m pip --no-cache-dir install torch<2.0 --index-url https://download.pytorch.org/whl/cpu
if [ "$(pystan.version)" = "latest" ]; then
python -m pip --no-cache-dir install pystan
else
if [ "$(pystan.version)" = "latest" ]; then
python -m pip --no-cache-dir install pystan
else
python -m pip --no-cache-dir install pystan=="$(pystan.version)"
fi
fi
if [ "$(cmdstanpy.version)" = "latest" ]; then
python -m pip --no-cache-dir install cmdstanpy
else
Expand All @@ -72,7 +60,7 @@ jobs:
python -m pip --no-cache-dir install "emcee<3"
fi
grep -Ev '^pystan|^cmdstanpy|^emcee' requirements-external.txt | xargs python -m pip install
grep -Ev '^cmdstanpy|^emcee' requirements-external.txt | xargs python -m pip install
displayName: 'Install packages'
Expand All @@ -87,10 +75,6 @@ jobs:
python -m pip install .
displayName: 'Install ArviZ package'
- script: |
python -m pip install "setuptools>=48.0,<60" -U
displayName: 'Temporary httpstan setuptools fix 2022-11-29'
- script: |
python -m pip freeze
displayName: 'Print packages'
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines/azure-pipelines-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
timeoutInMinutes: 360
strategy:
matrix:
Python_39:
python.version: "3.9"
name: "Python 3.9 - wheel"
Python_310:
python.version: "3.10"
name: "Python 3.10 - wheel"

steps:

Expand Down
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.10"

sphinx:
configuration: doc/source/conf.py

python:
install:
- requirements: requirements.txt
- requirements: requirements-docs.txt
- method: pip
path: .
12 changes: 0 additions & 12 deletions .readthedocs.yml

This file was deleted.

4 changes: 1 addition & 3 deletions arviz/plots/backends/bokeh/lmplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def plot_lm(
y_model_mean_kwargs.setdefault("line_width", 2)

for i, ax_i in enumerate((item for item in axes.flatten() if item is not None)):

_, _, _, y_plotters = y[i]
_, _, _, x_plotters = x[i]
legend_it = []
Expand Down Expand Up @@ -124,9 +123,8 @@ def plot_lm(
if y_model is not None:
_, _, _, y_model_plotters = y_model[i]
if kind_model == "lines":

model_legend = ax_i.multi_line(
[np.tile(x_plotters, (num_samples, 1))],
[np.tile(np.array(x_plotters, dtype=object), (num_samples, 1))],
[np.transpose(y_model_plotters)],
**y_model_plot_kwargs,
)
Expand Down
30 changes: 21 additions & 9 deletions arviz/plots/tsplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def plot_ts(
length_plotters = len_x * len_y
# TODO: Incompatible types in assignment (expression has type "ndarray[Any, dtype[Any]]",
# TODO: variable has type "List[Any]") [assignment]
y_plotters = np.tile(y_plotters, (len_x, 1)) # type: ignore[assignment]
x_plotters = np.tile(x_plotters, (len_y, 1)) # type: ignore[assignment]
y_plotters = np.tile(np.array(y_plotters, dtype=object), (len_x, 1)) # type: ignore[assignment]
x_plotters = np.tile(np.array(x_plotters, dtype=object), (len_y, 1)) # type: ignore[assignment]

# Generate plotters for all the available data
y_mean_plotters = None
Expand Down Expand Up @@ -317,8 +317,12 @@ def plot_ts(
# If there are multiple x and multidimensional y, we need total of len(x)*len(y) graphs
# TODO: Incompatible types in assignment (expression has type "ndarray[Any, dtype[Any]]",
# TODO: variable has type "List[Any]") [assignment]
y_hat_plotters = np.tile(y_hat_plotters, (len_x, 1)) # type: ignore[assignment]
y_mean_plotters = np.tile(y_mean_plotters, (len_x, 1)) # type: ignore[assignment]
y_hat_plotters = np.tile(
np.array(y_hat_plotters, dtype=object), (len_x, 1)
) # type: ignore[assignment]
y_mean_plotters = np.tile(
np.array(y_mean_plotters, dtype=object), (len_x, 1)
) # type: ignore[assignment]

y_holdout_plotters = None
x_holdout_plotters = None
Expand All @@ -344,8 +348,12 @@ def plot_ts(
# If there are multiple x and multidimensional y, we need total of len(x)*len(y) graphs
# TODO: Incompatible types in assignment (expression has type "ndarray[Any, dtype[Any]]",
# TODO: variable has type "List[Any]") [assignment]
y_holdout_plotters = np.tile(y_holdout_plotters, (len_x, 1)) # type: ignore[assignment]
x_holdout_plotters = np.tile(x_holdout_plotters, (len_y, 1)) # type: ignore[assignment]
y_holdout_plotters = np.tile(
np.array(y_holdout_plotters, dtype=object), (len_x, 1)
) # type: ignore[assignment]
x_holdout_plotters = np.tile(
np.array(x_holdout_plotters, dtype=object), (len_y, 1)
) # type: ignore[assignment]

y_forecasts_plotters = None
y_forecasts_mean_plotters = None
Expand Down Expand Up @@ -386,10 +394,14 @@ def plot_ts(
# TODO: Incompatible types in assignment (expression has type "ndarray[Any, dtype[Any]]",
# TODO: variable has type "List[Any]") [assignment]
y_forecasts_mean_plotters = np.tile(
y_forecasts_mean_plotters, (len_x, 1)
np.array(y_forecasts_mean_plotters, dtype=object), (len_x, 1)
) # type: ignore[assignment]
y_forecasts_plotters = np.tile(
np.array(y_forecasts_plotters, dtype=object), (len_x, 1)
) # type: ignore[assignment]
x_holdout_plotters = np.tile(
np.array(x_holdout_plotters, dtype=object), (len_y, 1)
) # type: ignore[assignment]
y_forecasts_plotters = np.tile(y_forecasts_plotters, (len_x, 1)) # type: ignore[assignment]
x_holdout_plotters = np.tile(x_holdout_plotters, (len_y, 1)) # type: ignore[assignment]

rows, cols = default_grid(length_plotters)

Expand Down

0 comments on commit 4631611

Please sign in to comment.