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

Make webviz-ert compatible with python3.11 #449

Merged

Conversation

larsevj
Copy link
Contributor

@larsevj larsevj commented Nov 30, 2023

Issue
Resolves #equinor/ert#6574

Approach
Short description of the approach

Pre review checklist

  • Added appropriate labels

@larsevj larsevj force-pushed the make_webviz_ert_compatible_with_python3.11 branch from 75f11bf to 4f8a144 Compare November 30, 2023 12:29
@larsevj
Copy link
Contributor Author

larsevj commented Nov 30, 2023

One idea for resolving the issue caused by changes to enums in Python 3.11. The changes are mentioned here:
python/cpython#100458
https://discuss.python.org/t/inconsistent-behavior-with-python-3-11-enum-mixin-class-behavior/24613
https://docs.python.org/3.11/whatsnew/3.11.html

@larsevj
Copy link
Contributor Author

larsevj commented Nov 30, 2023

Note that with the changes I made there is still a difference between the data models for python pre 3.11 and after:
With Python 3.10:

  • print(DataType.RESPONSE) # > DataType.RESPONSE
  • print(str(DataType.RESPONSE)) # > DataType.RESPONSE
  • print("%s" % DataType.RESPONSE) # > DataType.RESPONSE
  • print(f"{DataType.RESPONSE}") # > resp
  • print("{}".format(DataType.RESPONSE)) # > resp

With python 3.11 this becomes:

  • print(DataType.RESPONSE) # > resp
  • print(str(DataType.RESPONSE)) # > resp
  • print("%s" % DataType.RESPONSE) # > resp
  • print(f"{DataType.RESPONSE}") # > resp
  • print("{}".format(DataType.RESPONSE)) # > resp

Copy link

@andreas-el andreas-el left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@larsevj larsevj merged commit f1d214e into equinor:main Nov 30, 2023
3 checks passed
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.

2 participants