tukiains / cloudnetpy-legacy

Python package for Cloudnet data processing
MIT License
9 stars 8 forks source link

Preventing the `data_orig` from being polluted #29

Open sturmianseq opened 3 years ago

sturmianseq commented 3 years ago

The PR aims to improve the reliability of the test test_fix_old_data_2 in test_meta_for_old_files.py by preventing data_orig from being polluted by calling the method copy.deepcopy.

The test can fail in the following way if data_orig gets polluted:

E       assert 5 == 7
E        +  where 5 = <numpy.ma.core._frommethod object at 0x7f462a6879d0>(masked_array(\n  data=[[0, 1, 2],\n        [3, --, 5],\n        [--, --, --]],\n  mask=[[False, False, False],\n        [False,  True, False],\n        [ True,  True,  True]],\n  fill_value=999999))
E        +    where <numpy.ma.core._frommethod object at 0x7f462a6879d0> = ma.count