home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where author_association = "NONE" and user = 18679148 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: issue_url, reactions, created_at (date), updated_at (date)

issue 4

  • Can't unstack concatenated DataArrays 5
  • float32 instead of float64 when decoding int16 with scale_factor netcdf var using xarray 1
  • combine_by_coords; proposition for a new option for combine_attrs = 'dim' 1
  • plot/utils get_axis cannot use subplot_kws with existing ax 1

user 1

  • ACHMartin · 8 ✖

author_association 1

  • NONE · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1431400086 https://github.com/pydata/xarray/issues/7076#issuecomment-1431400086 https://api.github.com/repos/pydata/xarray/issues/7076 IC_kwDOAMm_X85VUW6W ACHMartin 18679148 2023-02-15T13:49:45Z 2023-02-16T13:43:29Z NONE

Hi @DWesl, @benbovy

I got a bug very similar to what was initially report with the following minimal example (xarray version 2022.11.0) with the error:

ValueError: cannot unstack dimensions that do not have exactly one multi-index: ('z',)

It is working fine with my previous version (xarray 0.16.0) python import xarray as xr ds = xr.Dataset( data_vars=dict( mydata = ( ['across', 'along'], [[0,1],[2,3]]) ) ) stacked = ds.stack(z=("across", "along")) newlist = [None] * stacked.z.size for ii, zindex in enumerate(stacked.z.data): newlist[ii] = stacked.mydata.sel(z=zindex) newds = xr.concat(newlist, dim='z') newds['z'] = stacked.z print('xarray version:' + xr.__version__) newds.unstack(dim='z')

If I do newds = newds.reset_index('z') just before the last line, it is solved for my minimal example. But it still doesn't work for my real problem and I don't think it is the best way to proceed.

Many thanks for your help, Adrien

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Can't unstack concatenated DataArrays 1384465119
1433104955 https://github.com/pydata/xarray/issues/7076#issuecomment-1433104955 https://api.github.com/repos/pydata/xarray/issues/7076 IC_kwDOAMm_X85Va3I7 ACHMartin 18679148 2023-02-16T13:41:12Z 2023-02-16T13:41:12Z NONE

Hi @benbovy, my code works for 2 dimensions, but it doesn't with 1D. I think the error comes from .set_index(z=['across']) which delivers a "PandasIndex(Int64Index(" and not the expected "PandasIndex(MultiIndex(" for unstack.

I created a Pandas-MultiIndex "MultiIndex([((0,), (1,))], names=['z', 'across'])" (see code just below), but it is not exactly the same one as the one created by .stack() "PandasIndex(MultiIndex([(0,),(1,)], name='z'))" and I didn't find out how to pass the 'index' to xarray. python import pandas as pd tuples = [(0,),(1,)], index = pd.MultiIndex.from_tuples(tuples, names=["z","across"]) index

