Skip to content

iotools test failures with pandas 3 #2728

@kandersolar

Description

@kandersolar

Looks like there have been some iotools failures for a couple of months. Looks related to the pandas 3.0 release.

Here is a recent run: https://github.com/pvlib/pvlib-python/actions/runs/23688771539/job/69012617049

Error summary:

=========================== short test summary info ============================
FAILED tests/iotools/test_crn.py::test_read_crn - AssertionError: Attributes of DataFrame.iloc[:, 5] (column name="CRX_VN") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_crn.py::test_read_crn_problems - AssertionError: Attributes of DataFrame.iloc[:, 5] (column name="CRX_VN") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_midc.py::test_midc__format_index_tz_conversion - AssertionError: assert zoneinfo.ZoneInfo(key='Etc/GMT+8') == <StaticTzInfo 'Etc/GMT+8'>
 +  where zoneinfo.ZoneInfo(key='Etc/GMT+8') = Timestamp('2018-10-14 00:00:00-0800', tz='Etc/GMT+8').tz
 +  and   <StaticTzInfo 'Etc/GMT+8'> = <function timezone at 0x7f3814b66a30>('Etc/GMT+8')
 +    where <function timezone at 0x7f3814b66a30> = pytz.timezone
FAILED tests/iotools/test_psm4.py::test_get_nsrdb_psm4_tmy - AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'zone'
FAILED tests/iotools/test_psm4.py::test_get_nsrdb_psm4_full_disc - AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'zone'
FAILED tests/iotools/test_psm4.py::test_get_nsrdb_psm4_conus_singleyear - AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'zone'
FAILED tests/iotools/test_psm4.py::test_get_nsrdb_psm4_conus_5min - AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'zone'
FAILED tests/iotools/test_psm4.py::test_read_nsrdb_psm4_buffer - AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'zone'
FAILED tests/iotools/test_psm4.py::test_read_nsrdb_psm4_path - AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'zone'
FAILED tests/iotools/test_sodapro.py::test_read_cams[testfile0-index0-columns0-values0-dtypes0] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="Observation period") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_sodapro.py::test_read_cams[testfile1-index1-columns1-values1-dtypes1] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="Observation period") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_sodapro.py::test_read_cams[testfile2-index2-columns2-values2-dtypes2] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="Observation period") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_sodapro.py::test_read_cams[testfile3-index3-columns3-values3-dtypes3] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="Observation period") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_sodapro.py::test_read_cams_integrated_unmapped_label - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="Observation period") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_sodapro.py::test_get_cams[testfile0-index0-columns0-values0-dtypes0-mcclear] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="Observation period") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_sodapro.py::test_get_cams[testfile1-index1-columns1-values1-dtypes1-cams_radiation] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="Observation period") are different

Attribute "dtype" are different
[left]:  <StringDtype(storage='python', na_value=nan)>
[right]: object
FAILED tests/iotools/test_tmy.py::test_gh865_read_tmy3_feb_leapyear_hr24 - AssertionError: assert False
 +  where False = all(array([3600000000, 3600000000, 3600000000, ..., 3600000000, 3600000000,\n       3600000000], shape=(8759,)) == 3600000000000)
 +    where array([3600000000, 3600000000, 3600000000, ..., 3600000000, 3600000000,\n       3600000000], shape=(8759,)) = <function diff at 0x7f381d8436b0>(array([631173600000000, 631177200000000, 631180800000000, ...,\n       662698800000000, 662702400000000, 662706000000000], shape=(8760,)))
 +      where <function diff at 0x7f381d8436b0> = np.diff
 +      and   array([631173600000000, 631177200000000, 631180800000000, ...,\n       662698800000000, 662702400000000, 662706000000000], shape=(8760,)) = view(<class 'numpy.int64'>)
 +        where view = DatetimeIndex(['1990-01-01 01:00:00-05:00', '1990-01-01 02:00:00-05:00',\n               '1990-01-01 03:00:00-05:00', '...23:00:00-05:00', '1991-01-01 00:00:00-05:00'],\n              dtype='datetime64[us, UTC-05:00]', length=8760, freq=None).view
 +          where DatetimeIndex(['1990-01-01 01:00:00-05:00', '1990-01-01 02:00:00-05:00',\n               '1990-01-01 03:00:00-05:00', '...23:00:00-05:00', '1991-01-01 00:00:00-05:00'],\n              dtype='datetime64[us, UTC-05:00]', length=8760, freq=None) =                           Date (MM/DD/YYYY)  ... PresWth uncert (code)\n1990-01-01 01:00:00-05:00        01/01/1988  .....                     8\n1991-01-01 00:00:00-05:00        12/31/1980  ...                     8\n\n[8760 rows x 71 columns].index
 +        and   <class 'numpy.int64'> = np.int64
