Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lsbardel committed Jan 28, 2024
1 parent efe9a17 commit ea178e8
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 6 deletions.
50 changes: 49 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ scipy = "^1.10.1"
pandas = "^2.0.1"
aiohttp = {version = "^3.8.1", optional = true}
pydantic = "^2.0.2"
pyarrow = "^15.0.0"

[tool.poetry.group.dev.dependencies]
black = "^24.1.1"
Expand Down Expand Up @@ -55,6 +56,9 @@ asyncio_mode = "auto"
testpaths = [
"quantflow_tests"
]
filterwarnings = [
"ignore::DeprecationWarning:dateutil.*:"
]

[tool.isort]
profile = "black"
Expand Down
2 changes: 1 addition & 1 deletion quantflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Quantitative analysis and pricing"""

__version__ = "0.2.4"
__version__ = "0.2.5"
2 changes: 1 addition & 1 deletion quantflow/sp/poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def cdf_from_characteristic(
)
f[0] = c[0].real # type: ignore[index]
if simpson_rule:
result.append(a * simpson(f, frequency))
result.append(a * simpson(f, x=frequency))
else:
result.append(a * np.trapz(f, frequency))
pdf = np.maximum(np.diff(result, prepend=0), 0)
Expand Down
2 changes: 1 addition & 1 deletion quantflow/utils/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def utcnow() -> datetime:
return datetime.utcnow().replace(tzinfo=timezone.utc)
return datetime.now(timezone.utc)


def isoformat(date: str | date) -> str:
Expand Down
5 changes: 3 additions & 2 deletions quantflow/utils/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pandas as pd
from numpy.random import normal
from pydantic import BaseModel, Field
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid

from . import plot
from .bins import pdf as bins_pdf
Expand Down Expand Up @@ -68,7 +68,8 @@ def var(self) -> FloatArray:
def integrate(self) -> Paths:
"""Integrate paths"""
return self.__class__(
t=self.t, data=cumtrapz(self.data, dx=self.dt, axis=0, initial=0)
t=self.t,
data=cumulative_trapezoid(self.data, dx=self.dt, axis=0, initial=0),
)

def cross_section(self, t: float | None = None) -> FloatArray:
Expand Down

0 comments on commit ea178e8

Please sign in to comment.