File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
from pathlib import Path
3
- import warnings
4
3
from datetime import datetime
5
4
from copy import deepcopy
6
5
from typing import (
16
15
TYPE_CHECKING ,
17
16
Callable ,
18
17
)
18
+ from warnings import deprecated
19
19
20
20
21
21
import numpy as np
@@ -97,6 +97,22 @@ class Dataset:
97
97
98
98
"""
99
99
100
+ @overload
101
+ @deprecated (
102
+ "Supplying data as a list of numpy arrays is deprecated. Use Dataset.from_numpy instead"
103
+ )
104
+ def __init__ (
105
+ self ,
106
+ data : (Sequence [NDArray [np .floating ]]),
107
+ time : pd .DatetimeIndex | None = None ,
108
+ items : Sequence [ItemInfo ] | None = None ,
109
+ geometry : Any = None ,
110
+ zn : NDArray [np .floating ] | None = None ,
111
+ dims : tuple [str , ...] | None = None ,
112
+ validate : bool = True ,
113
+ dt : float = 1.0 ,
114
+ ): ...
115
+
100
116
def __init__ (
101
117
self ,
102
118
data : (
@@ -113,10 +129,6 @@ def __init__(
113
129
dt : float = 1.0 ,
114
130
):
115
131
if not self ._is_DataArrays (data ):
116
- warnings .warn (
117
- "Supplying data as a list of numpy arrays is deprecated. Use Dataset.from_numpy" ,
118
- FutureWarning ,
119
- )
120
132
data = self ._create_dataarrays (
121
133
data = data ,
122
134
time = time ,
Original file line number Diff line number Diff line change 11
11
from shutil import copyfile
12
12
from collections .abc import Iterable , Sequence
13
13
from typing import Callable , Union
14
- import warnings
14
+ from warnings import deprecated
15
15
16
16
17
17
import numpy as np
@@ -329,14 +329,13 @@ def _process_dfs_files(
329
329
330
330
331
331
# TODO sum is conflicting with the built-in sum function, which we could haved used above.
332
+ @deprecated ("Use add instead." )
332
333
def sum (
333
334
infilename_a : str | pathlib .Path ,
334
335
infilename_b : str | pathlib .Path ,
335
336
outfilename : str | pathlib .Path ,
336
337
) -> None :
337
338
"""Sum two dfs files (a+b)."""
338
- # deprecated
339
- warnings .warn (FutureWarning ("This function is deprecated. Use add instead." ))
340
339
_process_dfs_files (infilename_a , infilename_b , outfilename , operator .add )
341
340
342
341
You can’t perform that action at this time.
0 commit comments