Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigObject has been renamed to Configurable #176

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bspump/abc/connection.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import abc
from asab import ConfigObject
from asab import Configurable


class Connection(abc.ABC, ConfigObject):
class Connection(abc.ABC, Configurable):
"""
Connection class is responsible for creating a connection between items or services within the infrastructure of BSPump.
Their main use is to create connection with the main components of BSPump: source, :meth:`processor <bspump.Processor()>` and sink.
2 changes: 1 addition & 1 deletion bspump/abc/lookup.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
###


class Lookup(asab.ConfigObject):
class Lookup(asab.Configurable):
"""
Description:
2 changes: 1 addition & 1 deletion bspump/abc/lookupprovider.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import asab


class LookupProviderABC(abc.ABC, asab.ConfigObject):
class LookupProviderABC(abc.ABC, asab.Configurable):
"""
Description:
2 changes: 1 addition & 1 deletion bspump/abc/processor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asab


class ProcessorBase(asab.ConfigObject):
class ProcessorBase(asab.Configurable):
"""
Description:
2 changes: 1 addition & 1 deletion bspump/abc/source.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
L = logging.getLogger(__name__)


class Source(asab.ConfigObject):
class Source(asab.Configurable):
"""
Description:
2 changes: 1 addition & 1 deletion bspump/anomaly/storage.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
###


class AnomalyStorage(asab.ConfigObject, collections.OrderedDict):
class AnomalyStorage(asab.Configurable, collections.OrderedDict):
"""
AnomalyStorage serves to store anomaly objects (see AnomalyManager for details),
separated to "open" (anomalies that are not closed by status attribute in a symptom) and "closed".
2 changes: 1 addition & 1 deletion bspump/kafka/topic_initializer.py
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ def _is_kafka_component(component):
return False


class KafkaTopicInitializer(asab.ConfigObject):
class KafkaTopicInitializer(asab.Configurable):
"""
KafkaTopicInitializer reads topic configs from file or from Kafka sink/source configs,
checks if they exists and creates them if they don't.
2 changes: 1 addition & 1 deletion bspump/matrix/matrix.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
###


class Matrix(abc.ABC, asab.ConfigObject):
class Matrix(abc.ABC, asab.Configurable):
'''
Generic `Matrix` object.
2 changes: 1 addition & 1 deletion bspump/model/model.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
###


class Model(asab.ConfigObject):
class Model(asab.Configurable):
'''
Generic `Model` object. Loads trained model and parameters.
4 changes: 2 additions & 2 deletions bspump/mongodb/connection.py
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ def __init__(self, app, id=None, config=None):
self.Database = self.Config['database']


# TODO: Generalize this function to ConfigObject
# TODO: Generalize this function to Configurable
def _get_int_or_none(config_obj, key):
v = config_obj.get(key)
if isinstance(v, str) and len(v) == 0:
@@ -88,7 +88,7 @@ def _get_int_or_none(config_obj, key):
return None


# TODO: Generalize this function to ConfigObject
# TODO: Generalize this function to Configurable
def _get_str_or_none(config_obj, key):
v = config_obj.get(key)
if len(v) == 0:
2 changes: 1 addition & 1 deletion bspump/pipeline.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
#


class Pipeline(abc.ABC, asab.ConfigObject):
class Pipeline(abc.ABC, asab.Configurable):
"""
Description: Pipeline is ...
4 changes: 2 additions & 2 deletions test/test_config_defaults.py
Original file line number Diff line number Diff line change
@@ -12,12 +12,12 @@ def test_default_value_is_not_none(self):
# For BSPump modules
for _, module in inspect.getmembers(sys.modules['bspump'], inspect.ismodule):
for _, klass in inspect.getmembers(module, inspect.isclass):
if issubclass(klass, asab.ConfigObject):
if issubclass(klass, asab.Configurable):
to_inspect.append(klass)

# For BSPump classes
for _, klass in inspect.getmembers(sys.modules['bspump'], inspect.isclass):
if issubclass(klass, asab.ConfigObject):
if issubclass(klass, asab.Configurable):
to_inspect.append(klass)

# Make unique