issue_comments: 857563427
This data as json
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/issues/2037#issuecomment-857563427 | https://api.github.com/repos/pydata/xarray/issues/2037 | 857563427 | MDEyOklzc3VlQ29tbWVudDg1NzU2MzQyNw== | 40183561 | 2021-06-09T10:03:22Z | 2021-06-10T12:39:04Z | CONTRIBUTOR | I had a go at working on this, as mentioned in #5448 it could be a fix in https://github.com/pydata/xarray/blob/ce01f42134962b63d453657c5cb649ebf152283d/xarray/conventions.py#L707 I couldn't see how to fix it in there but tried a fix at the end of https://github.com/pydata/xarray/blob/ce01f42134962b63d453657c5cb649ebf152283d/xarray/conventions.py#L813 for bounds and coordinate variables. See below: ```python def cf_encoder(variables, attributes): """ Encode a set of CF encoded variables and attributes. Takes a dicts of variables and attributes and encodes them to conform to CF conventions as much as possible. This includes masking, scaling, character array handling, and CF-time encoding.
``` tests to add into ```python def test_fill_value_none_for_coordinate_variables(): # need to be floats so _FillValue is added temp = 273.15 + 25 * np.random.randn(2, 2) lon = [0.0, 5.0] lat = [10.0, 20.0]
def test_fill_value_none_for_bounds_variables(): # need to be floats so _FillValue is added temp = 273.15 + 25 * np.random.randn(2, 2) lat_bnds = np.arange(4.0).reshape((2, 2)) lon = [0.0, 5.0] lat = [10.0, 20.0]
``` but I couldn't quite get this to work, with some tests in |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
310833761 |