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

Commit 4b7cfcd

Browse files
authored
Groupby limitations (#782)
1 parent 8d19f30 commit 4b7cfcd

1 file changed

Lines changed: 60 additions & 10 deletions

File tree

sdc/datatypes/hpat_pandas_groupby_functions.py

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252
from sdc.str_ext import string_type
5353

5454

55+
performance_limitation = "This function may reveal slower performance than Pandas* on user system.\
56+
Users should exercise a tradeoff between staying in JIT-region with that function or\
57+
going back to interpreter mode."
58+
59+
5560
@sdc_register_jitable
5661
def merge_groupby_dicts_inplace(left, right):
5762
""" Merges one internal groupby dictionary (right) into another one (left) and returns
@@ -625,7 +630,12 @@ def sdc_pandas_series_groupby_var(self, ddof=1, *args):
625630
sdc_pandas_dataframe_groupby_count.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
626631
'method_name': 'count',
627632
'example_caption': 'Compute count of group, excluding missing values.',
628-
'limitations_block': '',
633+
'limitations_block':
634+
f"""
635+
Limitations
636+
-----------
637+
- {performance_limitation}
638+
""",
629639
'see_also':
630640
"""
631641
.. seealso::
@@ -641,7 +651,12 @@ def sdc_pandas_series_groupby_var(self, ddof=1, *args):
641651
sdc_pandas_dataframe_groupby_max.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
642652
'method_name': 'max',
643653
'example_caption': 'Compute max of group values.',
644-
'limitations_block': '',
654+
'limitations_block':
655+
f"""
656+
Limitations
657+
-----------
658+
- {performance_limitation}
659+
""",
645660
'see_also': '',
646661
'extra_params': ''
647662
})
@@ -650,7 +665,12 @@ def sdc_pandas_series_groupby_var(self, ddof=1, *args):
650665
sdc_pandas_dataframe_groupby_mean.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
651666
'method_name': 'mean',
652667
'example_caption': 'Compute mean of groups, excluding missing values.',
653-
'limitations_block': '',
668+
'limitations_block':
669+
f"""
670+
Limitations
671+
-----------
672+
- {performance_limitation}
673+
""",
654674
'see_also':
655675
"""
656676
.. seealso::
@@ -666,7 +686,12 @@ def sdc_pandas_series_groupby_var(self, ddof=1, *args):
666686
sdc_pandas_dataframe_groupby_median.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
667687
'method_name': 'median',
668688
'example_caption': 'Compute median of groups, excluding missing values.',
669-
'limitations_block': '',
689+
'limitations_block':
690+
f"""
691+
Limitations
692+
-----------
693+
- {performance_limitation}
694+
""",
670695
'see_also':
671696
"""
672697
.. seealso::
@@ -682,7 +707,12 @@ def sdc_pandas_series_groupby_var(self, ddof=1, *args):
682707
sdc_pandas_dataframe_groupby_min.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
683708
'method_name': 'min',
684709
'example_caption': 'Compute min of group values.',
685-
'limitations_block': '',
710+
'limitations_block':
711+
f"""
712+
Limitations
713+
-----------
714+
- {performance_limitation}
715+
""",
686716
'see_also': '',
687717
'extra_params': ''
688718
})
@@ -691,7 +721,12 @@ def sdc_pandas_series_groupby_var(self, ddof=1, *args):
691721
sdc_pandas_dataframe_groupby_prod.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
692722
'method_name': 'prod',
693723
'example_caption': 'Compute prod of group values.',
694-
'limitations_block': '',
724+
'limitations_block':
725+
f"""
726+
Limitations
727+
-----------
728+
- {performance_limitation}
729+
""",
695730
'see_also': '',
696731
'extra_params': ''
697732
})
@@ -700,7 +735,12 @@ def sdc_pandas_series_groupby_var(self, ddof=1, *args):
700735
sdc_pandas_dataframe_groupby_std.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
701736
'method_name': 'std',
702737
'example_caption': 'Compute standard deviation of groups, excluding missing values.',
703-
'limitations_block': '',
738+
'limitations_block':
739+
f"""
740+
Limitations
741+
-----------
742+
- {performance_limitation}
743+
""",
704744
'see_also':
705745
"""
706746
.. seealso::
@@ -716,16 +756,26 @@ def sdc_pandas_series_groupby_var(self, ddof=1, *args):
716756
sdc_pandas_dataframe_groupby_sum.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
717757
'method_name': 'sum',
718758
'example_caption': 'Compute sum of groups, excluding missing values.',
719-
'limitations_block': '',
759+
'limitations_block':
760+
f"""
761+
Limitations
762+
-----------
763+
- {performance_limitation}
764+
""",
720765
'see_also': '',
721766
'extra_params': ''
722767
})
723768

724769

725770
sdc_pandas_dataframe_groupby_var.__doc__ = sdc_pandas_dataframe_groupby_docstring_tmpl.format(**{
726-
'method_name': 'sum',
771+
'method_name': 'var',
727772
'example_caption': 'Compute variance of groups, excluding missing values.',
728-
'limitations_block': '',
773+
'limitations_block':
774+
f"""
775+
Limitations
776+
-----------
777+
- {performance_limitation}
778+
""",
729779
'see_also':
730780
"""
731781
.. seealso::

0 commit comments

Comments
 (0)