Skip to content

Commit

Permalink
fix(harmonic-oscillator): use ArrayLike instead of union of float and…
Browse files Browse the repository at this point in the history
… ndarray

#34
  • Loading branch information
emptymalei committed Apr 13, 2024
1 parent 57a2190 commit 01dc720
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hamilflow/models/harmonic_oscillator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy as np
import pandas as pd
from numpy.typing import ArrayLike
from pydantic import BaseModel, computed_field, field_validator


Expand Down Expand Up @@ -89,7 +90,7 @@ def definition(self) -> Dict[str, float]:
}

@abstractmethod
def _x(self, t: np.typing.ArrayLike) -> np.typing.ArrayLike:
def _x(self, t: ArrayLike) -> ArrayLike:
r"""Solution to simple harmonic oscillators."""
...

Expand Down Expand Up @@ -158,7 +159,7 @@ def __init__(
f"System is not a Simple Harmonic Oscillator: {self.system}"
)

def _x(self, t: np.typing.ArrayLike) -> np.typing.ArrayLike:
def _x(self, t: ArrayLike) -> ArrayLike:
r"""Solution to simple harmonic oscillators:
$$
Expand Down

0 comments on commit 01dc720

Please sign in to comment.