[OpenSTEF 4.0] Improved timezone handling/verifications

Open
#715 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@charanteja25 is already working on this.

Since Oct 15, 2026.

  • #1146 by @charanteja25 — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data, testing

Research direction

Start with the BenchmarkTarget fields benchmark_start, benchmark_stop and train_start in the openstef-beam benchmark code, and trace where naive datetimes get converted into timezone-aware ones. The issue proposes a design choice (enforce timezones everywhere versus infer them from data) that a maintainer should settle before any edit. Done would be a clear error or warning for a missing timezone plus a functional test covering mixed timezones in backtesting.

Written by the indexing model from the issue text.

Description

localization OpenSTEF 4.0 to refine

Is your feature request related to a problem? Please describe.
While working on a benchmark script in openstef-beam, I found that not specifying a timezone within the datetime in any of the benchmark_start, benchmark_stop or train_start fields of BenchmarkTarget caused timezone errors further downstream that were difficult to trace back. To me it was not clear this was needed, and feels a bit unintuitive providing a timezone for a configuration like when the benchmark stops. Thinking a bit further ahead, I can foresee quite some timezone related issues, which can be quite frustrating to the user. Lets think a bit about how we can make OpenSTEF 4.0 timezone robust!

Describe the solution you'd like
There are different ways to go about this, but I would like to start by proposing the following:

  • We could enforce the usage of timezones everywhere, and for any place a timezone is not provided, a warning is logged or an error is thrown at front, making it clear for the user where a timezone might be missing
  • Lets add some (functional?) tests that verify basic OpenSTEF operations (e.g. backtesting) work as expected with complex timezone situations, like when different timezones are provided for measurements and features.

Describe alternatives you've considered
We could also allow timezone unaware datetimes for certain fields like benchmark_start, and then infer the timezone based on the data. I think this will fail though when the user uses multiple different timezones within a single dataset.

Dominant language
Python
Stars
169
Forks
59
Avg merge
4d 15h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenSTEF/openstef

All issues in OpenSTEF/openstef

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.