Skip to content

Commit 5b62fda

Browse files
committed
fix readonly reverse bug
1 parent aea1cae commit 5b62fda

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

qlib/data/dataset/handler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,15 +442,15 @@ def process_data(self, with_fit: bool = False):
442442
# shared data processors
443443
# 1) assign
444444
_shared_df = self._data
445-
if self._is_proc_readonly(self.shared_processors): # avoid modifying the original data
445+
if not self._is_proc_readonly(self.shared_processors): # avoid modifying the original data
446446
_shared_df = _shared_df.copy()
447447
# 2) process
448448
_shared_df = self._run_proc_l(_shared_df, self.shared_processors, with_fit=with_fit, check_for_infer=True)
449449

450450
# data for inference
451451
# 1) assign
452452
_infer_df = _shared_df
453-
if self._is_proc_readonly(self.infer_processors): # avoid modifying the original data
453+
if not self._is_proc_readonly(self.infer_processors): # avoid modifying the original data
454454
_infer_df = _infer_df.copy()
455455
# 2) process
456456
_infer_df = self._run_proc_l(_infer_df, self.infer_processors, with_fit=with_fit, check_for_infer=True)
@@ -466,10 +466,10 @@ def process_data(self, with_fit: bool = False):
466466
_learn_df = _infer_df
467467
else:
468468
raise NotImplementedError(f"This type of input is not supported")
469-
if self._is_proc_readonly(self.learn_processors): # avoid modifying the original data
469+
if not self._is_proc_readonly(self.learn_processors): # avoid modifying the original data
470470
_learn_df = _learn_df.copy()
471471
# 2) process
472-
_learn_df = self._is_proc_readonly(self.learn_processors, with_fit=True, check_for_infer=False)
472+
_learn_df = self._run_proc_l(self.learn_processors, with_fit=True, check_for_infer=False)
473473

474474
self._learn = _learn_df
475475

0 commit comments

Comments
 (0)