Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename dimension Time to Duration #631

Open
rben01 opened this issue Oct 21, 2024 · 3 comments
Open

Rename dimension Time to Duration #631

rben01 opened this issue Oct 21, 2024 · 3 comments
Labels

Comments

@rben01
Copy link
Contributor

rben01 commented Oct 21, 2024

I generally think of “time” as meaning time of day — the part of a DateTime that's not the date. Numbat’s usage of it to mean a span of time, i.e., a Duration, is a bit confusing and unexpected.

Were it up to me, I would rename it to Duration.

@Goju-Ryu
Copy link
Contributor

I’m a bit conflicted about this. On one hand I agree that having Time be the time portion of DateTime is reasonable and intuitive. On the other, many physics equations uses a time variable not as duration but as a concrete value on a timeline with time = 0 being the initial state to calculate the evolution of a system over time from.
I feel like Duration would be counterintuitive here. I think we could use TimeOfDay, ClockTime or other descriptive names for the time part of DateTime to make it obvious which is which.
I’m not sure I’m decided on my preference but I think I’m leaning toward keeping the current name for time.

@rben01
Copy link
Contributor Author

rben01 commented Oct 22, 2024

On the other, many physics equations uses a time variable not as duration but as a concrete value on a timeline with time = 0 being the initial state to calculate the evolution of a system over time from.

In this case it's still a duration that matters, it's just that the distinction matters less because the duration is formed by subtracting 0 from the instant in question.

@sharkdp
Copy link
Owner

sharkdp commented Oct 23, 2024

I’m a bit conflicted about this. On one hand I agree that having Time be the time portion of DateTime is reasonable and intuitive. On the other, many physics equations uses a time variable not as duration but as a concrete value on a timeline with time = 0 being the initial state to calculate the evolution of a system over time from.

Yes, the name is inspired by physics. Where Length, Mass and Time are the fundamental kinematic dimensions. I'd rather not change the name to Time, but we can consider adding Duration as an alias.

On the other hand, we might want to properly support durations in DateTime calculations. And then it might not be enough to only think of a duration as a single value (in seconds). See e.g. how the datetime library that we use, jiff, represents durations: https://docs.rs/jiff/latest/jiff/struct.Span.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants