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 1621385466,PR_kwDOAMm_X85L44E0,7619,don't use `issubdtype` to check for integer dtypes in `polyval`,99545557,closed,0,,,3,2023-03-13T12:24:57Z,2023-03-22T19:54:46Z,2023-03-22T19:54:45Z,CONTRIBUTOR,,0,pydata/xarray/pulls/7619," # Why While running the ""make"" command for building the documentation, I had the following error : (I am on Windows 11 and using Anaconda Prompt as my CLI) ``` WARNING: ources... [ 98%] user-guide/computation >>>------------------------------------------------------------------------- Exception in C:\Users\91942\xarray\doc\user-guide\computation.rst at block ending on line 466 Specify :okexcept: as an option in the ipython:: block to suppress this message --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[83], line 1 ----> 1 xr.polyval(coord=x, coeffs=out.polyfit_coefficients) File ~\anaconda3\envs\xarray-docs\lib\site-packages\xarray\core\computation.py:1958, in polyval(coord, coeffs, degree_dim) 1954 raise ValueError( 1955 f""Dimension `{degree_dim}` should be a coordinate variable with labels."" 1956 ) 1957 if not np.issubdtype(coeffs[degree_dim].dtype, int): -> 1958 raise ValueError( 1959 f""Dimension `{degree_dim}` should be of integer dtype. Received {coeffs[degree_dim].dtype} instead."" 1960 ) 1961 max_deg = coeffs[degree_dim].max().item() 1962 coeffs = coeffs.reindex( 1963 {degree_dim: np.arange(max_deg + 1)}, fill_value=0, copy=False 1964 ) ValueError: Dimension `degree` should be of integer dtype. Received int64 instead. ``` In the file computation.py(present in xarray/core), the program raises an error if the function `np.issubdtype()` returns false. Here, it wanted `coeffs[degree_dim]` to be of `int` data type (windows default `int` data type is `int32`) , but it was of `int64` datatype, and as the documentation of `np.issubdtype()` states [here](https://numpy.org/doc/stable/reference/generated/numpy.issubdtype.html) : ""Similar types of different sizes are not subdtypes of each other"" so the function returned false and the program raised an error. To fix this error, I have changed the following : # What I replaced the `np.issubdtype` call with `obj.dtype.kind not in ""i""` to check if `coeffs[degree_dim]` is a general signed integer data type. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/7619/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1620445862,PR_kwDOAMm_X85L1xGN,7615,Fixed broken link in Issue 7556,99545557,closed,0,,,2,2023-03-12T17:31:31Z,2023-03-12T18:05:28Z,2023-03-12T18:02:58Z,CONTRIBUTOR,,0,pydata/xarray/pulls/7615,"Fixed the link to [Indexing using Datetime Components](https://docs.xarray.dev/en/stable/user-guide/time-series.html#datetime-component-indexing) under the [Datetime Indexing](https://docs.xarray.dev/en/stable/user-guide/time-series.html#datetime-indexing) section. - [x] Closes #7556 ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/7615/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull