Skip to content

Commit

Permalink
#3287: remove redundant new-style 'object' declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff1evesque committed Oct 14, 2018
1 parent 89fa672 commit f960675
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 61 deletions.
4 changes: 1 addition & 3 deletions brain/cache/hset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
from brain.cache.query import Query


class Hset(object):
class Hset:
'''
This class provides an interface to cache, and uncache the redis hash
data structure. Specifically, necessary data components is passed into the
corresponding class method.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down
4 changes: 1 addition & 3 deletions brain/cache/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
from brain.converter.model import Model as Converter


class Model(object):
class Model:
'''
This class provides an interface to cache, and uncache the redis hash
data structure. Specifically, necessary data components is passed into the
corresponding class method, which allow computed model(s) to be stored into
a NoSQL datastore.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self, model=None):
Expand Down
4 changes: 1 addition & 3 deletions brain/cache/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from brain.cache.settings import Settings


class Query(object):
class Query:
'''
This class provides an interface to various Redis data structures.
Expand All @@ -32,8 +32,6 @@ class Query(object):
concept to 'lists'. Also, the above included redis data structures,
provides enough flexibility to accomplish most requirements.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self, db_num=0, host=None, port=None):
Expand Down
4 changes: 1 addition & 3 deletions brain/cache/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
from flask import current_app


class Settings(object):
class Settings:
'''
This class provides an interface to get, or set the redis host, or redis
port.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down
4 changes: 1 addition & 3 deletions brain/converter/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
from sklearn import svm, preprocessing


class Model(object):
class Model:
'''
This class provides an interface to serialize, and deserialize an SVM
object.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self, model):
Expand Down
4 changes: 1 addition & 3 deletions brain/converter/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
'''


class Operation(object):
class Operation:
'''
This class provides an interface to restructure the supplied data into a
consistent structure, which allows successive parsers to implement
corresponding logic.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self, settings, dataset=None):
Expand Down
4 changes: 1 addition & 3 deletions brain/converter/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
'''


class Settings(object):
class Settings:
'''
This class provides an interface to restructure the supplied data into a
consistent structure, which allows successive parsers to implement
corresponding logic.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self, settings, dataset=None):
Expand Down
4 changes: 1 addition & 3 deletions brain/database/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
from brain.database.query import SQL


class Account(object):
class Account:
'''
This class provides an interface to the users account.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down
4 changes: 1 addition & 3 deletions brain/database/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
from brain.database.query import NoSQL


class Collection(object):
class Collection:
'''
This class provides an interface to retrieve, and store various parameters,
of the specified collection, from the mongodb.
Note: this class is invoked within 'base_data.py'
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down
4 changes: 1 addition & 3 deletions brain/database/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from brain.database.query import SQL


class Entity(object):
class Entity:
'''
This class provides an interface to save, retrieve an SVM entity title,
Expand All @@ -19,8 +19,6 @@ class Entity(object):
Note: this class is invoked within 'model_generate.py', 'base_data.py',
and 'data_append.py'
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self, premodel_data=None, session_type=None):
Expand Down
4 changes: 2 additions & 2 deletions brain/database/model_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from brain.database.query import SQL


class ModelType(object):
class ModelType:
'''
Note: this class explicitly inherits the 'new-style' class.
Expand All @@ -20,7 +20,7 @@ class ModelType(object):
def __init__(self):
'''
This constructor is responsible for defining class variables.
This class provides and interface between the model_type.
'''

Expand Down
4 changes: 1 addition & 3 deletions brain/database/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
from brain.database.query import SQL


class Prediction(object):
class Prediction:
'''
This class provides an interface to save, or retrieve, a previously
generated svm or, svr prediction result.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down
8 changes: 2 additions & 6 deletions brain/database/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ def get_mongodb():
return g.mongodb


class NoSQL(object):
class NoSQL:
'''
This class provides an interface to connect, execute commands, and
disconnect from a NoSQL database.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down Expand Up @@ -215,14 +213,12 @@ def get_errors(self):
return self.list_error


class SQL(object):
class SQL:
'''
This class provides an interface to connect, execute commands, and
disconnect from a SQL database.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self, host=None, user=None, passwd=None):
Expand Down
4 changes: 1 addition & 3 deletions brain/database/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
from brain.database.query import SQL


class Session(object):
class Session:
'''
This class provides an interface to retrieve the 'id_entity', and
'collection' from the 'tbl_dataset_entity' sql database table.
Note: this class is invoked within 'views.py'
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down
6 changes: 2 additions & 4 deletions brain/database/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from flask import current_app


class Database(object):
class Database:
'''
This class provides an interface to get, or set the following database
Expand All @@ -33,9 +33,7 @@ class Database(object):
-> DATABASES ON *.* TO 'authenticated'@'localhost';
MariaDB> FLUSH PRIVILEGES;
Note: this class is invoked within 'query.py'
Note: this class explicitly inherits the 'new-style' class.
Note: this class is invoked within 'query.py'.
'''

Expand Down
4 changes: 1 addition & 3 deletions brain/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from brain.database.session import Session


class Load_Data(object):
class Load_Data:
'''
This class provides an interface to load the necessary parameters:
Expand All @@ -26,8 +26,6 @@ class Load_Data(object):
from the SQL database.
- generate a prediction using a previous cached model.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self, data, uid=None):
Expand Down
6 changes: 2 additions & 4 deletions brain/session/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from brain.validator.settings import Validator


class Base(object):
class Base:
'''
This class provides a general base class, used for the following sessions,
Expand All @@ -25,9 +25,7 @@ class Base(object):
- model_generate
- model_predict
Note: this class is invoked within 'data_xx.py', 'model_xx.py'
Note: this class explicitly inherits the 'new-style' class.
Note: this class is invoked within 'data_xx.py', 'model_xx.py'.
'''

Expand Down
4 changes: 1 addition & 3 deletions brain/validator/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
from six import string_types


class Validator(object):
class Validator:
'''
This class provides an interface to validate provided dataset(s) during
'data_new', and 'data_append' sessions.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down
4 changes: 1 addition & 3 deletions brain/validator/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
from six import string_types


class Validator(object):
class Validator:
'''
This class provides an interface to validate the settings for each
session.
Note: this class explicitly inherits the 'new-style' class.
'''

def __init__(self):
Expand Down

0 comments on commit f960675

Please sign in to comment.