diff --git a/pyproject.toml b/pyproject.toml index 9b9440e7..63376d8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ "Operating System :: OS Independent", ] dependencies = [ - "numpy>=1.20, <2.0", + "numpy>=1.20", "scipy", "xarray", "autograd", diff --git a/tests/test_integration.py b/tests/test_integration.py index 739956d0..60618864 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -301,7 +301,7 @@ def test_p_controller_resonant_wave(self, scale_x_opt=1e-3, scale_obj=1e-1, optim_options={'ftol': 1e-10}, - bounds_opt=((-1*np.infty, 0),), + bounds_opt=((-1*np.inf, 0),), ) power_sol = -1*res[0]['fun'] diff --git a/wecopttool/core.py b/wecopttool/core.py index 40ca2a1b..8c10a2d3 100644 --- a/wecopttool/core.py +++ b/wecopttool/core.py @@ -58,7 +58,7 @@ from typing import Iterable, Callable, Any, Optional, Mapping, TypeVar, Union from pathlib import Path import warnings -from datetime import datetime +import datetime from numpy.typing import ArrayLike import autograd.numpy as np @@ -80,7 +80,7 @@ warnings.filterwarnings("ignore", message=filter_msg) # default values -_default_parameters = {'rho': 1025.0, 'g': 9.81, 'depth': np.infty} +_default_parameters = {'rho': 1025.0, 'g': 9.81, 'depth': np.inf} _default_min_damping = 1e-6 # type aliases @@ -895,7 +895,7 @@ def post_process(self, "post-process and be passed as an input.") def _postproc(res, waves, nsubsteps): - create_time = f"{datetime.utcnow()}" + create_time = f"{datetime.datetime.now(datetime.UTC)}" omega_vals = np.concatenate([[0], waves.omega.values]) freq_vals = np.concatenate([[0], waves.freq.values]) @@ -1060,7 +1060,7 @@ def omega(self) -> ndarray: @property def period(self) -> ndarray: """Period vector [s].""" - return np.concatenate([[np.Infinity], 1/self._freq[1:]]) + return np.concatenate([[np.inf], 1/self._freq[1:]]) @property def w1(self) -> float: @@ -2109,7 +2109,7 @@ def standard_forces(hydro_data: Dataset) -> TForceDict: def run_bem( fb: cpy.FloatingBody, - freq: Iterable[float] = [np.infty], + freq: Iterable[float] = [np.inf], wave_dirs: Iterable[float] = [0], rho: float = _default_parameters['rho'], g: float = _default_parameters['g'], diff --git a/wecopttool/pto.py b/wecopttool/pto.py index 7ff85db5..050f42ff 100644 --- a/wecopttool/pto.py +++ b/wecopttool/pto.py @@ -34,7 +34,7 @@ from scipy.linalg import block_diag from scipy.optimize import OptimizeResult from xarray import DataArray, Dataset -from datetime import datetime +import datetime from scipy.optimize import OptimizeResult from wecopttool.core import complex_to_real, td_to_fd @@ -707,7 +707,7 @@ def post_process(self, """ def _postproc(wec, res, waves, nsubsteps): - create_time = f"{datetime.utcnow()}" + create_time = f"{datetime.datetime.now(datetime.UTC)}" x_wec, x_opt = wec.decompose_state(res.x)