@@ -9,47 +9,47 @@ def test_accessor():
9
9
# Test get_ accessors output is same as function
10
10
## - hemisphere
11
11
hemi_acc = data .hrcn .get_hemisphere (lat_name = "lat" )
12
- hemi_fct = huracanpy .utils .geography . get_hemisphere (data .lat )
12
+ hemi_fct = huracanpy .utils .get_hemisphere (data .lat )
13
13
assert not any (hemi_acc != hemi_fct ), "accessor output differs from function output"
14
14
## - basin
15
15
basin_acc = data .hrcn .get_basin (lon_name = "lon" , lat_name = "lat" )
16
- basin_fct = huracanpy .utils .geography . get_basin (data .lon , data .lat )
16
+ basin_fct = huracanpy .utils .get_basin (data .lon , data .lat )
17
17
assert not any (
18
18
basin_acc != basin_fct
19
19
), "accessor output differs from function output"
20
20
## - land or ocean
21
21
land_ocean_acc = data .hrcn .get_land_or_ocean (lon_name = "lon" , lat_name = "lat" )
22
- land_ocean_fct = huracanpy .utils .geography . get_land_or_ocean (data .lon , data .lat )
22
+ land_ocean_fct = huracanpy .utils .get_land_or_ocean (data .lon , data .lat )
23
23
assert not any (
24
24
land_ocean_acc != land_ocean_fct
25
25
), "accessor output differs from function output"
26
26
## - country
27
27
country_acc = data .hrcn .get_country (lon_name = "lon" , lat_name = "lat" )
28
- country_fct = huracanpy .utils .geography . get_country (data .lon , data .lat )
28
+ country_fct = huracanpy .utils .get_country (data .lon , data .lat )
29
29
assert not any (
30
30
country_acc != country_fct
31
31
), "accessor output differs from function output"
32
32
## - continent
33
33
continent_acc = data .hrcn .get_continent (lon_name = "lon" , lat_name = "lat" )
34
- continent_fct = huracanpy .utils .geography . get_continent (data .lon , data .lat )
34
+ continent_fct = huracanpy .utils .get_continent (data .lon , data .lat )
35
35
assert not any (
36
36
continent_acc != continent_fct
37
37
), "accessor output differs from function output"
38
38
## - ace
39
39
ace_acc = data .hrcn .get_ace (wind_name = "wind10" )
40
- ace_fct = huracanpy .utils .ace . get_ace (data .wind10 )
40
+ ace_fct = huracanpy .utils .get_ace (data .wind10 )
41
41
assert not any (ace_acc != ace_fct ), "accessor output differs from function output"
42
42
43
43
## - pace
44
44
pace_acc = data .hrcn .get_pace (pressure_name = "slp" , wind_name = "wind10" )
45
- pace_fct , model_fct = huracanpy .utils .ace . get_pace (data .slp , data .wind10 )
45
+ pace_fct , model_fct = huracanpy .utils .get_pace (data .slp , data .wind10 )
46
46
assert not any (pace_acc != pace_fct ), "accessor output differs from function output"
47
47
48
48
## - time components
49
49
year_acc , month_acc , day_acc , hour_acc = data .hrcn .get_time_components (
50
50
time_name = "time"
51
51
)
52
- year_fct , month_fct , day_fct , hour_fct = huracanpy .utils .time . get_time_components (
52
+ year_fct , month_fct , day_fct , hour_fct = huracanpy .utils .get_time_components (
53
53
data .time
54
54
)
55
55
assert all (year_acc == year_fct ), "Year component does not match"
@@ -61,17 +61,17 @@ def test_accessor():
61
61
season_acc = data .hrcn .get_season (
62
62
track_id_name = "track_id" , lat_name = "lat" , time_name = "time"
63
63
)
64
- season_fct = huracanpy .utils .time . get_season (data .track_id , data .lat , data .time )
64
+ season_fct = huracanpy .utils .get_season (data .track_id , data .lat , data .time )
65
65
assert all (season_acc == season_fct ), "Season component does not match"
66
66
67
67
## - SSHS category
68
68
sshs_acc = data .hrcn .get_sshs_cat (wind_name = "wind10" )
69
- sshs_fct = huracanpy .utils .category . get_sshs_cat (data .wind10 )
69
+ sshs_fct = huracanpy .utils .get_sshs_cat (data .wind10 )
70
70
assert all (sshs_acc == sshs_fct ), "SSHS category output does not match"
71
71
72
72
## - Pressure category
73
73
pressure_cat_acc = data .hrcn .get_pressure_cat (slp_name = "slp" )
74
- pressure_cat_fct = huracanpy .utils .category . get_pressure_cat (data .slp )
74
+ pressure_cat_fct = huracanpy .utils .get_pressure_cat (data .slp )
75
75
assert all (
76
76
pressure_cat_acc == pressure_cat_fct
77
77
), "Pressure category output does not match"
@@ -80,9 +80,7 @@ def test_accessor():
80
80
distance_acc = data .hrcn .get_distance (
81
81
lon_name = "lon" , lat_name = "lat" , track_id_name = "track_id"
82
82
)
83
- distance_fct = huracanpy .utils .translation .get_distance (
84
- data .lon , data .lat , data .track_id
85
- )
83
+ distance_fct = huracanpy .utils .get_distance (data .lon , data .lat , data .track_id )
86
84
np .testing .assert_array_equal (
87
85
distance_acc ,
88
86
distance_fct ,
@@ -93,7 +91,7 @@ def test_accessor():
93
91
translation_speed_acc = data .hrcn .get_translation_speed (
94
92
lon_name = "lon" , lat_name = "lat" , time_name = "time" , track_id_name = "track_id"
95
93
)
96
- translation_speed_fct = huracanpy .utils .translation . get_translation_speed (
94
+ translation_speed_fct = huracanpy .utils .get_translation_speed (
97
95
data .lon , data .lat , data .time , data .track_id
98
96
)
99
97
np .testing .assert_array_equal (
@@ -145,7 +143,7 @@ def test_accessor():
145
143
interpolated_data_acc = data .hrcn .interp_time (
146
144
freq = "1h" , track_id_name = "track_id" , prog_bar = False
147
145
)
148
- expected_interpolated_data = huracanpy .utils .interp . interp_time (
146
+ expected_interpolated_data = huracanpy .utils .interp_time (
149
147
data , freq = "1h" , track_id_name = "track_id" , prog_bar = False
150
148
)
151
149
np .testing .assert_array_equal (
0 commit comments