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 89268800,MDU6SXNzdWU4OTI2ODgwMA==,438,`xray.open_mfdataset` concatenates also variables without time dimension,3404817,closed,0,,1172685,13,2015-06-18T11:34:53Z,2017-09-19T16:16:58Z,2015-07-15T21:47:11Z,CONTRIBUTOR,,,,"When opening a multi-file dataset with `xray.open_mfdataset`, also some variables are concatenated that do not have a `time` dimension. My netCDF files contain a lot of those ""static"" variables (e.g. grid spacing etc.). `netCDF4.MFDataset` used to handle those as expected (i.e. did not concatenate them). Is the different behaviour of `xray.open_mfdataset` intentional or due to a bug? Note: I am using `decode_times=False`. ## Example ``` python with xray.open_dataset(files[0], decode_times=False) as single: print single['dz'] ``` ``` array([ 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1000. , 1019.68078613, 1056.44836426, 1105.99511719, 1167.80700684, 1242.41333008, 1330.96777344, 1435.14099121, 1557.12585449, 1699.67956543, 1866.21240234, 2060.90234375, 2288.85205078, 2556.24707031, 2870.57495117, 3240.8371582 , 3677.77246094, 4194.03076172, 4804.22363281, 5524.75439453, 6373.19189453, 7366.94482422, 8520.89257812, 9843.65820312, 11332.46582031, 12967.19921875, 14705.34375 , 16480.70898438, 18209.13476562, 19802.234375 , 21185.95703125, 22316.50976562, 23186.49414062, 23819.44921875, 24257.21679688, 24546.77929688, 24731.01367188, 24844.328125 , 24911.97460938, 24951.29101562, 24973.59375 , 24985.9609375 , 24992.67382812, 24996.24414062, 24998.109375 ]) Coordinates: * z_t (z_t) float32 500.0 1500.0 2500.0 3500.0 4500.0 5500.0 6500.0 ... Attributes: long_name: thickness of layer k units: centimeters ``` ``` python with xray.open_mfdataset(files, decode_times=False) as multiple: print multiple['dz'] ``` ``` dask.array Coordinates: * z_t (z_t) float32 500.0 1500.0 2500.0 3500.0 4500.0 5500.0 6500.0 ... * time (time) float64 3.653e+04 3.656e+04 3.659e+04 3.662e+04 ... Attributes: long_name: thickness of layer k units: centimeters ``` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/438/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 89180768,MDU6SXNzdWU4OTE4MDc2OA==,437,bit of code missing in documentation (http://xray.readthedocs.org/en/latest/io.html#combining-multiple-files),2539828,closed,0,,1172685,1,2015-06-18T02:34:08Z,2015-06-22T15:44:59Z,2015-06-22T15:44:59Z,NONE,,,,"in [http://xray.readthedocs.org/en/latest/io.html#combining-multiple-files](http://xray.readthedocs.org/en/latest/io.html#combining-multiple-files) there is a bit of code missing in the function `read_netcdfs`: instead of: ``` def read_netcdfs(files, dim, transform_func=None): def process_one_path(path): # use a context manager, to ensure the file gets closed after use with xray.open_dataset(path) as ds: # transform_func should do some sort of selection or # aggregation if transform_func is not None: ds = transform_func(ds) # load all data from the transformed dataset, to ensure we can # use it after closing each original file ds.load() return ds paths = sorted(glob(files)) datasets = [process_one_path(p) for p in paths] xray.concat(datasets, dim) ``` it should be: ``` def read_netcdfs(files, dim, transform_func=None): def process_one_path(path): # use a context manager, to ensure the file gets closed after use with xray.open_dataset(path) as ds: # transform_func should do some sort of selection or # aggregation if transform_func is not None: ds = transform_func(ds) # load all data from the transformed dataset, to ensure we can # use it after closing each original file ds.load() return ds paths = sorted(glob(files)) datasets = [process_one_path(p) for p in paths] dset = xray.concat(datasets, dim) return dset ``` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/437/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue