noether.data.tools.calculate_statistics¶
Functions¶
Parse command line arguments for dataset statistics calculation. |
|
|
Parse additional arguments for dataset constructor. |
|
Extract all available attributes from the dataset that have getitem methods. |
|
Calculate statistics for all dataset attributes. |
|
Print calculated statistics for each attribute. |
|
Save calculated statistics to a JSON file. |
|
Main function to calculate and display dataset statistics. |
Module Contents¶
- noether.data.tools.calculate_statistics.parse_args()¶
Parse command line arguments for dataset statistics calculation.
- noether.data.tools.calculate_statistics.parse_dataset_args(args)¶
Parse additional arguments for dataset constructor.
- noether.data.tools.calculate_statistics.get_dataset_attributes(dataset)¶
Extract all available attributes from the dataset that have getitem methods.
- Parameters:
dataset – The dataset object
- Returns:
Set of attribute names
- Return type:
Set[str]
- noether.data.tools.calculate_statistics.calculate_statistics(dataset, dataset_attributes, log_scale, num_workers=0)¶
Calculate statistics for all dataset attributes.
- Parameters:
- Returns:
Dictionary mapping attribute names to their statistics
- Return type:
Dict[str, RunningMoments]
- noether.data.tools.calculate_statistics.print_statistics(running_stats, log_scale)¶
Print calculated statistics for each attribute.
- Parameters:
running_stats (dict[str, noether.data.stats.RunningMoments]) – Dictionary mapping attribute names to their statistics
log_scale (set[str]) – Set of attributes processed in log scale
- Return type:
None
- noether.data.tools.calculate_statistics.save_statistics_to_json(running_stats, output_path, log_scale)¶
Save calculated statistics to a JSON file.
- Parameters:
running_stats (dict[str, noether.data.stats.RunningMoments]) – Dictionary mapping attribute names to their statistics
output_path (str | pathlib.Path) – Path where the JSON file will be saved
log_scale (set[str]) – Set of attributes processed in log scale
- Return type:
None
- noether.data.tools.calculate_statistics.main(dataset_kind, log_scale, exclude_attributes, output_json=None, num_workers=0, **dataset_constructor_args)¶
Main function to calculate and display dataset statistics.
- Parameters:
dataset_kind (str) – Class path of the dataset
log_scale (set[str]) – Set of attributes to process in log scale
exclude_attributes (set[str]) – Set of attributes to exclude from calculation
output_json (str | None) – Optional path to save statistics as JSON
num_workers (int) – Number of workers for data loading
dataset_constructor_args – Additional arguments for dataset constructor
- Return type:
None