-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEPR offsets: rename 'M' to 'ME' (#52064)
* Frequency: raise warnings when using ‘M’ frequency * Frequency: raise warnings when using ‘M’ frequency II * remove is_period and change str representation for freq in Period [skip ci] * remove is_period and fix some tests [skip ci] * fix some tests * fix some tests II * fix tests in pandas/tests/indexes/period/ [skip ci] * fix tests in pandas/tests/indexes/period/ and correct timedeltas.pyx * update frequencies.py, resample.py, and fix some tests * modify pandas/tseries/frequencies.py * fix tests * fix tests II * fix tests III * rename 'M' to 'ME' in docs * rename 'M' to 'ME' in docs II * rename 'M' to 'ME' in docs III * rename 'M' to 'ME' in docs IV * rename 'M' to 'ME' in docs V * add is_period to to_offset I * add is_period to to_offset II * correct the definition of period_array(…) and fix 19 tests * add is_period to _parse_dtype_strict() and fix tests * add constant OFFSET_TO_PERIOD_FREQSTR to period.pyx and fix tests * correct definitions of extract_ordinals() and _round(), fix tests * add replacement ME to M in _require_matching_freq, _parsed_string_to_bounds, and fix tests * add the constant PERIOD_TO_OFFSET_FREQSTR to period.pyx, correct definition of _resolution_obj and fix tests * fix tests * add the conversion ME to M to _from_datetime64, period_index, raise_on_incompatible and fix tests * fix some tests with resample * correct definitions of to_period, freqstr and get_period_alias, fix tests for plotting * correct pre-commit failures * add key from Grouper to the constructor of TimeGrouper and fix tests * add to asfreq() from resampler the conversion ME to M, fix tests * fix tests for for PeriodIndex and base tests for resample * correct the constructor of TimeGrouper and fix tests for resample and plotting * correct the definition of use_dynamic_x() and fix tests for plotting * correct the definition of the method use_dynamic_x, fix tests * correct the definition of the asfreq for PeriodArray, _get_period_alias, and fix tests * correct documentation, fix tests * correct docs: rename ME to M for periods * add pytest.mark.xfail to test_to_timestamp_quarterly_bug * correct mypy error attr-defined * correct the definition of variables which convert M/ME to ME/M in dtypes.pyx, declare to_offset in offsets.pyi, fix mypy errors * created the c version for dicts which convert M/ME to ME/M and fix mypy errors * fix doc build error in 09_timeseries.rst and mypy error * correct the constructor of Period, fix mypy errors * replace in _attrname_to_abbrevs ME with M and correct the constructor of Period * add conversion ME/M to Period constructor, add conversion M/ME to maybe_resample and reverse changes in _attrname_to_abbrevs * correct dict “time rules”, correct the definition of _parsed_string_to_bounds, remove is_period from definition _parse_weekly_str and _parse_dtype_strict * remove the argument is_period from _parse_dtype_strict * add to is_subperiod, is_superperiod and _is_monthly both M and ME, correct definitions of _downsample and _maybe_cast_slice_bound * add dict ME to M to the definition of freqstr, constructor of Period and remove pytest.mark.xfail from test_round_trip_current * refactor freqstr, extract_ordinals, and _require_matching_freq for Period, asfreq for resample and _parsed_string_to_bounds for datetimes * refactor _resolution_obj in dtypes.pyx and freqstr in /indexes/datetimelike.py * define a new function freq_to_period_freqstr in dtypes to convert ME to M * refactor use_dynamic_x for plotting and to_period in arrays/datetimes.py * refactor def _check_plot_works in plotting and test_to_period in class TestDatetimeArray * refactor name method of PeriodDtype, refactor __arrow_array__ and add test for ValueError in test_period.py * in PeriodArray refactor _from_datetime64 and remove redundant if in asfreq, add test for ValueError in test_period_index.py and ignore mypy error * correct def _resolution_obj in DatetimeLikeArrayMixin, refactor def freqstr in PeriodArray and add tests ValueError for ME * correct def _resolution_obj in DatetimeLikeArrayMixin and def to_offset, refactor def freqstr in PeriodArray and add tests for ‘ValueError’ and 'UserWarning' * add tests for 'UserWarning' * refactor methods to_period in DatetimeArray, _from_datetime64 in PeriodArray, fix test in plotting * add freq_to_offset_freqstr to convert M to ME, refactor _resolution_obj, add tests for ‘ValueError’ and 'UserWarning' * fix pre-commit failures * correct the definition of to_period in DatetimeArray, refactor _check_plot_works, fix test_asfreq_2M * correct definitions of _resolution_obj in dtypes.pyx and in DatetimeLikeArrayMixin, _attrname_to_abbrevs and fix test_get_attrname_from_abbrev * correct def asfreq in PeriodArray, remove unused function freq_to_offset_freqstr, fix tests * roll back in test_fillna_period dtype Period[M] with capital P * refactor the function raise_on_incompatible * fix mypy error in pandas/core/arrays/period.py * fix ruff error in pandas/tests/arrays/period/test_constructors.py * remove ME from definitions of is_monthly, is_subperiod, correct _maybe_coerce_freq and test_period_ordinal_start_values * fix test_dti_to_period_2monthish * update whatsnew/v2.1.0.rst * add an example for old/new behavior in whatsnew/v2.1.0.rst * corrected typo * replace name of section Deprecations with Other Deprecations * remove ME form is_superperiod, refactored tests * correct a test * move some tests to a new place * correct def asfreq for resampling, refactor asfreq for Period, fix tests * correct tests * correct def _shift_with_freq and fix test for shift * correct docs for asfreq in PeriodArray * correct def _shift_with_freq * add ‘me’ to _dont_uppercase, correct _require_matching_freq, fix tests * minor corrections * correct whatsnew * correct an example in user_guide/reshaping.rst * fix tests for plotting * correct tests for plotting * remove from OFFSET_TO_PERIOD_FREQSTR deprecated freqstr, fix tests
- Loading branch information
Showing
96 changed files
with
726 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.