File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -412,4 +412,11 @@ function sort_by_creation_time(files)
412
412
return sort (files, by = x -> stat (x). ctime)
413
413
end
414
414
415
+ """
416
+ unwrap(x::Val{N})
417
+
418
+ Unwrap the value in `Val{N}` to get `N`.
419
+ """
420
+ unwrap (x:: Val{N} ) where {N} = N
421
+
415
422
end
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import ClimaUtilities.Utils:
12
12
bounding_dates,
13
13
period_to_seconds_float,
14
14
unique_periods,
15
- sort_by_creation_time
15
+ sort_by_creation_time,
16
+ unwrap
16
17
17
18
@testset " searchsortednearest" begin
18
19
A = 10 * collect (range (1 , 10 ))
170
171
sorted_files = sort_by_creation_time (files)
171
172
@test sorted_files == [files[2 ], files[3 ], files[1 ]]
172
173
end
174
+
175
+ @testset " unwrap" begin
176
+ x = Val (2 )
177
+ y = Val (3 )
178
+ @test unwrap (x) == 2
179
+ @test unwrap (y) == 3
180
+ end
181
+
173
182
end
You can’t perform that action at this time.
0 commit comments