Skip to content

Multiple SQLite files cannot be passed into the constructor of a single SQLite dataset object #877

@finnmayhew

Description

@finnmayhew

Describe the bug
If a list of files is passed as the path argument of SQLiteDataset, in the process of defining SQLiteDataset._indices, SQLiteDataset._indices is referenced (this line), causing an error.

To Reproduce
Steps to reproduce the behavior:
Try to instatiate an SQLiteDataset and pass in a list of files to path.

Expected behavior
SQLiteDataset should be able to index the database files that are passed into it.

Full traceback
Please include the full error message to allow for debugging

File "<stdin>", line 1, in <module>
  File "/mnt/ffs24/home/mayhewfi/DP/graphnet/src/graphnet/utilities/config/dataset_config.py", line 254, in __call__
    created_obj = super().__call__(*args, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/ffs24/home/mayhewfi/DP/graphnet/src/graphnet/data/dataset/dataset.py", line 419, in __init__
    self._indices = self._get_all_indices()
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/ffs24/home/mayhewfi/DP/graphnet/src/graphnet/data/dataset/sqlite/sqlite_dataset.py", line 87, in _get_all_indices
    self._establish_connection(0)
  File "/mnt/ffs24/home/mayhewfi/DP/graphnet/src/graphnet/data/dataset/sqlite/sqlite_dataset.py", line 117, in _establish_connection
    indices = self._indices[i]
              ^^^^^^^^^^^^^
AttributeError: 'SQLiteDataset' object has no attribute '_indices'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions