Production Helpers

class timeatlas.production.ProductionContext[source]

Bases: object

Convenience bundle for a dataset production configuration.

config_path: Path
config: dict[str, Any]
uuid_manager: UUIDManager
dataset_slug: str
dataset_id: str
time_range: RDETimeRange
classmethod from_config(config_path)[source]

Load a dataproduction config and derive common production values.

Parameters:

config_path (str | Path)

Return type:

ProductionContext

__init__(config_path, config, uuid_manager, dataset_slug, dataset_id, time_range)
Parameters:
Return type:

None

timeatlas.production.clean_metadata(raw)[source]

Normalize metadata values for JSON/RDE output.

Parameters:

raw (dict)

Return type:

dict

timeatlas.production.csv_seed(row, cols, suffix='')[source]

Return the legacy CSV-serialized UUID seed for selected row columns.

Parameters:
Return type:

str

timeatlas.production.datetime_from_int(date_val, match_to_end=False)[source]

Convert an integer/string date (YYYYMMDD or YYYY) to ISO-8601.

Parameters:
Return type:

str

timeatlas.production.find_latest_file(prefix, ext)[source]

Return the lexically latest recursive match for <prefix>*.<ext>.

Parameters:
Return type:

str

timeatlas.production.find_layer_uuid(layer_fp, slug_part)[source]

Return the unique layer UUID whose slug contains slug_part.

Parameters:
Return type:

str

timeatlas.production.get_area_uuids(area_locs)[source]

Read the first RDE UUID from each area ingestion file.

Parameters:

area_locs (Sequence[str | Path])

Return type:

list[str]

timeatlas.production.normalize_to_epsg4326(gdf, source_crs=None, allow_override=False)[source]

Return a GeoDataFrame-like object normalized to EPSG:4326.

The helper uses the GeoDataFrame protocol instead of importing geopandas, keeping geopandas optional for the TimeAtlas library itself.

Parameters:
  • source_crs (str | None)

  • allow_override (bool)