Skip to content

Commit 28343ea

Browse files
authored
Merge pull request #349 from dice-group/general_adjustments
Few updates before new release
2 parents db83035 + 7151cb3 commit 28343ea

File tree

4 files changed

+42
-13
lines changed

4 files changed

+42
-13
lines changed

docs/usage/01_introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ontolearn
22

3-
**Version:** ontolearn 0.6.1
3+
**Version:** ontolearn 0.7.0
44

55
**GitHub repository:** [https://github.com/dice-group/Ontolearn](https://github.com/dice-group/Ontolearn)
66

examples/example_knowledge_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
print('*' * 100)
3939

4040
# Direct concept hierarchy from Top to Bottom.
41-
for concept in kb.class_hierarchy().items():
41+
for concept in kb.class_hierarchy.items():
4242
print(f'{concept.get_iri().as_str()} => {[c.get_iri().as_str() for c in kb.get_direct_sub_concepts(concept)]}')
4343
print('*' * 100)
4444

ontolearn/concept_learner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ def __init__(self,
791791
self.__setup()
792792

793793
def __setup(self):
794+
self._cache = dict()
794795
self.clean()
795796
if self.fitness_func is None:
796797
self.fitness_func = LinearPressureFitness()
@@ -810,7 +811,6 @@ def __setup(self):
810811
self._result_population = None
811812
self._dp_to_prim_type = dict()
812813
self._dp_splits = dict()
813-
self._cache = dict()
814814
self._split_properties = []
815815

816816
self.pset = self.__build_primitive_set()
@@ -1059,7 +1059,7 @@ def clean(self):
10591059
del creator.Quality
10601060
except AttributeError:
10611061
pass
1062-
1062+
self._cache.clear()
10631063
super().clean()
10641064

10651065

setup.py

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
from setuptools import setup, find_packages
2+
import re
23

34
with open('README.md', 'r') as fh:
45
long_description = fh.read()
5-
setup(
6-
name="ontolearn",
7-
description="Ontolearn is an open-source software library for structured machine learning in Python. Ontolearn includes modules for processing knowledge bases, inductive logic programming and ontology engineering.",
8-
version="0.6.2",
9-
packages=find_packages(),
10-
install_requires=[
11-
"scikit-learn>=0.24.1",
6+
7+
_deps = [
128
"matplotlib>=3.3.4",
139
"owlready2>=0.40",
1410
"torch>=1.7.1",
@@ -19,11 +15,44 @@
1915
"deap>=1.3.1",
2016
"httpx>=0.25.2",
2117
"tqdm>=4.64.0",
22-
"transformers>=4.35.0",
18+
"transformers>=4.38.1",
2319
"pytest>=7.2.2",
2420
"owlapy==0.1.1",
2521
"dicee==0.1.2",
26-
"ontosample>=0.2.2"],
22+
"ontosample>=0.2.2",
23+
"gradio>=4.11.0"]
24+
25+
deps = {b: a for a, b in (re.findall(r"^(([^!=<>~ ]+)(?:[!=<>~ ].*)?$)", x)[0] for x in _deps)}
26+
27+
28+
def deps_list(*pkgs):
29+
return [deps[pkg] for pkg in pkgs]
30+
31+
32+
extras = dict()
33+
extras["min"] = deps_list(
34+
"matplotlib",
35+
"torch",
36+
"rdflib",
37+
"pandas",
38+
"sortedcontainers",
39+
"owlready2",
40+
"owlapy",
41+
"flask", # Drill, NCES
42+
"tqdm", "transformers", # NCES
43+
"dicee", # Drill
44+
"deap", # Evolearner
45+
)
46+
47+
extras["full"] = (extras["min"] + deps_list("httpx", "pytest", "gradio", "ontosample"))
48+
49+
setup(
50+
name="ontolearn",
51+
description="Ontolearn is an open-source software library for structured machine learning in Python. Ontolearn includes modules for processing knowledge bases, inductive logic programming and ontology engineering.",
52+
version="0.7.0",
53+
packages=find_packages(),
54+
install_requires=extras["min"],
55+
extras_require=extras,
2756
author='Caglar Demir',
2857
author_email='[email protected]',
2958
url='https://github.com/dice-group/Ontolearn',

0 commit comments

Comments
 (0)