mirror of
https://github.com/gsi-upm/senpy
synced 2025-09-17 20:12:22 +00:00
WIP: working on a full refactor for v2.0
This is still not functional, because it involves a LOT of changes to the basic structure of the project. Some of the main changes can be seen in the CHANGELOG.md file, if you're interested, but it boils down to simplifying the logic of plugins (no more activation/deactivation shenanigans), more robust typing and use of schemas (pydantic) to avoid inconsistencies and user errors.
This commit is contained in:
@@ -26,14 +26,14 @@ from senpy.models import (Analysis,
|
||||
EmotionAnalysis,
|
||||
EmotionSet,
|
||||
Entry,
|
||||
Error,
|
||||
ErrorResponse,
|
||||
Results,
|
||||
Sentiment,
|
||||
SentimentPlugin,
|
||||
Plugins,
|
||||
from_string,
|
||||
from_dict,
|
||||
subtypes)
|
||||
from_dict)
|
||||
from senpy.errors import Error
|
||||
from senpy import plugins
|
||||
from pprint import pprint
|
||||
|
||||
@@ -117,7 +117,7 @@ class ModelsTest(TestCase):
|
||||
|
||||
def test_plugins(self):
|
||||
self.assertRaises(Error, plugins.Plugin)
|
||||
p = plugins.SentimentPlugin({"name": "dummy",
|
||||
p = plugins.SentimentPlugin.parse_obj({"name": "dummy",
|
||||
"description": "I do nothing",
|
||||
"version": 0,
|
||||
"extra_params": {
|
||||
@@ -152,11 +152,6 @@ class ModelsTest(TestCase):
|
||||
s = str(r)
|
||||
assert "_testing" not in s
|
||||
|
||||
def test_serialize(self):
|
||||
for k, v in subtypes().items():
|
||||
e = v()
|
||||
e.serialize()
|
||||
|
||||
def test_turtle(self):
|
||||
"""Any model should be serializable as a turtle file"""
|
||||
ana = EmotionAnalysis()
|
||||
|
Reference in New Issue
Block a user