biocore / emperor

Emperor a tool for the analysis and visualization of large microbial ecology datasets
http://biocore.github.io/emperor/
Other
52 stars 50 forks source link

Test suite error with pandas 1.5 #810

Closed tillea closed 1 year ago

tillea commented 1 year ago

Hi, Debian wants to migrate to pandas 1.5. There is a bug report that there is a test suite error:

=================================== FAILURES ===================================
_________________ TopLevelTests.test_initial_unbalanced_ignore _________________

self = <tests.test_core.TopLevelTests testMethod=test_initial_unbalanced_ignore>

    def test_initial_unbalanced_ignore(self):
        expected = self.mf.copy()

        mf = self.mf.copy()
        mf.drop(['PC.634'], inplace=True)

        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter('always')
>           emp = Emperor(self.ord_res, mf, remote=self.url,
                          ignore_missing_samples=True)

tests/test_core.py:285:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
emperor/core.py:222: in __init__
    self.mf = self._validate_metadata(self.mf, self.ordination.samples,
emperor/core.py:335: in _validate_metadata
    pad = pd.DataFrame(index=difference, columns=metadata.columns,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <[AttributeError("'DataFrame' object has no attribute '_mgr'") raised in repr()] DataFrame object at 0x7f7295b305b0>
data = {}, index = {'PC.634'}
columns = Index(['Treatment', 'DOB', 'Description'], dtype='object')
dtype = dtype('<U'), copy = None

    def __init__(
        self,
        data=None,
        index: Axes | None = None,
        columns: Axes | None = None,
        dtype: Dtype | None = None,
        copy: bool | None = None,
    ) -> None:

        if data is None:
            data = {}
        if dtype is not None:
            dtype = self._validate_dtype(dtype)

        if isinstance(data, DataFrame):
            data = data._mgr

        if isinstance(data, (BlockManager, ArrayManager)):
            # first check if a Manager is passed without any other arguments
            # -> use fastpath (without checking Manager type)
            if index is None and columns is None and dtype is None and not copy:
                # GH#33357 fastpath
                NDFrame.__init__(self, data)
                return

        manager = get_option("mode.data_manager")

        # GH47215
        if index is not None and isinstance(index, set):
>           raise ValueError("index cannot be a set")
E           ValueError: index cannot be a set

/usr/lib/python3/dist-packages/pandas/core/frame.py:636: ValueError
=============================== warnings summary ===============================

You can also red the full build log.

Kind regards, Andreas.

tillea commented 1 year ago

Is there any chance to tackle this issue?

ElDeveloper commented 1 year ago

Yes, I’ll take a stab at this in the coming days. Thanks for reporting.

On Jan 12, 2023, at 11:16 PM, Andreas Tille @.***> wrote:

Is there any chance to tackle this issue?

— Reply to this email directly, view it on GitHubhttps://github.com/biocore/emperor/issues/810#issuecomment-1381410629, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAC3UC72E23VITAUFK2BCJ3WSD6M5ANCNFSM6AAAAAASPIZMQQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>