Browse Source

[ENH] Move import swipl to init of class

pull/1/head
Tony-HYX 2 years ago
parent
commit
16140a94c0
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      abl/__version__.py
  2. +2
    -1
      abl/reasoning/kb.py

+ 1
- 1
abl/__version__.py View File

@@ -1,3 +1,3 @@
VERSION = (0, 1, 0)
VERSION = (0, 1, 2)


__version__ = ".".join(map(str, VERSION)) __version__ = ".".join(map(str, VERSION))

+ 2
- 1
abl/reasoning/kb.py View File

@@ -9,7 +9,6 @@ from multiprocessing import Pool
from typing import Callable, Any, List, Optional from typing import Callable, Any, List, Optional


import numpy as np import numpy as np
import pyswip


from ..utils.logger import print_log from ..utils.logger import print_log
from ..utils.cache import abl_cache from ..utils.cache import abl_cache
@@ -465,6 +464,8 @@ class PrologKB(KBBase):
""" """


def __init__(self, pseudo_label_list: List[Any], pl_file: str): def __init__(self, pseudo_label_list: List[Any], pl_file: str):
import pyswip
super().__init__(pseudo_label_list) super().__init__(pseudo_label_list)
self.pl_file = pl_file self.pl_file = pl_file
self.prolog = pyswip.Prolog() self.prolog = pyswip.Prolog()


Loading…
Cancel
Save