home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

32 rows where user = 85085 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 14

  • Generalize handling of chunked array types 6
  • Use pytorch as backend for xarrays 4
  • CF encoding should preserve vlen dtype for empty arrays 4
  • Add options to control expand/collapse of sections in display of Dataset and DataArray 3
  • provide set_option `collapse_html` to control HTML repr collapsed state 2
  • Alternative parallel execution frameworks in xarray 2
  • More Array API changes 2
  • array api - Add tests for aggregations 2
  • Task naming for general chunkmanagers 2
  • Fix exception when display_expand_data=False for file-backed array. 1
  • Zarr backend should avoid checking for invalid encodings 1
  • `dtype` of `zarr` array unexpectedly changes when `fill_value` is specified 1
  • Zarr store array dtype changes for empty object string 1
  • Make `broadcast` and `concat` work with the Array API 1

user 1

  • tomwhite · 32 ✖

author_association 1

  • CONTRIBUTOR 32
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1573764660 https://github.com/pydata/xarray/pull/7862#issuecomment-1573764660 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dzb40 tomwhite 85085 2023-06-02T13:44:43Z 2023-06-02T13:44:43Z CONTRIBUTOR

@kmuehlbauer thanks for adding tests! I'm not sure what the mypy error is either, I'm afraid...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1561308333 https://github.com/pydata/xarray/pull/7862#issuecomment-1561308333 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dD6yt tomwhite 85085 2023-05-24T14:51:23Z 2023-05-24T14:51:23Z CONTRIBUTOR

So it looks like the changes here with the fix in my branch will get your issue resolved @tomwhite, right?

Yes - thanks!

I'm a bit worried, that this might break other users workflows, if they depend on the current conversion to floating point for some reason.

The floating point default is preserved if you do e.g. xr.Dataset({"a": np.array([], dtype=object)}). The change here will only convert to string if there is extra metadata present that says it is a string.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1561240314 https://github.com/pydata/xarray/pull/7862#issuecomment-1561240314 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dDqL6 tomwhite 85085 2023-05-24T14:12:49Z 2023-05-24T14:12:49Z CONTRIBUTOR

Could you verify the above example, please?

The code looks fine, and I get the same result when I run it with this PR.

Your fix in https://github.com/kmuehlbauer/xarray/tree/preserve-vlen-string-dtype changes the metadata so it is correctly preserved as metadata: {'element_type': <class 'str'>}.

I feel less qualified to evaluate the impact of the netcdf4 fix.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1561143111 https://github.com/pydata/xarray/pull/7862#issuecomment-1561143111 https://api.github.com/repos/pydata/xarray/issues/7862 IC_kwDOAMm_X85dDSdH tomwhite 85085 2023-05-24T13:23:18Z 2023-05-24T13:23:18Z CONTRIBUTOR

Thanks for taking a look @kmuehlbauer and for the useful example code. I hadn't considered the netcdf cases, so thanks for pointing those out.

Engine netcdf4 does not roundtrip here, losing the dtype metadata information. There is special casing for h5netcdf backend, though.

Could netcdf4 do the same special-casing as h5netcdf?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF encoding should preserve vlen dtype for empty arrays 1720045908
1554332081 https://github.com/pydata/xarray/pull/7019#issuecomment-1554332081 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85cpTmx tomwhite 85085 2023-05-19T10:01:06Z 2023-05-19T10:01:06Z CONTRIBUTOR

Thanks for all your hard work on this @TomNicholas!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1536054499 https://github.com/pydata/xarray/issues/7813#issuecomment-1536054499 https://api.github.com/repos/pydata/xarray/issues/7813 IC_kwDOAMm_X85bjlTj tomwhite 85085 2023-05-05T10:30:38Z 2023-05-05T10:30:38Z CONTRIBUTOR

Ah I understand better now. This makes sense - if ChunkManager has a name then the implementation could use that to name tasks.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Task naming for general chunkmanagers 1694956396
1534281206 https://github.com/pydata/xarray/issues/7813#issuecomment-1534281206 https://api.github.com/repos/pydata/xarray/issues/7813 IC_kwDOAMm_X85bc0X2 tomwhite 85085 2023-05-04T08:22:05Z 2023-05-04T08:22:05Z CONTRIBUTOR

If you hover over a node in the SVG representation you'll get a tooltip that shows the call stack and the line number of the top-level user function that invoked the computation. Does that help at all? (That said, I'm open to changing the way it is displayed, or how tasks are named in general.)

BTW should this be moved to a cubed issue?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Task naming for general chunkmanagers 1694956396
1516345065 https://github.com/pydata/xarray/pull/7424#issuecomment-1516345065 https://api.github.com/repos/pydata/xarray/issues/7424 IC_kwDOAMm_X85aYZbp tomwhite 85085 2023-04-20T13:37:13Z 2023-04-20T13:37:13Z CONTRIBUTOR

