Skip to content

Commit

Permalink
Make available imports in graphnet.data.{sqlite,parquet} conditional …
Browse files Browse the repository at this point in the history
…on whether 'torch' is installed
  • Loading branch information
asogaard committed Aug 30, 2022
1 parent 37a5a38 commit 3ddce57
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/graphnet/data/parquet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
from graphnet.utilities.imports import has_torch_package

from .parquet_dataconverter import ParquetDataConverter
from .parquet_dataset import ParquetDataset

if has_torch_package():
from .parquet_dataset import ParquetDataset

del has_torch_package
10 changes: 8 additions & 2 deletions src/graphnet/data/sqlite/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from graphnet.utilities.imports import has_torch_package

from .sqlite_dataconverter import SQLiteDataConverter
from .sqlite_dataset import SQLiteDataset
from .sqlite_dataset_perturbed import SQLiteDatasetPerturbed
from .sqlite_utilities import run_sql_code, save_to_sql

if has_torch_package():
from .sqlite_dataset import SQLiteDataset
from .sqlite_dataset_perturbed import SQLiteDatasetPerturbed

del has_torch_package

0 comments on commit 3ddce57

Please sign in to comment.