home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 216010508

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
216010508 MDU6SXNzdWUyMTYwMTA1MDg= 1316 ValueError not raised when doing difference of two non-intersecting datasets 9655353 closed 0     3 2017-03-22T10:09:43Z 2017-03-23T16:20:23Z 2017-03-23T16:20:23Z NONE      

From the documentation I infer that when doing binary arithmetic operations, a ValueError should be raised when the datasets' variables don't intersect. However, the following happily returns a dataset with empty variable arrays:

python import xarray as xr import numpy as np from datetime import datetime ds = xr.Dataset({ 'first': (['lat', 'lon', 'time'], np.ones([45, 90, 12])), 'second': (['lat', 'lon', 'time'], np.ones([45, 90, 12])), 'lat': np.linspace(-88, 88, 45), 'lon': np.linspace(-178, 178, 90), 'time': [datetime(2000, x, 1) for x in range(1, 13)]}) ds1 = xr.Dataset({ 'first': (['lat', 'lon', 'time'], np.ones([45, 90, 12])), 'second': (['lat', 'lon', 'time'], np.ones([45, 90, 12])), 'lat': np.linspace(-88, 88, 45), 'lon': np.linspace(-178, 178, 90), 'time': [datetime(2003, x, 1) for x in range(1, 13)]}) print(ds-ds1) <xarray.Dataset> Dimensions: (lat: 45, lon: 90, time: 0) Coordinates: * time (time) datetime64[ns] * lat (lat) float64 -88.0 -84.0 -80.0 -76.0 -72.0 -68.0 -64.0 -60.0 ... * lon (lon) float64 -178.0 -174.0 -170.0 -166.0 -162.0 -158.0 -154.0 ... Data variables: first (lat, lon, time) float64 second (lat, lon, time) float64

Feel free to close right away if this is the desired behavior.

EDIT: Xarray version is '0.9.1'

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

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 3 rows from issue in issue_comments
Powered by Datasette · Queries took 0.725ms · About: xarray-datasette