Related issue: https://github.com/data-apis/array-api/issues/621

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 1
}
  array api - Add tests for aggregations 1522810384
1477628301 https://github.com/pydata/xarray/pull/7019#issuecomment-1477628301 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85YEtGN tomwhite 85085 2023-03-21T10:54:51Z 2023-03-21T10:54:51Z CONTRIBUTOR

I would like to get to the point where you can use xarray with a chunked array without ever importing dask. I think this PR gets very close, but that would be tricky to test because cubed depends on dask (so I can't just run the test suite without dask in the environment

I just released Cubed 0.6.0 which doesn't have a dependency on Dask, so this should be possible now.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1471758792 https://github.com/pydata/xarray/pull/7424#issuecomment-1471758792 https://api.github.com/repos/pydata/xarray/issues/7424 IC_kwDOAMm_X85XuUHI tomwhite 85085 2023-03-16T11:15:33Z 2023-03-16T11:15:33Z CONTRIBUTOR

I was hoping https://github.com/data-apis/array-api-compat might help with this, but I'm not sure it does...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  array api - Add tests for aggregations 1522810384
1469907455 https://github.com/pydata/xarray/pull/7019#issuecomment-1469907455 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85XnQH_ tomwhite 85085 2023-03-15T12:21:23Z 2023-03-15T12:21:23Z CONTRIBUTOR

I think it might make sense for me to remove the CubedManager class from this PR and instead put that & cubed+xarray tests into another repo. That keeps xarray's changes minimal, doesn't require putting cubed in any xarray CI envs, and hopefully allows us to merge the ChunkManager changes here earlier.

That sounds like a good plan to me.

Places dask is still explicitly imported in xarray

There are a few remaining places where I haven't generalised to remove specific import dask calls either because it won't be imported at runtime unless you ask for it, cubed doesn't implement the equivalent function, that function isn't in the array API standard, or because I'm not sure if the dask concept used generalises to other parallel frameworks.

  • [ ] open_mfdataset(..., parallel=True) - there is no cubed.delayed to wrap the open_dataset calls in,
  • [ ] Dataset.__dask_graph__ and all the other similar dask magic methods
  • [ ] dask_array_ops.rolling - uses functions from dask.array.overlap,
  • [ ] dask_array_ops.least_squares - uses dask.array.apply_along_axis and dask.array.linalg.lstsq,
  • [ ] dask_array_ops.push - uses dask.array.reductions.cumreduction

This is a useful list! I hope that we could close the gap for some of these over time.

I would like to get to the point where you can use xarray with a chunked array without ever importing dask. I think this PR gets very close, but that would be tricky to test because cubed depends on dask (so I can't just run the test suite without dask in the environment)

Agreed. I have opened https://github.com/tomwhite/cubed/issues/154 to make it possible to test without a Dask dependency.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1463469875 https://github.com/pydata/xarray/pull/7019#issuecomment-1463469875 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85XOscz tomwhite 85085 2023-03-10T08:50:10Z 2023-03-10T08:50:10Z CONTRIBUTOR

Great work @TomNicholas!

I don't have a strong opinion about the tests, but putting them in a new project to keep xarray changes to a minimum is probably a good idea for the moment.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1373701291 https://github.com/pydata/xarray/pull/7387#issuecomment-1373701291 https://api.github.com/repos/pydata/xarray/issues/7387 IC_kwDOAMm_X85R4QSr tomwhite 85085 2023-01-06T14:18:08Z 2023-01-06T14:18:08Z CONTRIBUTOR

Thanks for the review @Illviljan

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Make `broadcast` and `concat` work with the Array API 1502721600
1330343446 https://github.com/pydata/xarray/issues/7328#issuecomment-1330343446 https://api.github.com/repos/pydata/xarray/issues/7328 IC_kwDOAMm_X85PS24W tomwhite 85085 2022-11-29T09:36:10Z 2022-11-29T09:37:19Z CONTRIBUTOR

This behaviour stems from this part of _infer_dtype where empty object arrays are converted to float arrays:

https://github.com/pydata/xarray/blob/3aa75c8d00a4a2d4acf10d80f76b937cadb666b7/xarray/conventions.py#L156-L157

Is there any reason we couldn't return strings.create_vlen_dtype(str) instead?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Zarr store array dtype changes for empty object string 1466586967
1323743039 https://github.com/pydata/xarray/issues/7292#issuecomment-1323743039 https://api.github.com/repos/pydata/xarray/issues/7292 IC_kwDOAMm_X85O5rc_ tomwhite 85085 2022-11-22T14:12:57Z 2022-11-22T14:12:57Z CONTRIBUTOR

You can work around this by specifying either decode_cf=False or mask_and_scale=False. For example:

python ds = xarray.open_zarr("test.zarr", consolidated=False, decode_cf=False) ds['array'].dtype

prints dtype('int8').

Does that help?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `dtype` of `zarr` array unexpectedly changes when `fill_value` is specified 1451961530
1286703986 https://github.com/pydata/xarray/issues/6807#issuecomment-1286703986 https://api.github.com/repos/pydata/xarray/issues/6807 IC_kwDOAMm_X85MsYty tomwhite 85085 2022-10-21T09:31:29Z 2022-10-21T09:31:29Z CONTRIBUTOR

Cubed implements concat, but perhaps xarray needs richer concat functionality than that?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Alternative parallel execution frameworks in xarray 1308715638
1285349000 https://github.com/pydata/xarray/pull/7019#issuecomment-1285349000 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85MnN6I tomwhite 85085 2022-10-20T11:15:50Z 2022-10-20T11:15:50Z CONTRIBUTOR

@TomNicholas it might be good to rebase this now that #7067 is in.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1260795929 https://github.com/pydata/xarray/pull/7067#issuecomment-1260795929 https://api.github.com/repos/pydata/xarray/issues/7067 IC_kwDOAMm_X85LJjgZ tomwhite 85085 2022-09-28T11:56:30Z 2022-09-28T11:56:30Z CONTRIBUTOR

Updated with all the suggestions. How does this look now?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  More Array API changes 1382574245
1256212506 https://github.com/pydata/xarray/pull/7067#issuecomment-1256212506 https://api.github.com/repos/pydata/xarray/issues/7067 IC_kwDOAMm_X85K4Ega tomwhite 85085 2022-09-23T13:28:01Z 2022-09-23T13:28:01Z CONTRIBUTOR

This is great feedback - thanks @keewis! I will take a look at implementing your suggestions.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  More Array API changes 1382574245
1255158880 https://github.com/pydata/xarray/pull/7019#issuecomment-1255158880 https://api.github.com/repos/pydata/xarray/issues/7019 IC_kwDOAMm_X85K0DRg tomwhite 85085 2022-09-22T15:03:34Z 2022-09-22T15:03:34Z CONTRIBUTOR

I think the manager keyword will also need adding to open_zarr, open_dataset and to_zarr.

I'm interested in trying this out on some of our genomics use cases in sgkit (see https://github.com/pystatgen/sgkit/issues/908), so please let me know when you think it's ready to try @TomNicholas.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Generalize handling of chunked array types 1368740629
1190162973 https://github.com/pydata/xarray/issues/3232#issuecomment-1190162973 https://api.github.com/repos/pydata/xarray/issues/3232 IC_kwDOAMm_X85G8HId tomwhite 85085 2022-07-20T11:35:03Z 2022-07-20T11:35:03Z CONTRIBUTOR

I think it can't be tested with pytorch until they compete pytorch/pytorch#58743, right?

It needs __array_namespace__ to be defined to activate the new code path.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Use pytorch as backend for xarrays 482543307
1189941650 https://github.com/pydata/xarray/issues/3232#issuecomment-1189941650 https://api.github.com/repos/pydata/xarray/issues/3232 IC_kwDOAMm_X85G7RGS tomwhite 85085 2022-07-20T07:45:39Z 2022-07-20T07:45:39Z CONTRIBUTOR

Hi @hsharrison - thanks for offering to do some testing. Here's a little demo script that you could try, by switching numpy.array_api to pytorch: https://github.com/tomwhite/xarray/commit/929812a12818ffaa1187eb860c9b61e3fc03973c

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Use pytorch as backend for xarrays 482543307
1188910765 https://github.com/pydata/xarray/issues/6807#issuecomment-1188910765 https://api.github.com/repos/pydata/xarray/issues/6807 IC_kwDOAMm_X85G3Vat tomwhite 85085 2022-07-19T10:58:18Z 2022-07-19T10:58:18Z CONTRIBUTOR

Thanks for opening this @TomNicholas

The challenge will be defining a parallel computing API that works across all these projects, with their slightly different models.

Agreed. I feel like there's already an implicit set of "chunked array" methods that xarray expects from Dask that could be formalised a bit and exposed as an integration point.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Alternative parallel execution frameworks in xarray 1308715638
1187007032 https://github.com/pydata/xarray/issues/3232#issuecomment-1187007032 https://api.github.com/repos/pydata/xarray/issues/3232 IC_kwDOAMm_X85GwEo4 tomwhite 85085 2022-07-18T10:04:29Z 2022-07-18T10:04:29Z CONTRIBUTOR

Opened #6804

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Use pytorch as backend for xarrays 482543307
1182978725 https://github.com/pydata/xarray/issues/3232#issuecomment-1182978725 https://api.github.com/repos/pydata/xarray/issues/3232 IC_kwDOAMm_X85GgtKl tomwhite 85085 2022-07-13T09:18:51Z 2022-07-13T09:18:51Z CONTRIBUTOR

I started having a look at making xarray work with the array API here: https://github.com/tomwhite/xarray/commit/c72a1c4a4c52152bdab83f60f35615de28e8be7f. Some basic operations work (preserving the underlying array): https://github.com/tomwhite/xarray/commit/929812a12818ffaa1187eb860c9b61e3fc03973c. If there's interest, I'd be happy to turn this into a PR with some tests.

{
    "total_count": 4,
    "+1": 4,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Use pytorch as backend for xarrays 482543307
1072259361 https://github.com/pydata/xarray/issues/6373#issuecomment-1072259361 https://api.github.com/repos/pydata/xarray/issues/6373 IC_kwDOAMm_X84_6WEh tomwhite 85085 2022-03-18T10:06:01Z 2022-03-18T10:06:01Z CONTRIBUTOR

Thanks for confirming @jhamman

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Zarr backend should avoid checking for invalid encodings 1171932478
832596127 https://github.com/pydata/xarray/pull/5235#issuecomment-832596127 https://api.github.com/repos/pydata/xarray/issues/5235 MDEyOklzc3VlQ29tbWVudDgzMjU5NjEyNw== tomwhite 85085 2021-05-05T10:54:17Z 2021-05-05T10:54:17Z CONTRIBUTOR

This is now passing. We could add more tests or even change the representation a little in some cases, but it would be good to merge for the release (since it fixes a bug) if it looks OK to you @keewis.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Fix exception when display_expand_data=False for file-backed array. 870782371
827415452 https://github.com/pydata/xarray/pull/5126#issuecomment-827415452 https://api.github.com/repos/pydata/xarray/issues/5126 MDEyOklzc3VlQ29tbWVudDgyNzQxNTQ1Mg== tomwhite 85085 2021-04-27T08:19:48Z 2021-04-27T08:19:48Z CONTRIBUTOR

Thank you!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add options to control expand/collapse of sections in display of Dataset and DataArray 852280544
826719320 https://github.com/pydata/xarray/pull/5126#issuecomment-826719320 https://api.github.com/repos/pydata/xarray/issues/5126 MDEyOklzc3VlQ29tbWVudDgyNjcxOTMyMA== tomwhite 85085 2021-04-26T10:30:20Z 2021-04-26T10:30:20Z CONTRIBUTOR

@max-sixty yes - I've rebased and updated whats-new.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add options to control expand/collapse of sections in display of Dataset and DataArray 852280544
824952098 https://github.com/pydata/xarray/pull/5126#issuecomment-824952098 https://api.github.com/repos/pydata/xarray/issues/5126 MDEyOklzc3VlQ29tbWVudDgyNDk1MjA5OA== tomwhite 85085 2021-04-22T15:40:02Z 2021-04-22T15:40:02Z CONTRIBUTOR

Thanks for the review @jsignell!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add options to control expand/collapse of sections in display of Dataset and DataArray 852280544
814813584 https://github.com/pydata/xarray/pull/4230#issuecomment-814813584 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDgxNDgxMzU4NA== tomwhite 85085 2021-04-07T10:51:31Z 2021-04-07T10:51:31Z CONTRIBUTOR

Thanks for the suggestions @dcherian!

I've implemented "default" to preserve existing behaviour (i.e. only collapse if greater than preconfigured size limits). See #5126

I haven't implemented the nested options for display_expand - is it worth adding the extra complexity here?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526
814059710 https://github.com/pydata/xarray/pull/4230#issuecomment-814059710 https://api.github.com/repos/pydata/xarray/issues/4230 MDEyOklzc3VlQ29tbWVudDgxNDA1OTcxMA== tomwhite 85085 2021-04-06T11:54:06Z 2021-04-06T11:54:06Z CONTRIBUTOR

I would find it useful to have a generalized version of this for datasets, so it's possible to control independently whether the coordinates, data variables, and attributes sections are expanded by default.

I'd be happy to pick this up if no one else is working on it. I have created a branch to try it out, which adds the options display_expand_attrs, display_expand_coords, display_expand_data, and display_expand_data_vars for controlling both HTML and text representations. All default to True.

One thing I'm not sure about is maintaining the existing behaviour, which is that for the HTML dataset repr all three sections are expanded by default, up to a certain size limit, depending on the section (25 coordinates, 15 data variables, 10 attributes). I couldn't see a simple way to incorporate that, although maybe it's not needed if the sections can be collapsed by setting an option (e.g. xr.set_options(display_expand_attrs=False))?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  provide set_option `collapse_html` to control HTML repr collapsed state 657792526

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 19.123ms · About: xarray-datasette