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/2015#issuecomment-375927133,https://api.github.com/repos/pydata/xarray/issues/2015,375927133,MDEyOklzc3VlQ29tbWVudDM3NTkyNzEzMw==,10050469,2018-03-24T21:45:31Z,2018-03-24T21:45:31Z,MEMBER,"> I am curious why this test is failing in appveyor. > The casting rule of numpy should not depend on the operating system. I'm curious too, but I don't have a windows machine to test it. The tests are green with the float64 casting though","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,308284379 https://github.com/pydata/xarray/pull/2015#issuecomment-375926070,https://api.github.com/repos/pydata/xarray/issues/2015,375926070,MDEyOklzc3VlQ29tbWVudDM3NTkyNjA3MA==,6815844,2018-03-24T21:26:54Z,2018-03-24T21:26:54Z,MEMBER,"I am curious why this test is failing in appveyor. The casting rule of numpy should not depend on the operating system.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,308284379 https://github.com/pydata/xarray/pull/2015#issuecomment-375916591,https://api.github.com/repos/pydata/xarray/issues/2015,375916591,MDEyOklzc3VlQ29tbWVudDM3NTkxNjU5MQ==,6815844,2018-03-24T18:58:57Z,2018-03-24T18:58:57Z,MEMBER,"Thanks @fmaussion . > Is there a way to make sure this line casts to a secure dtype better than my proposed solution to cast everything to a float64 first? How about `np.array([np.int32(2)]) * np.array([np.int64(2)])`? I am not sure whether numpy explains this casting behavior, but I guess this is intentional. This is consistent with ```python In [11]: (np.array([1.0], dtype=np.float32) * 1.0).dtype Out[11]: dtype('float32') ``` where we expect the array dtype takes precedence.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,308284379 https://github.com/pydata/xarray/pull/2015#issuecomment-375914656,https://api.github.com/repos/pydata/xarray/issues/2015,375914656,MDEyOklzc3VlQ29tbWVudDM3NTkxNDY1Ng==,10050469,2018-03-24T18:30:17Z,2018-03-24T18:30:17Z,MEMBER,"The problem comes from a weird numpy casting behavior. Consider: ```python In [1]: import numpy as np In [2]: (np.int32(2) * np.int64(2)).dtype Out[2]: dtype('int64') In [3]: (np.array(np.int32(2)) * np.int64(2)).dtype Out[3]: dtype('int64') In [4]: (np.array([np.int32(2)]) * np.int64(2)).dtype Out[4]: dtype('int32') ``` In the offending line: ```python flat_num_dates * _NS_PER_TIME_DELTA[delta] ``` ``flat_num_dates`` is an array of dtype ``int32`` and ``_NS_PER_TIME_DELTA[delta]`` is a scalar of dtype ``int64``. Is there a way to make sure this line casts to a secure dtype better than my proposed solution to cast everything to a ``float64`` first? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,308284379