CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-h5netcdf

netCDF4 file access via h5py with hierarchical and legacy APIs for scientific computing

69

0.83x
Overview
Eval results
Files

task.mdevals/scenario-9/

HDF5 Dimension Inspector

A utility that reads HDF5 files that lack proper NetCDF4 dimension information and reports the automatically generated dimension names.

Capabilities

Read non-compliant HDF5 files

  • Creates an HDF5 file with a dataset of shape (5, 10) that has no NetCDF4 dimension scales, then opens it and successfully reads the dataset shape @test
  • Opens an HDF5 file lacking dimension scales and retrieves the automatically generated dimension names for a dataset @test

Handle dimension naming modes

  • Opens an HDF5 file with missing dimension scales using 'sort' mode and retrieves dimension names @test

Implementation

@generates

API

def create_hdf5_without_scales(filepath: str, dataset_name: str, shape: tuple) -> None:
    """
    Creates an HDF5 file with a dataset that lacks NetCDF4 dimension scales.

    Args:
        filepath: Path where the file should be created
        dataset_name: Name for the dataset
        shape: Shape tuple for the dataset (e.g., (5, 10))
    """
    pass

def get_dimension_names(filepath: str, dataset_name: str, phony_mode: str = 'sort') -> list:
    """
    Opens an HDF5 file and retrieves the dimension names for a dataset.

    Args:
        filepath: Path to the HDF5 file
        dataset_name: Name of the dataset to inspect
        phony_mode: How to handle missing dimensions ('sort' or 'access')

    Returns:
        List of dimension name strings for the dataset
    """
    pass

Dependencies { .dependencies }

h5netcdf { .dependency }

Provides netCDF4 file-format access via h5py with support for reading HDF5 files that lack proper dimension information.

h5py { .dependency }

Provides low-level HDF5 file access for creating test files without dimension scales.

numpy { .dependency }

Provides array support for dataset creation and manipulation.

Install with Tessl CLI

npx tessl i tessl/pypi-h5netcdf

tile.json