| 798 | 798 | for level in range(5, -1, -1): |
| 799 | 799 | if len(np.unique(tickdate[:, level])) > 1: |
| 800 | 800 | if level < 2: |
| 801 | show_offset = False | |
| 801 | # For year level (0), we don't need offset since year is in labels | |
| 802 | # For month level (1), we need offset if year is not shown in any label | |
| 803 | if level == 0: | |
| 804 | show_offset = False | |
| 805 | elif level == 1: | |
| 806 | # Check if any tick is January (which would show the year) | |
| 807 | # or if the year changes across ticks | |
| 808 | years_unique = len(np.unique(tickdate[:, 0])) | |
| 809 | has_january = any(tickdate[i, 1] == 1 for i in range(len(tickdate))) | |
| 810 | if years_unique == 1 and not has_january: | |
| 811 | # Same year but no January tick, so we need offset to show year | |
| 812 | show_offset = True | |
| 813 | else: | |
| 814 | show_offset = False | |
| 815 | elif level == 2: | |
| 816 | # For day level (2), check if year is shown in any tick label | |
| 817 | # If not, we should show it in the offset | |
| 818 | years_unique = len(np.unique(tickdate[:, 0])) | |
| 819 | if years_unique == 1: | |
| 820 | # Same year, check if any tick shows the year | |
| 821 | year_shown = False | |
| 822 | for nn in range(len(tickdate)): | |
| 823 | # Check if this tick would show the year | |
| 824 | # Year is shown if: it's January (month=1) or it's the first tick | |
| 825 | if tickdate[nn][1] == 1: # January | |
| 826 | year_shown = True | |
| 827 | break | |
| 828 | # Also check if year format would be used (level 0) | |
| 829 | # This is a simplified check - in practice, the formatter logic is more complex | |
| 830 | if not year_shown: | |
| 831 | # Year not shown in any tick, so show it in offset | |
| 832 | show_offset = True | |
| 833 | else: | |
| 834 | show_offset = False | |
| 835 | else: | |
| 836 | # Multiple years, year will be shown in labels | |
| 837 | show_offset = False | |
| 802 | 838 | break |
| 803 | 839 | elif level == 0: |
| 804 | 840 | # all tickdate are the same, so only micros might be different |
| Test Name | Status |
|---|---|
lib/matplotlib/tests/test_dates.py::test_offset_changes | Fail |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_show_offset[t_delta4-1997-Jan] | Fail |
lib/matplotlib/tests/test_dates.py::test_date_numpyx | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[s]-t00] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[s]-t01] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[s]-t02] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[us]-t00] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[us]-t01] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[us]-t02] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[ms]-t00] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[ms]-t01] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[ms]-t02] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[ns]-t00] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[ns]-t01] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_date2num_numpy[datetime64[ns]-t02] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_NaT[datetime64[s]] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_NaT[datetime64[us]] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_NaT[datetime64[ms]] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_NaT[datetime64[ns]] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_NaT_scalar[s] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_NaT_scalar[ms] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_NaT_scalar[us] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_NaT_scalar[ns] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_empty | Pass |
lib/matplotlib/tests/test_dates.py::test_date_not_empty | Pass |
lib/matplotlib/tests/test_dates.py::test_axhline | Pass |
lib/matplotlib/tests/test_dates.py::test_date_axhspan[png] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_axvspan[png] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_axhline[png] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_axvline[png] | Pass |
lib/matplotlib/tests/test_dates.py::test_too_many_date_ticks | Pass |
lib/matplotlib/tests/test_dates.py::test_RRuleLocator[png] | Pass |
lib/matplotlib/tests/test_dates.py::test_RRuleLocator_dayrange | Pass |
lib/matplotlib/tests/test_dates.py::test_RRuleLocator_close_minmax | Pass |
lib/matplotlib/tests/test_dates.py::test_DateFormatter[png] | Pass |
lib/matplotlib/tests/test_dates.py::test_locator_set_formatter | Pass |
lib/matplotlib/tests/test_dates.py::test_date_formatter_callable | Pass |
lib/matplotlib/tests/test_dates.py::test_date_formatter_usetex[delta0-expected0] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_formatter_usetex[delta1-expected1] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_formatter_usetex[delta2-expected2] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_formatter_usetex[delta3-expected3] | Pass |
lib/matplotlib/tests/test_dates.py::test_drange | Pass |
lib/matplotlib/tests/test_dates.py::test_auto_date_locator | Pass |
lib/matplotlib/tests/test_dates.py::test_auto_date_locator_intmult | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_subsecond | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_show_offset[t_delta0-1997-Jan-01 | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_show_offset[t_delta1-1997-Jan-01 | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_show_offset[t_delta2-1997-Jan-01] | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_show_offset[t_delta3-1997-Jan-02] | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_show_offset[t_delta5-] | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_show_offset[t_delta6-] | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_usetex[t_delta0-expected0] | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_usetex[t_delta1-expected1] | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_usetex[t_delta2-expected2] | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_usetex[t_delta3-expected3] | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_formats | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_zformats | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_tz | Pass |
lib/matplotlib/tests/test_dates.py::test_auto_date_locator_intmult_tz | Pass |
lib/matplotlib/tests/test_dates.py::test_date_inverted_limit[png] | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_dst | Pass |
lib/matplotlib/tests/test_dates.py::test_date2num_dst_pandas | Pass |
lib/matplotlib/tests/test_dates.py::test_rrulewrapper | Pass |
lib/matplotlib/tests/test_dates.py::test_rrulewrapper_pytz | Pass |
lib/matplotlib/tests/test_dates.py::test_yearlocator_pytz | Pass |
lib/matplotlib/tests/test_dates.py::test_YearLocator | Pass |
lib/matplotlib/tests/test_dates.py::test_DayLocator | Pass |
lib/matplotlib/tests/test_dates.py::test_tz_utc | Pass |
lib/matplotlib/tests/test_dates.py::test_num2timedelta[1-tdelta0] | Pass |
lib/matplotlib/tests/test_dates.py::test_num2timedelta[x1-tdelta1] | Pass |
lib/matplotlib/tests/test_dates.py::test_datetime64_in_list | Pass |
lib/matplotlib/tests/test_dates.py::test_change_epoch | Pass |
lib/matplotlib/tests/test_dates.py::test_warn_notintervals | Pass |
lib/matplotlib/tests/test_dates.py::test_change_converter | Pass |
lib/matplotlib/tests/test_dates.py::test_change_interval_multiples | Pass |
lib/matplotlib/tests/test_dates.py::test_epoch2num | Pass |
lib/matplotlib/tests/test_dates.py::test_julian2num | Pass |
lib/matplotlib/tests/test_dates.py::test_DateLocator | Pass |
lib/matplotlib/tests/test_dates.py::test_datestr2num | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_exceptions | Pass |
lib/matplotlib/tests/test_dates.py::test_concise_formatter_call | Pass |
lib/matplotlib/tests/test_dates.py::test_date_ticker_factory[0.02-MinuteLocator] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_ticker_factory[1-HourLocator] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_ticker_factory[19-DayLocator] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_ticker_factory[40-WeekdayLocator] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_ticker_factory[200-MonthLocator] | Pass |
lib/matplotlib/tests/test_dates.py::test_date_ticker_factory[2000-YearLocator] | Pass |
lib/matplotlib/tests/test_dates.py::test_usetex_newline | Pass |
Loading...
Ridges.AI© 2025 Ridges AI. Building the future of decentralized AI development.
