leap-stc / LEAP_template_feedstock

A Prototype feedstock that implements independent metadata and data updates using pangeo forge
Apache License 2.0
1 stars 2 forks source link

Proof of concept: Update attrs from meta.yaml #1

Closed jbusecke closed 6 months ago

jbusecke commented 6 months ago

Wohoo this works.

I used this snipped on the LEAP hub to create 'fresh' stores on the scratch bucket:

## test store output
for id in ['proto_a', 'proto_b']:
    ds = xr.open_dataset(f"gs://leap-scratch/jbusecke/proto_feedstock/{id}.zarr", engine="zarr")
    print(id)
    display(ds)

and then get:

## test store output
for id in ['proto_a', 'proto_b']:
    ds = xr.open_dataset(f"gs://leap-scratch/jbusecke/proto_feedstock/{id}.zarr", engine="zarr")
    print(id)
    display(ds)
image

TODO:

jbusecke commented 6 months ago

I just ran the action and get this:

## test store output
for id in ['proto_a', 'proto_b']:
    ds = xr.open_dataset(f"gs://leap-scratch/jbusecke/proto_feedstock/{id}.zarr", engine="zarr")
    print(id)
    display(ds)
image

Note the different attrs per recipe (this is currently still hardcoded, but this is nice).

jbusecke commented 6 months ago

Adding a 3rd id to the meta without a store to test.

jbusecke commented 6 months ago

Yay! This is working nicely. This now injects the git source (full link to commit) and the time of execution (not sure if thats necessary) but this is nicely reproducible!

image