Skip to content

Conversation

imreddyTeja
Copy link
Member

Promoting a large number of ITimes is expensive, so this modifies the behavior to only do so if needed.

Closes #186


  • I have read and checked the items on the review checklist.

@imreddyTeja imreddyTeja requested a review from ph-kev August 22, 2025 17:36
Comment on lines 112 to 113
t0 = times[begin]
if !(isnothing(t0.epoch) || all(t -> t.epoch == t0.epoch, times))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am missing it, but if the first ITime doesn't have an epoch, you wouldn't want to call promote?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I prefer first(times) over times[begin].

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parenthesis make this petty unclear. Line 113 should be equivalent to

if (!isnothing(t0.epoch) && (!all(t -> t.epoch == t0.epoch, times))

So it shouldn't promote if the first time does not have an epoch.

The changes I made here could be incorrect because it assumes that all the ITimes have an epoch or do not, when the inout could be a mix.

@imreddyTeja imreddyTeja force-pushed the tr/time-varying-promote branch from df73c25 to 3208650 Compare September 2, 2025 16:38
Promoting a large number of ITimes is expensive, so
this modifies the behavior to only do so if needed.

fixes
@imreddyTeja imreddyTeja force-pushed the tr/time-varying-promote branch from 3208650 to 00ae122 Compare September 2, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using TVI0D with PeriodCalendar is very slow
2 participants