html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/pull/2449#issuecomment-456766782,https://api.github.com/repos/pydata/xarray/issues/2449,456766782,MDEyOklzc3VlQ29tbWVudDQ1Njc2Njc4Mg==,3473068,2019-01-23T11:24:49Z,2019-01-23T11:24:49Z,NONE,"Apologies about adding my thoughts after a bit of a gap on here...
> My only hesitation here is on the name
I like the `to_iris` and `from_iris` method names suggested here. They're consistent with existing functionality available for DataArray, and I think it's reasonable to expect that as DataArrays map to cubes, so also for Datasets and CubeLists. As it's possible for both Datasets and CubeLists to contain only a single object there could be some extra logic to return a DataArray or cube respectively in such a case, but I think that would add needless complexity as it's not hard from a user perspective to get back to the single item from the Dataset or CubeList.
> We have some special logic already for figuring out names in `DataArray.from_iris`
Does this logic include handling multiple cubes of the same name in a single CubeList? Iris will quite happily handle this, but I guess the name:DataArray mapping in Xarray requires unique names. For example:
```python
>>> names = [c.name() for c in cubes]
>>> print(names)
['air_pressure', 'air_pressure', 'air_pressure_at_sea_level', 'air_temperature', 'air_temperature', 'air_temperature', 'air_temperature', 'air_temperature', 'dew_point_temperature', 'geopotential_height', 'relative_humidity', 'relative_humidity', 'specific_humidity', 'surface_air_pressure', 'upward_air_velocity', 'x_wind', 'x_wind', 'x_wind', 'y_wind', 'y_wind', 'y_wind']
```
The differences between these cubes is one or more of:
* one cube describes the phenomenon at the surface, and
* another cube the phenomenon on height or pressure levels, or
* another cube describes the phenomenon after statistical processing, and so on.
If such a case isn't currently handled, it could be handled by using this differing metadata to modify the name used for the key; for example `air_temperature` --> `air_temperature__maximum_1_hr` – so long as returning to a CubeList will also return the names to their originals.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,365367839