99
1010local_tz = get_localzone () # get the local timezone
1111
12- IGLU_R_COMPATIBLE = True
12+ _IGLU_R_COMPATIBLE = True
13+
14+ def set_iglu_r_compatible (value : bool ) -> None :
15+ global _IGLU_R_COMPATIBLE
16+ _IGLU_R_COMPATIBLE = value
17+
18+ def is_iglu_r_compatible () -> bool :
19+ global _IGLU_R_COMPATIBLE
20+ return _IGLU_R_COMPATIBLE
1321
1422def localize_naive_timestamp (timestamp : datetime ) -> datetime :
1523 """
@@ -180,7 +188,7 @@ def CGMS2DayByDay(
180188 time_grid = pd .date_range (
181189 start = start_time , end = end_time , freq = f"{ dt0 } min"
182190 )
183- if IGLU_R_COMPATIBLE :
191+ if is_iglu_r_compatible () :
184192 # remove the first time point
185193 time_grid = time_grid [1 :]
186194 else :
@@ -234,7 +242,7 @@ def CGMS2DayByDay(
234242 interp_data = interp_data .reshape (n_days , n_points_per_day )
235243
236244 # Get actual dates
237- if IGLU_R_COMPATIBLE :
245+ if is_iglu_r_compatible () :
238246 # convert start_time into naive datetime
239247 start_time = start_time .tz_localize (None )
240248
@@ -254,7 +262,7 @@ def gd2d_to_df(gd2d, actual_dates, dt0):
254262 time .extend (day_time )
255263
256264 df = pd .DataFrame ({
257- "time" : pd .Series (time , dtype = 'datetime64[ns]' ),
265+ "time" : pd .Series (time ),
258266 "gl" : pd .Series (gl , dtype = 'float64' )
259267 })
260268
0 commit comments