nirs4all.data.config_parser module

Dataset configuration parser.

This module provides functions for parsing dataset configurations from various formats. It serves as the main entry point for configuration parsing, delegating to specialized parsers in the nirs4all.data.parsers module.

The parser supports: - Folder paths with auto-scanning for data files - JSON/YAML configuration files - Dictionary configurations (train_x/test_x format) - In-memory numpy arrays

For schema-based validation, see nirs4all.data.schema. For specialized parsers, see nirs4all.data.parsers.

nirs4all.data.config_parser.browse_folder(folder_path, global_params=None)[source]

Scan a folder for data files matching standard naming conventions.

This function delegates to FolderParser for the actual scanning.

Parameters:
  • folder_path – Path to folder to scan.

  • global_params – Optional global loading parameters.

Returns:

Configuration dictionary with detected file paths.

nirs4all.data.config_parser.folder_to_name(folder_path)[source]

Extract a dataset name from a folder path.

Parameters:

folder_path – Path to folder.

Returns:

Cleaned dataset name.