From 16140a94c05b33bd2b1dff1d3cfce6324e1858be Mon Sep 17 00:00:00 2001 From: Tony-HYX <605698554@qq.com> Date: Mon, 25 Dec 2023 10:56:57 +0800 Subject: [PATCH] [ENH] Move import swipl to init of class --- abl/__version__.py | 2 +- abl/reasoning/kb.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/abl/__version__.py b/abl/__version__.py index 0deec50..e743ddb 100644 --- a/abl/__version__.py +++ b/abl/__version__.py @@ -1,3 +1,3 @@ -VERSION = (0, 1, 0) +VERSION = (0, 1, 2) __version__ = ".".join(map(str, VERSION)) diff --git a/abl/reasoning/kb.py b/abl/reasoning/kb.py index 9786233..507f06f 100644 --- a/abl/reasoning/kb.py +++ b/abl/reasoning/kb.py @@ -9,7 +9,6 @@ from multiprocessing import Pool from typing import Callable, Any, List, Optional import numpy as np -import pyswip from ..utils.logger import print_log from ..utils.cache import abl_cache @@ -465,6 +464,8 @@ class PrologKB(KBBase): """ def __init__(self, pseudo_label_list: List[Any], pl_file: str): + import pyswip + super().__init__(pseudo_label_list) self.pl_file = pl_file self.prolog = pyswip.Prolog()