home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1507705136

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1507705136 I_kwDOAMm_X85Z3cEw 7398 convert_calendar adds time coordinate to static variables 5659125 open 0     1 2022-12-22T11:27:11Z 2023-01-15T15:51:21Z   NONE      

What is your issue?

I just recognized that convert_calendar adds a time coordinate to variables that have been static before, e.g.,

```python import numpy as np import pandas as pd import xarray as xr

np.random.seed(0) temperature = 15 + 8 * np.random.randn(2, 2, 3) precipitation = 10 * np.random.rand(2, 2, 3) orog = 0 + 100 * np.random.randn(2, 2) lon = [[-99.83, -99.32], [-99.79, -99.23]] lat = [[42.25, 42.21], [42.63, 42.59]] time = pd.date_range("2014-09-06", periods=3) reference_time = pd.Timestamp("2014-09-05")

ds = xr.Dataset( data_vars=dict( temperature=(["x", "y", "time"], temperature), precipitation=(["x", "y", "time"], precipitation), orog = (["x", "y"], orog) ), coords=dict( lon=(["x", "y"], lon), lat=(["x", "y"], lat), time=time, reference_time=reference_time, ), attrs=dict(description="Weather related data."), ) ds ![grafik](https://user-images.githubusercontent.com/5659125/209124247-4d6bb64f-8396-4a90-bcce-c420b022b0cf.png) I would like to convert the time axis to cftime objects usingpython ds.convert_calendar(ds.time.dt.calendar, use_cftime=True) ds `` ![grafik](https://user-images.githubusercontent.com/5659125/209124475-2ca60508-2d39-432b-816d-0f2718cda5b4.png) However, this results in an unexpected time coordinate in theorog` variable...

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7398/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 1.317ms · About: xarray-datasette