@@ -416,7 +416,7 @@ def _system_sml(station: dict) -> dict:
416416 }
417417
418418
419- def _datastream_schema () -> dict :
419+ def _datastream_schema (station_id : str = "" ) -> dict :
420420 """SWE DataRecord schema for buoy observation datastream.
421421
422422 NDBC fields (SI units, already in source data):
@@ -435,8 +435,9 @@ def _datastream_schema() -> dict:
435435 PTDY - Pressure tendency (hPa)
436436 TIDE - Water level (ft)
437437 """
438+ uid_suffix = f":{ station_id } " if station_id else ""
438439 return {
439- "uid" : "urn:os4csapi:datastream:ndbc-buoy :ndbcBuoyObs:v1" ,
440+ "uid" : f "urn:os4csapi:datastream:ndbc{ uid_suffix } :ndbcBuoyObs:v1" ,
440441 "outputName" : DS_OUTPUT_NAME ,
441442 "name" : "Buoy Observation" ,
442443 "description" : (
@@ -549,10 +550,11 @@ def _datastream_schema() -> dict:
549550}
550551
551552
552- def _buoycam_datastream_schema () -> dict :
553+ def _buoycam_datastream_schema (station_id : str = "" ) -> dict :
553554 """SWE DataRecord schema for BuoyCAM image-reference datastream."""
555+ uid_suffix = f":{ station_id } " if station_id else ""
554556 return {
555- "uid" : "urn:os4csapi:datastream:ndbc-buoy :ndbcBuoyCamImage:v1" ,
557+ "uid" : f "urn:os4csapi:datastream:ndbc{ uid_suffix } :ndbcBuoyCamImage:v1" ,
556558 "outputName" : BUOYCAM_DS_OUTPUT_NAME ,
557559 "name" : "BuoyCAM Image" ,
558560 "description" : (
@@ -749,14 +751,14 @@ def bootstrap(*, clean: bool = False, clean_only: bool = False,
749751
750752 if sys_id or dry_run :
751753 ensure_datastream (base_url , auth , sys_id or "pending" , DS_OUTPUT_NAME ,
752- _datastream_schema (),
754+ _datastream_schema (st [ "id" ] ),
753755 dry_run = dry_run , stats = stats )
754756
755757 # BuoyCAM datastream (only for camera-equipped stations)
756758 if st .get ("has_buoycam" ):
757759 ensure_datastream (base_url , auth , sys_id or "pending" ,
758760 BUOYCAM_DS_OUTPUT_NAME ,
759- _buoycam_datastream_schema (),
761+ _buoycam_datastream_schema (st [ "id" ] ),
760762 dry_run = dry_run , stats = stats )
761763
762764 # ── Deployment tree ───────────────────────────────────────────────
0 commit comments