Skip to content

Commit db615e1

Browse files
committed
Add fastexcel package for polars excel reading
1 parent b38916c commit db615e1

File tree

3 files changed

+27
-30
lines changed

3 files changed

+27
-30
lines changed

pyproject.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ dependencies = [
3737
"matplotlib",
3838
"netCDF4",
3939
"numpy<2",
40-
"openpyxl", # extra dependency for pandas (excel)
4140
"opentelemetry-api<1.30.0",
4241
"opentelemetry-sdk<1.30.0",
4342
"opentelemetry-instrumentation-fastapi<0.51b0",
@@ -49,24 +48,25 @@ dependencies = [
4948
"pluggy>=1.3.0",
5049
"polars>=1",
5150
"psutil",
52-
"pyarrow", # extra dependency for pandas (parquet)
51+
"pyarrow", # extra dependency for pandas (parquet)
5352
"pydantic > 2",
5453
"python-dateutil",
55-
"python-multipart", # extra dependency for fastapi
54+
"python-multipart", # extra dependency for fastapi
5655
"pyyaml",
5756
"pyzmq",
5857
"pyqt6",
5958
"requests",
6059
"resfo",
6160
"scipy >= 1.10.1, < 1.15",
6261
"seaborn",
63-
"tables", # extra dependency for pandas (hdf5)
62+
"tables", # extra dependency for pandas (hdf5)
6463
"tabulate",
6564
"tqdm>=4.62.0",
6665
"typing_extensions>=4.5",
6766
"uvicorn >= 0.17.0",
6867
"xarray",
6968
"xtgeo >= 3.3.0",
69+
"fastexcel>=0.12.1",
7070
]
7171

7272
[project.scripts]

src/ert/config/design_matrix.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,12 @@ def read_design_matrix(
195195
):
196196
error_msg = "\n".join(error_list)
197197
raise ValueError(f"Design matrix is not valid, error(s):\n{error_msg}")
198-
design_matrix_df.columns = param_names
199-
if "REAL" in design_matrix_df.columns:
198+
design_matrix_df.columns = list(param_names)
199+
if "REAL" in design_matrix_df.schema:
200+
real_dt = design_matrix_df.schema.get("REAL")
201+
assert real_dt is not None
200202
if (
201-
not design_matrix_df.schema.get("REAL").is_integer()
203+
not real_dt.is_integer()
202204
or design_matrix_df.get_column("REAL").lt(0).any()
203205
or design_matrix_df.get_column("REAL").is_duplicated().any()
204206
):

uv.lock

+18-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)