====== 17 failed, 156 passed, 15 warnings, 23 rerun in 515.92s (0:08:35) =======

A few warnings as well:

=============================== warnings summary ===============================
tests/iotools/test_bsrn.py::test_parse_bsrn_deprecated
tests/iotools/test_bsrn.py::test_read_bsrn[bsrn-pay0616.dat.gz]
tests/iotools/test_bsrn.py::test_read_bsrn[bsrn-lr0100-pay0616.dat]
tests/iotools/test_bsrn.py::test_read_bsrn_buffer
tests/iotools/test_bsrn.py::test_get_bsrn
tests/iotools/test_bsrn.py::test_get_bsrn
  /home/runner/work/pvlib-python/pvlib-python/pvlib/iotools/bsrn.py:325: Pandas4Warning: 'd' is deprecated and will be removed in a future version. Please use 'D' instead of 'd'.
    LR_0100.index = (start_date+pd.to_timedelta(LR_0100['day']-1, unit='d')

tests/iotools/test_bsrn.py::test_read_bsrn_logical_records
  /home/runner/work/pvlib-python/pvlib-python/pvlib/iotools/bsrn.py:339: Pandas4Warning: 'd' is deprecated and will be removed in a future version. Please use 'D' instead of 'd'.
    LR_0300.index = (start_date+pd.to_timedelta(LR_0300['day']-1, unit='d')

tests/iotools/test_bsrn.py::test_read_bsrn_logical_records
  /home/runner/work/pvlib-python/pvlib-python/pvlib/iotools/bsrn.py:356: Pandas4Warning: 'd' is deprecated and will be removed in a future version. Please use 'D' instead of 'd'.
    LR_0500.index = (start_date+pd.to_timedelta(LR_0500['day']-1, unit='d')

tests/iotools/test_bsrn.py::test_read_bsrn_logical_records
  /home/runner/work/pvlib-python/pvlib-python/pvlib/iotools/bsrn.py:362: Pandas4Warning: Sorting by default when concatenating all DatetimeIndex is deprecated.  In the future, pandas will respect the default of `sort=False`. Specify `sort=True` or `sort=False` to silence this message. If you see this warnings when not directly calling concat, report a bug to pandas.
    data = pd.concat(dfs, axis='columns')

tests/iotools/test_solrad.py::test_get_solrad[testfile0-abq]
tests/iotools/test_solrad.py::test_get_solrad[testfile0-abq]
tests/iotools/test_solrad.py::test_get_solrad[testfile1-msn]
tests/iotools/test_solrad.py::test_get_solrad[testfile1-msn]
tests/iotools/test_solrad.py::test_get_solrad_missing_day
tests/iotools/test_solrad.py::test_get_solrad_missing_day
  /home/runner/work/pvlib-python/pvlib-python/pvlib/iotools/solrad.py:198: Pandas4Warning: 'd' is deprecated and will be removed in a future version, please use 'D' instead.
    dates = pd.date_range(start.floor('d'), end, freq='d')

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions