@@ -92,17 +92,17 @@ def grid_density_qc(grid: Grid, num_traces: int) -> None:
9292 GridTraceSparsityError: If the sparsity ratio exceeds `MDIO__GRID__SPARSITY_RATIO_LIMIT`
9393 and `MDIO_IGNORE_CHECKS` is not set to a truthy value (e.g., "1", "true").
9494 """
95- env = MDIOSettings ()
95+ settings = MDIOSettings ()
9696 # Calculate total possible traces in the grid (excluding sample dimension)
9797 grid_traces = np .prod (grid .shape [:- 1 ], dtype = np .uint64 )
9898
9999 # Handle division by zero if num_traces is 0
100100 sparsity_ratio = float ("inf" ) if num_traces == 0 else grid_traces / num_traces
101101
102102 # Fetch and validate environment variables
103- warning_ratio = env .grid_sparsity_ratio_warn
104- error_ratio = env .grid_sparsity_ratio_limit
105- ignore_checks = env .ignore_checks
103+ warning_ratio = settings .grid_sparsity_ratio_warn
104+ error_ratio = settings .grid_sparsity_ratio_limit
105+ ignore_checks = settings .ignore_checks
106106
107107 # Check sparsity
108108 should_warn = sparsity_ratio > warning_ratio
@@ -360,9 +360,9 @@ def _populate_coordinates(
360360
361361
362362def _add_segy_file_headers (xr_dataset : xr_Dataset , segy_file_info : SegyFileInfo ) -> xr_Dataset :
363- env = MDIOSettings ()
363+ settings = MDIOSettings ()
364364
365- if not env .save_segy_file_header :
365+ if not settings .save_segy_file_header :
366366 return xr_dataset
367367
368368 expected_rows = 40
@@ -386,7 +386,7 @@ def _add_segy_file_headers(xr_dataset: xr_Dataset, segy_file_info: SegyFileInfo)
386386 "binaryHeader" : segy_file_info .binary_header_dict ,
387387 }
388388 )
389- if env .raw_headers :
389+ if settings .raw_headers :
390390 raw_binary_base64 = base64 .b64encode (segy_file_info .raw_binary_headers ).decode ("ascii" )
391391 xr_dataset ["segy_file_header" ].attrs .update ({"rawBinaryHeader" : raw_binary_base64 })
392392
@@ -524,7 +524,7 @@ def segy_to_mdio( # noqa PLR0913
524524 Raises:
525525 FileExistsError: If the output location already exists and overwrite is False.
526526 """
527- env = MDIOSettings ()
527+ settings = MDIOSettings ()
528528
529529 _validate_spec_in_template (segy_spec , mdio_template )
530530
@@ -555,7 +555,7 @@ def segy_to_mdio( # noqa PLR0913
555555 _ , non_dim_coords = _get_coordinates (grid , segy_headers , mdio_template )
556556 header_dtype = to_structured_type (segy_spec .trace .header .dtype )
557557
558- if env .raw_headers :
558+ if settings .raw_headers :
559559 if zarr .config .get ("default_zarr_format" ) == ZarrFormat .V2 :
560560 logger .warning ("Raw headers are only supported for Zarr v3. Skipping raw headers." )
561561 else :
0 commit comments