Skip to content
Snippets Groups Projects
Commit 0ae8552c authored by David Schäfer's avatar David Schäfer
Browse files

Merge branch 'cow' into 'develop'

enable pandas copy_on_write

See merge request !796
parents da4edc76 8a7a4227
No related branches found
No related tags found
1 merge request!796enable pandas copy_on_write
Pipeline #203912 canceled with stages
...@@ -12,7 +12,7 @@ import warnings ...@@ -12,7 +12,7 @@ import warnings
from copy import copy as shallowcopy from copy import copy as shallowcopy
from copy import deepcopy from copy import deepcopy
from functools import partial from functools import partial
from typing import Any, Hashable, Iterable, MutableMapping, overload from typing import Any, Hashable, Iterable, MutableMapping
import numpy as np import numpy as np
import pandas as pd import pandas as pd
...@@ -32,7 +32,7 @@ from saqc.funcs import FunctionsMixin ...@@ -32,7 +32,7 @@ from saqc.funcs import FunctionsMixin
# warnings # warnings
pd.set_option("mode.chained_assignment", "warn") pd.set_option("mode.chained_assignment", "warn")
pd.options.mode.copy_on_write = False pd.set_option("mode.copy_on_write", True)
np.seterr(invalid="ignore") np.seterr(invalid="ignore")
......
...@@ -122,7 +122,7 @@ def test_copy(data: Union[pd.DataFrame, DictOfSeries, Dict[str, pd.Series]]): ...@@ -122,7 +122,7 @@ def test_copy(data: Union[pd.DataFrame, DictOfSeries, Dict[str, pd.Series]]):
# the underling series data is the same # the underling series data is the same
for c in shallow.columns: for c in shallow.columns:
assert shallow._data[c].index is flags._data[c].index assert shallow._data[c].index.equals(flags._data[c].index)
# the underling series data was copied # the underling series data was copied
for c in deep.columns: for c in deep.columns:
......
...@@ -143,7 +143,7 @@ def test_copy(data): ...@@ -143,7 +143,7 @@ def test_copy(data):
assert is_equal(deep, shallow) assert is_equal(deep, shallow)
# underling pandas data was only copied with deep=True # underling pandas data was only copied with deep=True
assert shallow.hist.index is hist.hist.index assert shallow.hist.index.equals(hist.hist.index)
assert deep.hist.index is not hist.hist.index assert deep.hist.index is not hist.hist.index
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment