Skip to content

as per request #160

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

Merged
merged 6 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
rename according to PEP8
  • Loading branch information
YannChemin committed Aug 8, 2024
commit f60e25426c2f569d1411bf23bdf792de8e2da08e
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
Loading