73f5b0330a3efa63dd052cf3ca78f69936e954c8,features/eolearn/features/interpolation.py,InterpolationTask,_get_unique_times,#Any#Any#,92

Before Change


        seen = set()
        duplicated_ids = [idx for idx, item in enumerate(times) if item in seen or seen.add(item)]

        for idx in duplicated_ids:
            nan_mask = (np.isnan(data[idx - 1]) == np.isnan(data[idx]))
            data[idx - 1, ~nan_mask] = np.nanmean([data[idx - 1, ~nan_mask], data[idx, ~nan_mask]], axis=0)

        times = np.delete(times, duplicated_ids, axis=0)
        data = np.delete(data, duplicated_ids, axis=0)

        return data, times

After Change


        
        seen = set()
        duplicated_indices = np.array([idx for idx, item in enumerate(times) if item in seen or seen.add(item)])
        duplicated_times = np.unique(times[duplicated_indices])

        for time in duplicated_times:
            indices = np.where(times == time)[0]
            nan_mask = np.all(np.isnan(data[indices]), axis=0)
            data[indices[0], ~nan_mask] = np.nanmean(data[indices][:, ~nan_mask], axis=0)

        times = np.delete(times, duplicated_indices, axis=0)
        data = np.delete(data, duplicated_indices, axis=0)

        return data, times
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: sentinel-hub/eo-learn
Commit Name: 73f5b0330a3efa63dd052cf3ca78f69936e954c8
Time: 2018-10-08
Author: lubej.matic@gmail.com
File Name: features/eolearn/features/interpolation.py
Class Name: InterpolationTask
Method Name: _get_unique_times


Project Name: dmlc/dgl
Commit Name: 4cd5c19e513561fc0f12408ce1aea0a5d16f4bbc
Time: 2019-09-15
Author: mctt90@gmail.com
File Name: python/dgl/contrib/dis_kvstore.py
Class Name: KVClient
Method Name: push


Project Name: dmlc/dgl
Commit Name: 4cd5c19e513561fc0f12408ce1aea0a5d16f4bbc
Time: 2019-09-15
Author: mctt90@gmail.com
File Name: python/dgl/contrib/dis_kvstore.py
Class Name: KVClient
Method Name: pull


Project Name: biotite-dev/biotite
Commit Name: b44dc788d6eaf6fe53cb6468763b46a0c4c74a12
Time: 2020-12-22
Author: anter.jacob@gmail.com
File Name: src/biotite/structure/charges.py
Class Name:
Method Name: partial_charges