ray.data.RandomSeedConfig.create_seed_config#

classmethod RandomSeedConfig.create_seed_config(seed: int | RandomSeedConfig | None, *, use_timestamp_as_default: bool = False) RandomSeedConfig[source]#

Create a RandomSeedConfig object from the seed argument in Ray Data public random APIs.

This is a helper function that converts an integer seed into a RandomSeedConfig object. In this case, reseed_after_execution is set to False, which matches the standard behavior for a data pipeline (i.e., same seed across executions). To override this behavior, use a RandomSeedConfig object directly.

Parameters:
  • seed – This optional argument can be an integer or an existing RandomSeedConfig object.

  • use_timestamp_as_default – If True, a timestamp-based seed is used when seed is None. This pins the seed at plan time so that task retries produce identical output. When seed is an existing RandomSeedConfig, this value overrides its use_timestamp_as_default field.

Returns:

A RandomSeedConfig object.