home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

3 rows where state = "closed" and user = 25015426 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: updated_at, closed_at, created_at (date), updated_at (date), closed_at (date)

type 2

  • issue 2
  • pull 1

state 1

  • closed · 3 ✖

repo 1

  • xarray 3
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
278453914 MDU6SXNzdWUyNzg0NTM5MTQ= 1755 Is there a reason for why DataArray.swap_dims() cannot be done in place like Dataset.swap_dims? leeviannala 25015426 closed 0     8 2017-12-01T12:37:39Z 2017-12-02T20:09:17Z 2017-12-02T10:13:39Z CONTRIBUTOR      

Problem description

This is a problem if I want to swap_dims in DataArray Accessor.

Code Sample

This is what I'm forced to do: ```python import xarray as xr import numpy as np @xr.register_dataarray_accessor('testing') class TestAccessor(object): def init(self, xarray_obj): self._obj = xarray_obj def the_problem(self): self._obj = self._obj.swap_dims({'x':'x2'}) print(self._obj)

arr = np.random.rand(4,3,2) cube = xr.DataArray(arr, dims=['ya', 'x', 'y'], coords={'y':[1,3], 'ya':[1,2,3,6], 'x':[1,2,5]}) cube.coords['x2'] = ('x', [1,2,3]) cube.testing.the_problem() print(cube) this prints: <xarray.DataArray (ya: 4, x2: 3, y: 2)> array([[[ 0.659583, 0.167555], [ 0.357974, 0.46081 ], [ 0.85115 , 0.845257]],

   [[ 0.280308,  0.777399],
    [ 0.512527,  0.542036],
    [ 0.838603,  0.799414]],

   [[ 0.572031,  0.350464],
    [ 0.205219,  0.812232],
    [ 0.687778,  0.984928]],

   [[ 0.803385,  0.63981 ],
    [ 0.089909,  0.499857],
    [ 0.25266 ,  0.967909]]])

Coordinates: * y (y) int32 1 3 * ya (ya) int32 1 2 3 6 x (x2) int32 1 2 5 * x2 (x2) int32 1 2 3 <xarray.DataArray (ya: 4, x: 3, y: 2)> array([[[ 0.659583, 0.167555], [ 0.357974, 0.46081 ], [ 0.85115 , 0.845257]],

   [[ 0.280308,  0.777399],
    [ 0.512527,  0.542036],
    [ 0.838603,  0.799414]],

   [[ 0.572031,  0.350464],
    [ 0.205219,  0.812232],
    [ 0.687778,  0.984928]],

   [[ 0.803385,  0.63981 ],
    [ 0.089909,  0.499857],
    [ 0.25266 ,  0.967909]]])

Coordinates: * y (y) int32 1 3 * ya (ya) int32 1 2 3 6 * x (x) int32 1 2 5 x2 (x) int32 1 2 3 ``` where the two xarrays are clearly different.

I would want to do: ```python import xarray as xr import numpy as np @xr.register_dataarray_accessor('testing') class TestAccessor(object): def init(self, xarray_obj): self._obj = xarray_obj def the_problem(self): self._obj.swap_dims({'x':'x2'}, inplace = True) print(self._obj)

arr = np.random.rand(4,3,2) cube = xr.DataArray(arr, dims=['ya', 'x', 'y'], coords={'y':[1,3], 'ya':[1,2,3,6], 'x':[1,2,5]}) cube.coords['x2'] = ('x', [1,2,3]) cube.testing.the_problem() print(cube) this would keep the two xarrays the same, as they should be: <xarray.DataArray (ya: 4, x2: 3, y: 2)> array([[[ 0.659583, 0.167555], [ 0.357974, 0.46081 ], [ 0.85115 , 0.845257]],

   [[ 0.280308,  0.777399],
    [ 0.512527,  0.542036],
    [ 0.838603,  0.799414]],

   [[ 0.572031,  0.350464],
    [ 0.205219,  0.812232],
    [ 0.687778,  0.984928]],

   [[ 0.803385,  0.63981 ],
    [ 0.089909,  0.499857],
    [ 0.25266 ,  0.967909]]])

Coordinates: * y (y) int32 1 3 * ya (ya) int32 1 2 3 6 x (x2) int32 1 2 5 * x2 (x2) int32 1 2 3 <xarray.DataArray (ya: 4, x: 3, y: 2)> array([[[ 0.659583, 0.167555], [ 0.357974, 0.46081 ], [ 0.85115 , 0.845257]],

   [[ 0.280308,  0.777399],
    [ 0.512527,  0.542036],
    [ 0.838603,  0.799414]],

   [[ 0.572031,  0.350464],
    [ 0.205219,  0.812232],
    [ 0.687778,  0.984928]],

   [[ 0.803385,  0.63981 ],
    [ 0.089909,  0.499857],
    [ 0.25266 ,  0.967909]]])

Coordinates: * y (y) int32 1 3 * ya (ya) int32 1 2 3 6 x (x2) int32 1 2 5 * x2 (x2) int32 1 2 3 ```

I have version 0.10.0, the newest on conda-forge.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1755/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
252541192 MDU6SXNzdWUyNTI1NDExOTI= 1520 Rasterio CRS-attribute can be None leeviannala 25015426 closed 0     1 2017-08-24T09:29:04Z 2017-09-01T17:58:42Z 2017-09-01T17:58:42Z CONTRIBUTOR      

open_rasterio does not work when rasterio crs is None. It is also clearly visible from the code that this is the case: Here's the code from line 144 onward python attrs = {}` if hasattr(riods, 'crs'): # CRS is a dict-like object specific to rasterio # We convert it back to a PROJ4 string using rasterio itself attrs['crs'] = riods.crs.to_string() if hasattr(riods, 'res'): # (width, height) tuple of pixels in units of CRS attrs['res'] = riods.res if hasattr(riods, 'is_tiled'): # Is the TIF tiled? (bool) # We cast it to an int for netCDF compatibility attrs['is_tiled'] = np.uint8(riods.is_tiled) if hasattr(riods, 'transform'): # Affine transformation matrix (tuple of floats) # Describes coefficients mapping pixel coordinates to CRS attrs['transform'] = tuple(riods.transform)`

I have version 1.0a9 for rasterio and 0.9.6 for xarray. For what I looked, the issue #1466 is related, but not same issue.

CRS is None when I read ENVI-dataset that has no georeferencing with rasterio.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1520/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
252813229 MDExOlB1bGxSZXF1ZXN0MTM3NjEwMzkw 1526 Fixed issue #1520, by adding a if-else that checks for None leeviannala 25015426 closed 0     3 2017-08-25T06:52:14Z 2017-09-01T17:58:42Z 2017-09-01T17:58:42Z CONTRIBUTOR   0 pydata/xarray/pulls/1526

Made this fix for the issue #1520. I simpy added a test for None in the code and tested it with my ENVI-file that caused the problem that I reported.

If I understood the test report correctly, the tests also passed.

  • [x] Closes #1520
  • [x] Tests passed
  • [x] Passes git diff upstream/master | flake8 --diff
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1526/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull

Advanced export

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

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 25.014ms · About: xarray-datasette