Commit 25c56866 authored by Jay's avatar Jay Committed by jay
Browse files

Moved data dir out of source, updated get_path func, and remembered to add the database to the PR.

parent 37360832
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
import os
import autocnet

__version__ = "0.1.0"

_ROOT = os.path.abspath(os.path.dirname(__file__))


def get_data(path):
    return os.path.join(_ROOT, 'data', path)
def get_data(filename):
    packagdir = autocnet.__path__[0]
    dirname = os.path.join(os.path.dirname(packagdir), 'data')
    fullname = os.path.join(dirname, filename)
    return fullname
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ def setup_db_session(db):
     : object
       A SQLAlchemy session object
    """
    print(db)
    engine = create_engine('sqlite:///{}'.format(db))
    Base.metadata.bind = engine
    Base.metadata.create_all()
+0 −1
Original line number Diff line number Diff line
@@ -14,6 +14,5 @@ from .. import io_db
class TestDataDB(unittest.TestCase):

    def test_setup_session(self):
        print(get_data('data.db'))
        data_session = io_db.setup_db_session(get_data('data.db'))
        self.assertIsInstance(data_session, session.Session)
 No newline at end of file
+2 −7
Original line number Diff line number Diff line
@@ -677,9 +677,6 @@ class CandidateGraph(nx.Graph):

        Parameters
        ----------
        source_node : str
                      The identifier for the node

        matches : dataframe
                  The pandas dataframe containing the matches
        """
@@ -688,10 +685,8 @@ class CandidateGraph(nx.Graph):
            for j, dest_group in source_group.groupby('destination_image'):
                source_key = dest_group['source_image'].values[0]
                destination_key = dest_group['destination_image'].values[0]
                try:

                edge = self.edge[source_key][destination_key]
                except: # pragma: no cover
                    edge = self.edge[destination_key][source_key]

                if hasattr(edge, 'matches'):
                    df = edge.matches

data/data.db

0 → 100644
+52 KiB

File added.

No diff preview for this file type.