bluesky / tiled

API to structured data
https://blueskyproject.io/tiled
BSD 3-Clause "New" or "Revised" License
53 stars 48 forks source link

ENH user experience localize timestamps quickly for humans #244

Open ambarb opened 2 years ago

ambarb commented 2 years ago

For a databroker V1 search like db(since = '2022-05-25 0:00:00', until = '2022-05-28 08:29:00',) , i can understand easily how to adjust the time range to exclude by using the convienece of db.start and scrolling down to time. Explaining this to a user is very straightforward image

tiled version '0.1.0a61' isnt so convenient image

novice python user will have trouble figuring this out because most examples on the web seem to use datetime.now() or deprecated datetime.fromtimestamp() or a hard-coded offset

danielballan commented 2 years ago

Thanks for the report @ambarb.

In v1 we use IPython/Jupyter display hooks to customize the way the Header displays, and as part of this we translate the time to a human-friendly representation.

I do wonder whether, as part of the 2.0.0 update, we should go further and encode time as a datetime object rather than a UNIX epoch timestamp.

ambarb commented 2 years ago

I think having both are convenient. The less we ask people to convert, the better off we are. Choosing the "right" format to line up with the start/stop times and the archiver are important. Right meaning, are there clear examples on stackexchange that are easy to find? Some of the really low level pandas classes for time are very tricky to convert and one needs to know a lot about pandas

ping me if it is helpful to see specific info