ltelab / disdrodb

A global database of disdrometers measurements

Home Page:https://disdrodb.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Refactor] : Simplify code

regislon opened this issue · comments

    It could be simplified with the follow code : 
start_time = pd.to_datetime(ds["time"].values[0])
end_time =  pd.to_datetime(ds["time"].values[-1])
start_time_str = start_time.strftime(format)
end_time_str = end_time.strftime(format)

I wonder if it's not more useful to return the pd.Timestamp / datetime.datetime start_time and end_time
and then convert to string with strftime when defining the filepaths.

The function could be called get_start_end_time(ds)

Originally posted by @ghiggi in #92 (comment)

Fixed by #105