item assignment

Open
#261 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

No files or tests are named. Start by reproducing the xarray example and inspect the CFDatasetAccessor entry point and its current item-access behavior. Done should mean that the shown ds.cf["time"] assignment accepts the converted time values without the TypeError.

Written by the indexing model from the issue text.

Description

Couldn't see an issue open for this. It may also not be in the roadmap.

import xarray as xr
ds = xr.open_zarr("s3://era5-pds/zarr/2021/01/data/air_temperature_at_2_metres.zarr").isel(lat=0, lon=0)
# coord named time0 with standard_name: time
# want to change time to be in a local timezone
# in xarray
ds["time0"] = ds["time0"].to_index().tz_localize("UTC").tz_convert("US/Eastern").tz_localize(None).to_numpy())
# feature request in cf xarray
ds.cf["time"] = ds.cf["time"].to_index().tz_localize("UTC").tz_convert("US/Eastern").tz_localize(None).to_numpy())
TypeError: 'CFDatasetAccessor' object does not support item assignment
Dominant language
Python
Stars
181
Forks
49
Avg merge
43m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xarray-contrib/cf-xarray

All issues in xarray-contrib/cf-xarray

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.