bluesky_tiled_plugins.writing.validator#

Module Contents#

Functions#

validate

Validate the given BlueskyRun client for completeness and data integrity.

validate_reading

Attempt to read data from the given data client to validate data accessibility

validate_structure

Validate and optionally fix the structure of the given (array) dataset, client-side

validate_data_source

Validate and optionally fix the structure of a data_source

Data#

API#

bluesky_tiled_plugins.writing.validator.logger#

‘getLogger(…)’

exception bluesky_tiled_plugins.writing.validator.ValidationException(message, uid=None)#

Bases: Exception

Common base class for all non-exit exceptions.

exception bluesky_tiled_plugins.writing.validator.ReadingValidationException(message, uid=None)#

Bases: bluesky_tiled_plugins.writing.validator.ValidationException

Common base class for all non-exit exceptions.

exception bluesky_tiled_plugins.writing.validator.StructureValidationException#

Bases: ValueError

Inappropriate argument value (of correct type).

exception bluesky_tiled_plugins.writing.validator.RunValidationException(message, uid=None)#

Bases: bluesky_tiled_plugins.writing.validator.ValidationException

Common base class for all non-exit exceptions.

exception bluesky_tiled_plugins.writing.validator.MetadataValidationException(message, uid=None)#

Bases: bluesky_tiled_plugins.writing.validator.ValidationException

Common base class for all non-exit exceptions.

bluesky_tiled_plugins.writing.validator.validate(root_client, fix_errors=True, try_reading=True, raise_on_error=False, ignore_errors=None)#

Validate the given BlueskyRun client for completeness and data integrity.

Parameters

root_client : tiled.client.run.RunClient The Run client to validate. fix_errors : bool, optional Whether to attempt to fix structural errors found during validation. Default is True. try_reading : bool, optional Whether to attempt reading the data for external data keys. Default is True. raise_on_error : bool, optional Whether to raise an exception on the first validation error encountered. Default is False. ignore_errors : list of str, optional List of error messages to ignore during validation. If any errors whose message matches one of the patterns in this list are encountered, they will be logged, but the validation of the remaining data keys will continue.

Returns

bool True if validation passed without errors, False otherwise.

bluesky_tiled_plugins.writing.validator.validate_reading(data_client)#

Attempt to read data from the given data client to validate data accessibility

Parameters

data_client : tiled.client.ArrayClient or tiled.client.DataFrameClient
    The data client to validate reading from.

Raises

ReadingValidationException
    If reading the data fails with an unignored error.
bluesky_tiled_plugins.writing.validator.validate_structure(data_client, fix_errors=False) list[str]#

Validate and optionally fix the structure of the given (array) dataset, client-side

Parameters

data_client : tiled.client.ArrayClient
    The data client whose structure is to be validated.
fix_errors : bool, optional
    Whether to attempt to fix structural errors found during validation.
    Default is False.

Returns

list of str
    A list of human-readable notes describing any fixes applied during validation.
bluesky_tiled_plugins.writing.validator.validate_data_source(data_source, fix_errors=False, metadata=None, adapters_by_mimetype=None) tuple[tiled.structures.data_source.DataSource, list[str]]#

Validate and optionally fix the structure of a data_source

Parameters

data_source: tiled.client.data_source.DataSource
    The data source whose structure is to be validated.
fix_errors : bool, optional
    Whether to attempt to fix structural errors found during validation.
    Default is False.

Returns

list of str
    A list of human-readable notes describing any fixes applied during validation.