My modified minimal example is as below: python import xarray as xr ds = xr.Dataset( data_vars=dict( mydata = ( ['across', 'along'], [[0,1],[2,3]]) ), coords=dict( # <- changed across=[0,1], # <- changed along=[0,1], # <- changed ), # <- changed ) stacked = ds.isel(along=0).stack(z=["across"]) # <- changed newlist = [None] * stacked.z.size for ii, zindex in enumerate(stacked.z.data): newlist[ii] = stacked.mydata.sel(z=zindex) newds = xr.concat(newlist, dim='z') newds = newds.set_index(z=['across']) # <- changed newds.unstack(dim='z') # Fail with ValueError: cannot unstack dimensions that do not have exactly one multi-index: ('z',)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Can't unstack concatenated DataArrays 1384465119
1431736710 https://github.com/pydata/xarray/issues/7076#issuecomment-1431736710 https://api.github.com/repos/pydata/xarray/issues/7076 IC_kwDOAMm_X85VVpGG ACHMartin 18679148 2023-02-15T17:24:27Z 2023-02-15T17:24:27Z NONE

Many thanks for the explanation and the rapid answer. I am not very familiar with multi-index.

My real problem works with a DataSet with different sort of variables:

ipdb> lmmap <xarray.Dataset> Dimensions: (x_variables: 4, Observables: 2, Antenna: 4, z: 4, Ambiguities: 4, fun_variables: 8, extrema: 2) Coordinates: * x_variables (x_variables) <U3 'u' 'v' 'c_u' 'c_v' * Observables (Observables) <U6 'sigma0' 'RVL' * Antenna (Antenna) <U4 'Fore' 'MidV' 'MidH' 'Aft' fun_variables (Observables, Antenna) int64 0 1 2 3 4 5 6 7 Dimensions without coordinates: z, Ambiguities, extrema Data variables: (12/17) x (z, Ambiguities, x_variables) float64 -4.503 7.8 ... -0.4265 active_mask (z, Ambiguities, x_variables) int64 0 0 0 0 0 0 ... 0 0 0 0 0 grad (z, Ambiguities, x_variables) float64 7.816e-11 ... -1.873... fun (z, Ambiguities, Observables, Antenna) float64 0.001137 ..... jac (z, Ambiguities, fun_variables, x_variables) float64 0.359... x0 (z, Ambiguities, x_variables) float64 -7.002 10.03 ... 1.219 ... ... message (z, Ambiguities) <U42 '`xtol` termination condition is sat... success (z, Ambiguities) bool True True True True ... True True True method (z) <U3 'trf' 'trf' 'trf' 'trf' xtol (z) float64 0.001 0.001 0.001 0.001 x_scale (z, x_variables) float64 7.0 7.0 0.5 0.5 ... 7.0 7.0 0.5 0.5 bounds (z, extrema, x_variables) int64 -30 -30 -5 -5 ... 30 30 5 5

I don't know where I should apply set_index(z=["across", "along"]) I tried on the full DataSet or a single DataArray but without success. I get the following error:

ValueError: across, along variable(s) do not exist

Which is obvious as across and along variables disappeared. Thank you, I will dig in this direction why it happens.

However, it works perfectly with the minimal example. Many thanks

Thanks @benbovy, my issue is now resolved, once I have enabled the coords to follow.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Can't unstack concatenated DataArrays 1384465119
1431676036 https://github.com/pydata/xarray/issues/7076#issuecomment-1431676036 https://api.github.com/repos/pydata/xarray/issues/7076 IC_kwDOAMm_X85VVaSE ACHMartin 18679148 2023-02-15T16:51:49Z 2023-02-15T16:51:49Z NONE

I didn't see any warning for this

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Can't unstack concatenated DataArrays 1384465119
1431529928 https://github.com/pydata/xarray/issues/7076#issuecomment-1431529928 https://api.github.com/repos/pydata/xarray/issues/7076 IC_kwDOAMm_X85VU2nI ACHMartin 18679148 2023-02-15T15:15:23Z 2023-02-15T15:20:58Z NONE

Many thanks for the explanation and the rapid answer. I am not very familiar with multi-index.

My real problem works with a DataSet with different sort of variables:

ipdb> lmmap <xarray.Dataset> Dimensions: (x_variables: 4, Observables: 2, Antenna: 4, z: 4, Ambiguities: 4, fun_variables: 8, extrema: 2) Coordinates: * x_variables (x_variables) <U3 'u' 'v' 'c_u' 'c_v' * Observables (Observables) <U6 'sigma0' 'RVL' * Antenna (Antenna) <U4 'Fore' 'MidV' 'MidH' 'Aft' fun_variables (Observables, Antenna) int64 0 1 2 3 4 5 6 7 Dimensions without coordinates: z, Ambiguities, extrema Data variables: (12/17) x (z, Ambiguities, x_variables) float64 -4.503 7.8 ... -0.4265 active_mask (z, Ambiguities, x_variables) int64 0 0 0 0 0 0 ... 0 0 0 0 0 grad (z, Ambiguities, x_variables) float64 7.816e-11 ... -1.873... fun (z, Ambiguities, Observables, Antenna) float64 0.001137 ..... jac (z, Ambiguities, fun_variables, x_variables) float64 0.359... x0 (z, Ambiguities, x_variables) float64 -7.002 10.03 ... 1.219 ... ... message (z, Ambiguities) <U42 '`xtol` termination condition is sat... success (z, Ambiguities) bool True True True True ... True True True method (z) <U3 'trf' 'trf' 'trf' 'trf' xtol (z) float64 0.001 0.001 0.001 0.001 x_scale (z, x_variables) float64 7.0 7.0 0.5 0.5 ... 7.0 7.0 0.5 0.5 bounds (z, extrema, x_variables) int64 -30 -30 -5 -5 ... 30 30 5 5

I don't know where I should apply set_index(z=["across", "along"]) I tried on the full DataSet or a single DataArray but without success. I get the following error:

ValueError: across, along variable(s) do not exist

Which is obvious as across and along variables disappeared. Thank you, I will dig in this direction why it happens.

However, it works perfectly with the minimal example. Many thanks

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Can't unstack concatenated DataArrays 1384465119
852069023 https://github.com/pydata/xarray/issues/2304#issuecomment-852069023 https://api.github.com/repos/pydata/xarray/issues/2304 MDEyOklzc3VlQ29tbWVudDg1MjA2OTAyMw== ACHMartin 18679148 2021-06-01T12:03:55Z 2021-06-07T20:48:00Z NONE

Dear all and thank you for your work on Xarray,

Link to @magau comment, I have a netcdf with multiple variables in different format (float, short, byte). Using open_mfdataset 'short' and 'byte' are converted in 'float64' (no scaling, but some masking for the float data). It doesn't raise major issue for me, but it is taking plenty of memory space for nothing.

Below an example of the 3 format from (ncdump -h): short total_nobs(time, lat, lon) ; total_nobs:long_name = "Number of SSS in the time interval" ; total_nobs:valid_min = 0s ; total_nobs:valid_max = 10000s ; float pct_var(time, lat, lon) ; pct_var:_FillValue = NaNf ; pct_var:long_name = "Percentage of SSS_variability that is expected to be not explained by the products" ; pct_var:units = "%" ; pct_var:valid_min = 0. ; pct_var:valid_max = 100. ; byte sss_qc(time, lat, lon) ; sss_qc:long_name = "Sea Surface Salinity Quality, 0=Good; 1=Bad" ; sss_qc:valid_min = 0b ; sss_qc:valid_max = 1b ;

And how they appear after opening in as xarray using open_mfdataset: total_nobs (time, lat, lon) float64 dask.array<chunksize=(48, 584, 1388), meta=np.ndarray> pct_var (time, lat, lon) float32 dask.array<chunksize=(48, 584, 1388), meta=np.ndarray> sss_qc (time, lat, lon) float64 dask.array<chunksize=(48, 584, 1388), met

Is there any recommandation? Regards

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  float32 instead of float64 when decoding int16 with scale_factor netcdf var using xarray  343659822
663171676 https://github.com/pydata/xarray/issues/4246#issuecomment-663171676 https://api.github.com/repos/pydata/xarray/issues/4246 MDEyOklzc3VlQ29tbWVudDY2MzE3MTY3Ng== ACHMartin 18679148 2020-07-23T18:46:51Z 2020-07-23T18:46:51Z NONE

thank you for the suggestion

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords; proposition for a new option for combine_attrs = 'dim'  663649344
662503816 https://github.com/pydata/xarray/issues/4247#issuecomment-662503816 https://api.github.com/repos/pydata/xarray/issues/4247 MDEyOklzc3VlQ29tbWVudDY2MjUwMzgxNg== ACHMartin 18679148 2020-07-22T14:59:16Z 2020-07-22T14:59:16Z NONE

With your explanation, it is now clearer and it works fine. If it is possible to add your sentence explanation to the ValueError it could be good. Many thanks for your help.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  plot/utils get_axis cannot use subplot_kws with existing ax 663769801

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 883.075ms · About: xarray-datasette