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

Upgrade some doc dependencies to allow build #50

Merged
merged 3 commits into from
Aug 27, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/pull-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9" ]
poetry-version: [ "1.2.1" ]
python-version: [ "3.11" ]
poetry-version: [ "1.8.3" ]
steps:
# ======
# Checkout, set up python
Expand Down
24 changes: 8 additions & 16 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,15 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
jobs:
post_create_environment:
- pip install poetry==1.2.1
- poetry config virtualenvs.create false
post_install:
- poetry install -E docs
python: "3.11"

python:
install:
- method: pip
path: .
extra_requirements:
- docs

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

## Optionally declare the Python requirements required to build your docs
#python:
# install:
# - requirements: docs/requirements.txt
23 changes: 12 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["poetry-core>=1.1.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "derivative"
version = "0.6.2"
Expand All @@ -16,30 +20,27 @@ readme = "README.rst"

[tool.poetry.dependencies]
python = "^3.9"
numpy = "^1.18.3"
numpy = ">=1.18.3"
scipy = "^1.4.1"
scikit-learn = "^1"
importlib-metadata = "^7.1.0"

# docs
sphinx = {version = "^5", optional = true}
nbsphinx = {version = "^0.6.1", optional = true}
ipykernel = {version = "^5.2.1", optional = true}
jupyter_client = {version = "^6.1.3", optional = true}
sphinx = {version = "7.2.6", optional = true}
nbsphinx = {version = "^0.9.5", optional = true}
matplotlib = {version = "^3.2.1", optional = true}
#pandoc = {version = "^2.2", optional = true}
ipython = {version = "^8.0.0, !=8.7.0, !=8.18.1", optional = true}
ipykernel = {version = "^6.0.0", optional = true}


# dev
asv = {version = "^0.6", optional = true}
pytest = {version = "^7", optional = true}
pytest = {version = ">=7", optional = true}

[tool.poetry.extras]
docs = ["sphinx", "nbsphinx", "ipykernel", "jupyter_client", "matplotlib", "pandoc"]
docs = ["sphinx", "nbsphinx", "matplotlib", "ipython", "ipykernel"]
dev = ["asv", "pytest"]

[build-system]
requires = ["poetry-core>=1.1.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.plugins.'derivative.hyperparam_opt']
"kalman.default" = "derivative.utils:_default_kalman"
7 changes: 6 additions & 1 deletion tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import numpy as np
import inspect

if int(np.__version__.split(".")[0]) == 1:
from numpy.polynomial.polyutils import RankWarning
else:
from numpy.exceptions import RankWarning

def test_register():
# Check that every class is registered in methods
class_list = inspect.getmembers(derivative.dlocal, inspect.isclass)\
Expand Down Expand Up @@ -89,7 +94,7 @@ def test_small():

# savitzky_golay - RankWarning: The fit may be poorly conditioned if order >= points in window
kwargs = {'left': 2, 'right': 2, 'iwindow': True, 'order': 2}
with pytest.warns(UserWarning): # numpy.RankWarning is of type UserWarning
with pytest.warns(RankWarning):
assert two.shape == dxdt(two, two, kind='savitzky_golay', **kwargs).shape
assert three.shape == dxdt(three, three, kind='savitzky_golay', **kwargs).shape

Expand Down
Loading