Skip to content

Commit

Permalink
Testing doc building
Browse files Browse the repository at this point in the history
  • Loading branch information
PietropaoloFrisoni committed May 31, 2024
1 parent 2a36a35 commit 645916e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,semantic_version,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag
extension-pkg-whitelist=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag

[TYPECHECK]

# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,semantic_version,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag,math,pennylane.numpy
ignored-modules=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag,math,pennylane.numpy

# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set). This supports can work
# with qualified names.
ignored-classes=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,semantic_version,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag,math,pennylane.numpy,pennylane.numpy.random,pennylane.numpy.linalg,pennylane.numpy.builtins,pennylane.operation,rustworkx,kahypar
ignored-classes=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag,math,pennylane.numpy,pennylane.numpy.random,pennylane.numpy.linalg,pennylane.numpy.builtins,pennylane.operation,rustworkx,kahypar

[MESSAGES CONTROL]

Expand Down
1 change: 0 additions & 1 deletion doc/development/guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ be installed alongside PennyLane:
* `autograd <https://github.com/HIPS/autograd>`_
* `toml <https://github.com/uiri/toml>`_
* `appdirs <https://github.com/ActiveState/appdirs>`_
* `semantic-version <https://github.com/rbarrois/python-semanticversion>`_ >= 2.7
* `autoray <https://github.com/jcmgray/autoray>`__ >= 0.6.11
* `packaging <https://github.com/pypa/packaging>`_

Expand Down
5 changes: 3 additions & 2 deletions pennylane/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

import numpy as _np

from semantic_version import SimpleSpec, Version
from packaging.specifiers import SpecifierSet
from packaging.version import Version

from pennylane.boolean_fn import BooleanFn
import pennylane.numpy
Expand Down Expand Up @@ -387,7 +388,7 @@ def run_cnot():

if hasattr(plugin_device_class, "pennylane_requires") and Version(
version()
) not in SimpleSpec(plugin_device_class.pennylane_requires):
) not in SpecifierSet(f"=={plugin_device_class.pennylane_requires}"):
raise DeviceError(
f"The {name} plugin requires PennyLane versions {plugin_device_class.pennylane_requires}, "
f"however PennyLane version {__version__} is installed."
Expand Down
6 changes: 3 additions & 3 deletions pennylane/numpy/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
This package provides a wrapped version of autograd.numpy.random, such that
it works with the PennyLane :class:`~.tensor` class.
"""
import semantic_version
from autograd.numpy import random as _random
from numpy import __version__ as np_version
from numpy.random import MT19937, PCG64, SFC64, Philox # pylint: disable=unused-import
from packaging.specifiers import SpecifierSet
from packaging.version import Version

from .wrapper import tensor_wrapper, wrap_arrays

wrap_arrays(_random.__dict__, globals())


np_version_spec = semantic_version.SimpleSpec(">=0.17.0")
if np_version_spec.match(semantic_version.Version(np_version)):
if Version(np_version) in SpecifierSet(">=0.17.0"):
# pylint: disable=too-few-public-methods
# pylint: disable=missing-class-docstring
class Generator(_random.Generator):
Expand Down
1 change: 0 additions & 1 deletion requirements-ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ rustworkx
autograd
toml
appdirs
semantic_version
packaging
autoray>=0.6.1,<0.6.10
matplotlib
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ rustworkx~=0.12.1
autograd~=1.4
toml~=0.10
appdirs~=1.4
semantic_version~=2.10
packaging
autoray>=0.6.11
matplotlib~=3.5
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"autograd",
"toml",
"appdirs",
"semantic-version>=2.7",
"autoray>=0.6.11",
"cachetools",
"pennylane-lightning>=0.36",
Expand Down
6 changes: 3 additions & 3 deletions tests/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,semantic_version,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag
extension-pkg-whitelist=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag

[TYPECHECK]

# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,semantic_version,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag,math,pennylane.numpy
ignored-modules=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag,math,pennylane.numpy

# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set). This supports can work
# with qualified names.
ignored-classes=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,semantic_version,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag,math,pennylane.numpy,pennylane.numpy.random,pennylane.numpy.linalg,pennylane.numpy.builtins,pennylane.operation,rustworkx,kahypar
ignored-classes=numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.numpy.linalg,autograd.numpy.builtins,packaging,torch,tensorflow,tensorflow.contrib,tensorflow.contrib.eager,LazyLoader,networkx,networkx.dag,math,pennylane.numpy,pennylane.numpy.random,pennylane.numpy.linalg,pennylane.numpy.builtins,pennylane.operation,rustworkx,kahypar

[MESSAGES CONTROL]

Expand Down

0 comments on commit 645916e

Please sign in to comment.