Skip to content

Commit

Permalink
rename according to PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
YannChemin committed Aug 8, 2024
1 parent ee33451 commit f60e254
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion spectral/database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

from .aster import AsterDatabase
from .ecostress import EcostressDatabase
from .relab import relabDatabase
from .relab import RelabDatabase
from .usgs import USGSDatabase
16 changes: 8 additions & 8 deletions spectral/database/relab.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def read_relab_file(filename):
return s


class relabDatabase(SpectralDatabase):
class RelabDatabase(SpectralDatabase):
'''A relational database to manage relab spectral library data.'''
schemas = table_schemas

Expand Down Expand Up @@ -219,21 +219,21 @@ def create(cls, filename, relab_data_dir=None):
Returns:
An :class:`~spectral.database.relabDatabase` object.
An :class:`~spectral.database.RelabDatabase` object.
Example::
>>> relabDatabase.create("relab_lib.db", "/STORAGE/ReLab/data")
>>> RelabDatabase.create("relab_lib.db", "/STORAGE/ReLab/data")
This is a class method (it does not require instantiating an
relabDatabase object) that creates a new database by parsing all of the
RelabDatabase object) that creates a new database by parsing all of the
files in the relab library data directory. Normally, this should only
need to be called once. Subsequently, a corresponding database object
can be created by instantiating a new relabDatabase object with the
can be created by instantiating a new RelabDatabase object with the
path the database file as its argument. For example::
>>> from spectral.database.relab import relabDatabase
>>> db = relabDatabase("relab_lib.db")
>>> from spectral.database.relab import RelabDatabase
>>> db = RelabDatabase("relab_lib.db")
'''
import os
if os.path.isfile(filename):
Expand All @@ -258,7 +258,7 @@ def __init__(self, sqlite_filename=None):
Returns:
An :class:`~spectral.relabDatabase` connected to the database.
An :class:`~spectral.RelabDatabase` connected to the database.
'''
from spectral.io.spyfile import find_file_path
if sqlite_filename:
Expand Down
4 changes: 2 additions & 2 deletions spectral/tests/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def setup(self):

def test_create_database(self):
'''Test creating new database from RELAB data files.'''
db = spy.relabDatabase.create(RELAB_DB, RELAB_DATA_DIR)
db = spy.RelabDatabase.create(RELAB_DB, RELAB_DATA_DIR)
assert(list(db.query('SELECT COUNT() FROM Spectra'))[0][0] == 1)

class RELABDatabaseTest(SpyTest):
Expand All @@ -98,7 +98,7 @@ def __init__(self):
pass

def setup(self):
self.db = spy.relabDatabase(RELAB_DB)
self.db = spy.RelabDatabase(RELAB_DB)

def test_read_signatures(self):
'''Can get spectra from the opened database.'''
Expand Down

0 comments on commit f60e254

Please sign in to comment.