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

Gantt: Display x-axis in UTC #1946

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Conversation

ChrisPaulBennett
Copy link
Contributor

@ChrisPaulBennett ChrisPaulBennett commented Sep 24, 2024

This pull request fixes this issue
#1917

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@hjoliver
Copy link
Member

Sorry I'm late to the party on this issue.

This PR clearly works as advertised, but we probably need to use the appropriate time zone for the workflow, not just assume UTC.

If you're not running NWP or climate science workflows the local timezone is probably preferred, and I don't think you'll want to see analysis view time axes in UTC.

[scheduler]
    UTC mode = False  # scheduler log timestamps, defaults to local time via global config
    cycle point time zone = +1300  # cycle point time zone, defaults to UTC
[scheduling]
    initial cycle point = now
    [[graph]]
        P1D = "foo"
[runtime]
    [[foo]]
        script = "sleep $(( RANDOM % 10 ))"

For the gantt view time axis, it should be determined by [scheduler]UTC mode.

@MetRonnie
Copy link
Member

I imagine it would be useful to be able to choose the timezone from a dropdown (either workflow cycle point time zone, UTC, or local).

The cycle point time zone for the workflow can be got by adding this to the query:

 query ganttQuery ($workflows: [ID]) {
+  workflows(ids: $workflows) {
+    timeZoneInfo {
+      hours
+      minutes
+      stringExtended // if needed
+    }
+  }
   jobs(live: false, workflows: $workflows) {
     ${jobFields.join('\n')}
   }
 }

N.B. the UTC mode setting is not exposed in the GraphQL schema at the moment

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Tested as working.

It would be good to change the x-axis label to "Time (UTC)" to make this clear.

@hjoliver
Copy link
Member

hjoliver commented Oct 1, 2024

N.B. the UTC mode setting is not exposed in the GraphQL schema at the moment

Hmmm yeah you're right. That's a problem, because cycle point time zone is not what we need for the gantt time axis - which applies even for integer cycling. If you set scheduler UTC mode to local time, that's because you want scheduler events logged in local time, which implies you'll also want to see said events in local time in the gantt view.

I guess for now we can just hardwire UTC - because most of our users do NWP and climate workflows - and post an issue to fix it in the future.

@ChrisPaulBennett
Copy link
Contributor Author

Title has been changed.
Agreed that exposing the UTC mode to GraphQL is the cleanest way to do this.

@ChrisPaulBennett ChrisPaulBennett merged commit 065b948 into cylc:master Oct 1, 2024
8 checks passed
@ChrisPaulBennett ChrisPaulBennett deleted the timezone branch October 1, 2024 12:03
@MetRonnie MetRonnie added this to the 2.6.0 milestone Oct 1, 2024
@MetRonnie MetRonnie added data workflows team Work pertaining to the analysis/gantt/etc views small labels Oct 1, 2024
@MetRonnie MetRonnie changed the title Display x-axis in UTC Gantt: Display x-axis in UTC Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data workflows team Work pertaining to the analysis/gantt/etc views small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants