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

Fix python bindings ESmry, start date #4509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tskille
Copy link
Contributor

@tskille tskille commented Mar 7, 2025

This PR fixes handling of daylight-saving time when importing start date from a summary file (and ESMRY) using python bindings.

Consider the following example. Start date is set in the data deck.

-- daylight saving from 2020-03-29 02:00 -> 03:00
START
 29 'MAR' 2020 05:04:41 /

When running this deck with OPM Flow, the following is saved to the SMSPEC file

'STARTDAT'           6 'INTE'
          29           3        2020           5           4    41000000

So far, all good.

However, when using the following python script to import start date from the summary file

import sys

from opm.io.ecl import ESmry

if __name__ == "__main__":

    smry = ESmry(sys.argv[1])

    print ("\n start date > {} \n".format(smry.start_date))

results are as following

start date > 2020-03-29 06:04:41

This is not as expected. As could be seen, this is one hour shifted relative to the input and to what is stored in the SMSPEC file.

ESmry::start_date is now ignoring daylight saving time.
@blattms blattms requested a review from lisajulia March 12, 2025 14:11
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.

1 participant