OGGM / massbalance-sandbox

New generation of OGGM mass-balance models
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

Pytests issues: pandas append deprecation #48

Open bearecinos opened 5 months ago

bearecinos commented 5 months ago

@fmaussion @lilianschuster

This is the first post (out of 4 for now) with a list of issues and possible fixes that I've found so far by trying to upgrade the mass-balance sandbox pytests and the notebooks, to be used with the latest OGGM version. We can discuss some of these on the meeting later (I'm just posting so we can keep track of things).

First issue, which sort of kills many of the pytests is the use of .append() on pandas dataframes but seem to be fix by the code below. This results with only 6 failing tests (easier to manage).

As of pandas 2.0, append (previously deprecated) was removed.

replace mbmod_daily_oneflowline.py#L3894

self._mb_debug_container = pd.concat([self._mb_debug_container, pd_out], ignore_index=True) and

mbmod_daily_oneflowline.py#L4579

self._mb_debug_container = pd.concat([self._mb_debug_container, pd_out], ignore_index=True)

BTW: I tried to put labels but probably Lili might have the correct Repo rights to generate them.