You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/v2/migration-guide.rst
+26-9Lines changed: 26 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,10 @@ Create a Herbie Object
83
83
84
84
from herbie.v2 import Herbie
85
85
86
-
H = Herbie.HRRR("2025-01-01", step=12)
86
+
H = Herbie.HRRR(
87
+
"2025-01-01",
88
+
step=12
89
+
)
87
90
88
91
----
89
92
@@ -112,7 +115,10 @@ The ``fxx`` parameter has been renamed to ``step``.
112
115
113
116
from datetime import timedelta
114
117
115
-
H = HRRR("2025-01-01", step=timedelta(hours=6))
118
+
H = HRRR(
119
+
"2025-01-01",
120
+
step=timedelta(hours=6)
121
+
)
116
122
117
123
----
118
124
@@ -129,8 +135,14 @@ Inventories are now **Polars DataFrames**, which support fast expression-based f
129
135
130
136
H.inventory("TMP:2 m")
131
137
138
+
.. code-block:: python
139
+
140
+
H.inventory(r"TMP:/d+ mb")
141
+
132
142
.. grid-item-card:: v2
133
143
144
+
Same regex search strings work from v1, but you may also use Polars expressions to filter the inventory enabling more flexible filtering.
145
+
134
146
.. code-block:: python
135
147
136
148
inv = H.inventory()
@@ -139,11 +151,15 @@ Inventories are now **Polars DataFrames**, which support fast expression-based f
139
151
pl.col("variable") =="TMP"
140
152
)
141
153
142
-
Benefits:
154
+
inv.filter(
155
+
[
156
+
pl.col("variable") =="TMP",
157
+
pl.col("level").str.ends_with("mb"),
158
+
]
159
+
160
+
)
143
161
144
-
- Faster performance
145
-
- Flexible filtering
146
-
- Access to source metadata
162
+
The dataframe also includes the source path to the index file, which make the new FastHerbie features possible.
147
163
148
164
----
149
165
@@ -200,18 +216,19 @@ Checking Data Availability
200
216
201
217
.. grid-item-card:: v1
202
218
203
-
Source checking was mostly implicit.
219
+
Source checking was mostly implicit. File existence was checked when the Herbie object was created.
204
220
205
221
.. grid-item-card:: v2
206
222
207
-
You can explicitly resolve sources:
223
+
Herbie only checks for file existence when you ask to retrieve data (i.e., using the inventory, download, or xarray methods). You may also explicitly resolve sources to inspect them yourself:
0 commit comments