Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/holoviz/holoviews into fi…
Browse files Browse the repository at this point in the history
…x/hist-error-message
  • Loading branch information
MarcSkovMadsen committed Dec 3, 2022
2 parents c11d4d2 + 0317237 commit 935f855
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.9', '3.11']
timeout-minutes: 90
defaults:
run:
Expand Down
4 changes: 3 additions & 1 deletion holoviews/core/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,9 @@ def id_offset(cls):
"""
max_ids = []
for backend in Store.renderers.keys():
store_ids = Store.custom_options(backend=backend).keys()
# Ensure store_ids is immediately cast to list to avoid a
# race condition (#5533)
store_ids = list(Store.custom_options(backend=backend).keys())
max_id = max(store_ids)+1 if len(store_ids) > 0 else 0
max_ids.append(max_id)
# If no backends defined (e.g. plotting not imported) return zero
Expand Down
5 changes: 2 additions & 3 deletions holoviews/core/spaces.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import itertools
import types
import inspect

from numbers import Number
from itertools import groupby
Expand Down Expand Up @@ -511,7 +510,7 @@ def argspec(self):
@property
def noargs(self):
"Returns True if the callable takes no arguments"
noargs = inspect.ArgSpec(args=[], varargs=None, keywords=None, defaults=None)
noargs = util.ArgSpec(args=[], varargs=None, keywords=None, defaults=None)
return self.argspec == noargs


Expand Down Expand Up @@ -611,7 +610,7 @@ class Generator(Callable):

@property
def argspec(self):
return inspect.ArgSpec(args=[], varargs=None, keywords=None, defaults=None)
return util.ArgSpec(args=[], varargs=None, keywords=None, defaults=None)

def __call__(self):
try:
Expand Down
11 changes: 6 additions & 5 deletions holoviews/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import datetime as dt

from collections.abc import Iterable # noqa
from collections import defaultdict, OrderedDict # noqa (compatibility)
from collections import defaultdict, OrderedDict, namedtuple # noqa (compatibility)
from contextlib import contextmanager
from packaging.version import Version as LooseVersion
from functools import partial
Expand Down Expand Up @@ -42,6 +42,9 @@

anonymous_dimension_label = '_'

# Argspec was removed in Python 3.11
ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')

_NP_SIZE_LARGE = 1_000_000
_NP_SAMPLE_SIZE = 1_000_000
_PANDAS_ROWS_LARGE = 1_000_000
Expand Down Expand Up @@ -419,10 +422,8 @@ def argspec(callable_obj):
else:
raise ValueError("Cannot determine argspec for non-callable type.")

return inspect.ArgSpec(args=args,
varargs=spec.varargs,
keywords=get_keywords(spec),
defaults=spec.defaults)
keywords = get_keywords(spec)
return ArgSpec(args=args, varargs=spec.varargs, keywords=keywords, defaults=spec.defaults)


def validate_dynamic_argspec(callback, kdims, streams):
Expand Down
9 changes: 9 additions & 0 deletions holoviews/tests/plotting/plotly/test_distributionplot.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
from unittest import SkipTest

from holoviews.element import Distribution

from .test_plot import TestPlotlyPlot


class TestDistributionPlot(TestPlotlyPlot):

def setUp(self):
super().setUp()
try:
import scipy # noqa
except ImportError:
raise SkipTest("Test requires scipy")

def test_distribution_filled(self):
dist = Distribution([1, 1.1, 2.1, 3, 2, 1, 2.2])
state = self._get_plot_state(dist)
Expand Down
21 changes: 17 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
'plotly >=4.0',
'dash >=1.16',
'codecov',
'ipython >=5.4.0',
# Issues with comm (see https://github.com/ipython/ipykernel/issues/1026)
'ipykernel <6.18.0',
]

# Optional tests dependencies, i.e. one should be able
Expand All @@ -46,18 +49,22 @@
extras_require['tests'] = extras_require['tests_core'] + [
'dask',
'ibis-framework', # Mapped to ibis-sqlite in setup.cfg for conda
'spatialpandas',
'xarray >=0.10.4',
'networkx',
'datashader >=0.11.1',
'shapely',
'ffmpeg',
'cftime',
'scipy',
'selenium',
'ipython >=5.4.0',
]

# Packages not working on python 3.11 becauase of numba
if sys.version_info < (3, 11):
extras_require['tests'] += [
'spatialpandas',
'datashader >=0.11.1',
]

extras_require['tests_gpu'] = extras_require['tests'] + [
'cudf',
]
Expand All @@ -83,7 +90,6 @@
"plotly >=4.0",
'dash >=1.16',
"streamz >=0.5.0",
"datashader >=0.11.1",
"ffmpeg",
"cftime",
"netcdf4",
Expand All @@ -94,6 +100,12 @@
"pyarrow",
]

if sys.version_info < (3, 11):
extras_require["examples"] += [
"datashader >=0.11.1",
]


extras_require["examples_tests"] = extras_require["examples"] + extras_require['tests_nb']

# Extra third-party libraries
Expand Down Expand Up @@ -175,6 +187,7 @@ def get_setup_version(reponame):
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[tox]
# python version test group extra envs extra commands
envlist = {py37,py38,py39,py310}-{flakes,unit,examples,all_recommended}-{default}-{dev,pkg}
envlist = {py37,py38,py39,py310,py311}-{flakes,unit,examples,all_recommended}-{default}-{dev,pkg}

[_flakes]
description = Flake check python
Expand Down

0 comments on commit 935f855

Please sign in to comment.