Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Conversation

@akharche
Copy link
Contributor

@akharche akharche commented Oct 2, 2019

Due to overloaded method 'max' in numba it calls array.max for SeriesType instead of hpat_pandas_series_max. Firstly, need fix in importing.


def hpat_pandas_series_max_impl(self, axis=0, skipna=True, level=None, numeric_only=None):
if skipna:
return np.nanmax(self._data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect Numpy data type returned? I suspect we need Series data type constructed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We return scalars because Series can be returned if level specified. But we don't have multi indexing now and parameter 'level' is not supported.

dtype = (pandas_timestamp_type
if isinstance(dtype, types.NPDatetime) else dtype)
return signature(dtype, *args)
# @bound_function("series.max")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. This is typing stage. What happen if comment out definition of the function here https://github.com/IntelPython/hpat/blob/ea6b1a22ba3a04d4495b6a69bb762c09dc41be67/hpat/hiframes/series_kernels.py#L499



@overload_method(SeriesType, 'max')
def hpat_pandas_series_max(self, axis=0, skipna=True, level=None, numeric_only=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameter skipna=True is still diffrent

Copy link
Contributor

@shssf shssf Oct 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, looked into pandas sources and found

def max(self, axis=None, skipna=True, *args, **kwargs):

it looks like they have documentation issue

Copy link
Contributor

@shssf shssf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to adjust parameters in function


import operator
import pandas
import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please do not rename numpy?

Copy link
Contributor

@fschlimb fschlimb Oct 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not? This is how numpy is used is everywhere else.

Copy link
Contributor

@shssf shssf Oct 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fschlimb to keep clear in the code what exactly is used. This is not a strong requirement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand and I also generally prefer fully qualified names. In this particular case we should stay with common practice (e.g. import numpy as np and import pandas ad pd)

Copy link
Contributor

@shssf shssf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipna=True

@akharche akharche force-pushed the impl_series_max branch 2 times, most recently from 83937ec to 7a25ddd Compare October 4, 2019 10:50
…l_series_max

# Conflicts:
#	hpat/datatypes/hpat_pandas_series_functions.py
@shssf shssf merged commit 2a3535e into IntelPython:master Oct 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants