Skip to content

Add working example of environment based time zones#73

Merged
emmuhamm merged 13 commits into
developfrom
emmuhamm/timezones
Jun 5, 2026
Merged

Add working example of environment based time zones#73
emmuhamm merged 13 commits into
developfrom
emmuhamm/timezones

Conversation

@emmuhamm

@emmuhamm emmuhamm commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix #70

Add better timezone handling. This is going to be optionally done by an environment variable, which overrides the log_format.ini settings.

Add better theme handling. This is also going to optionally done by an environment variable, which overrides the log_format.ini settings.

For full explanations, please see the docs in this PR, and also the testing notes

Testing notes

Tested on latest nightly (doesnt matter which)

Run
export DUNEDAQ_TIMEZONE="Europe/London"
export DUNEDAQ_LOGGING_THEME="dark"

and
daqpytools-logging-demonstrator -r

See how the colors and the timezones has changed. Play around with various timezones and themes.

When finish, run
export DUNEDAQ_TIMEZONE=""
export DUNEDAQ_LOGGING_THEME=""
And see how they revert back to their default behaviour

TODO:

  • Figure out why it breaks integ test if different timezone is chosen (likely outside scope of this PR)

Type of change

  • New feature or enhancement (non-breaking change which adds functionality)

Testing checklist

  • Unit tests pass (e.g. dbt-build --unittest)
  • Minimal system quicktest passes (pytest -s minimal_system_quick_test.py)
  • Full set of integration tests pass (dunedaq_integtest_bundle.sh)
  • Python tests pass if applicable (e.g. python -m pytest)
  • Pre-commit hooks run successfully if applicable (e.g. pre-commit run --all-files)

Comments here on the testing

Further checks

  • Code is commented where needed, particularly in hard-to-understand areas
  • Code style is correct (dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)
  • If applicable, new tests have been added or an issue has been opened to tackle that in the future.
    (Indicate issue here: # (issue))

@emmuhamm emmuhamm self-assigned this May 29, 2026
@emmuhamm emmuhamm marked this pull request as draft May 29, 2026 14:00
@emmuhamm

Copy link
Copy Markdown
Collaborator Author

There appears to be a very stupid bug somewhere in the integ test..

Note in the following screenshots, when it is in UTC everything works well. But when its in some other time zone (eg bst) then it fails????

Obviously outside the purview of daqpytools, but it should at least still be investigated.

Screenshot 2026-05-29 at 15 50 05 Screenshot 2026-05-29 at 15 50 02 Screenshot 2026-05-29 at 15 49 55

@emmuhamm

Copy link
Copy Markdown
Collaborator Author

How to view timezones

In [40]: import pytz
In [41]: pytz.all_timezones

@emmuhamm emmuhamm force-pushed the emmuhamm/timezones branch from 67b4c5c to 9861dac Compare June 4, 2026 14:19
@emmuhamm emmuhamm marked this pull request as ready for review June 4, 2026 15:08
Comment thread docs_dev/how-to/update-documentation.md
@emmuhamm emmuhamm requested a review from PawelPlesniak June 4, 2026 15:09
@emmuhamm emmuhamm added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 4, 2026
@emmuhamm

emmuhamm commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

@PawelPlesniak review pls :)

When this is all good and merged, I'll let kurt know about this

Comment thread docs/environment-configs.md

@PawelPlesniak PawelPlesniak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Small comment, but other than that, nice work!

@emmuhamm

emmuhamm commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

I dont see any major comments here and I've fixed the minor comment, so I'll take this as an approval! Will merge as soon as the tests pass

@emmuhamm emmuhamm merged commit 10d9657 into develop Jun 5, 2026
3 checks passed
@emmuhamm emmuhamm deleted the emmuhamm/timezones branch June 5, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Time zone defined in env variables

3 participants