Skip to content

Commit

Permalink
Merge pull request #65 from nlesc-nano/concat
Browse files Browse the repository at this point in the history
DEP: Replace `pd.DataFrame.append` with `pd.concat`
  • Loading branch information
BvB93 authored Jan 13, 2022
2 parents 1c3d259 + e40a6b6 commit dfb59f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dataCAT/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def even_index(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
nan_row = get_nan_row(df1)
idx = df2.index[~bool_ar]
df_tmp = pd.DataFrame(len(idx) * [nan_row], index=idx, columns=df1.columns)
return df1.append(df_tmp, sort=True)
return pd.concat([df1, df_tmp], sort=True)


def int_to_slice(int_like: SupportsIndex, seq_len: int) -> slice:
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ ignore = W504 N806
testpaths = dataCAT tests
addopts = --tb=short --doctest-glob='*.py' --doctest-glob='*.rst' --cov=dataCAT --cov-report xml --cov-report term --cov-report html --doctest-modules
markers = slow: A marker for slow tests.
filterwarnings =
ignore::DeprecationWarning:numpy.distutils.*

# Define `python setup.py build_sphinx`
[build_sphinx]
Expand Down
7 changes: 2 additions & 5 deletions tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import copy
import shutil
import pickle
import warnings
from types import MappingProxyType
from os.path import join, abspath
from pathlib import Path

import h5py
import numpy as np
import pandas as pd
import pytest

from scm.plams import readpdb
from nanoutils import delete_finally
Expand Down Expand Up @@ -220,10 +220,7 @@ def test_update_hdf5_settinga() -> None:
pass


@pytest.mark.skipif(DB.mongodb is None, reason="MongoDB server not found")
def test_update_mbongodb() -> None:
"""Test :meth:`~dataCAT.Database.update_mbongodb`."""
if DB.mongodb is None:
warnings.warn("MongoDB server not found; skipping test", category=RuntimeWarning)
return

DB.update_mongodb('ligand')

0 comments on commit dfb59f9

Please sign in to comment.