Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 1 addition & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_install:
# Install package dependencies
- pip install -e .

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
- requirements: docs/requirements.txt
11 changes: 11 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@
autodoc_typehints = "description"
autodoc_class_signature = "separated"

# Mock imports for heavy dependencies that aren't needed for building docs
autodoc_mock_imports = [
"torch",
"torch_geometric",
"pytorch_lightning",
"torchmetrics",
"tensorflow",
"keras",
"spektral",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
15 changes: 13 additions & 2 deletions unravel/classifiers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ def __init__(self, *args, **kwargs):
__all__ = ["CrystalGraphClassifier"]


from .crystal_graph_pyg import PyGLightningCrystalGraphClassifier
try:
from .crystal_graph_pyg import PyGLightningCrystalGraphClassifier

__all__.append("PyGLightningCrystalGraphClassifier")
except ImportError:

class PyGLightningCrystalGraphClassifier:
def __init__(self, *args, **kwargs):
raise ImportError(
"PyGLightningCrystalGraphClassifier requires PyTorch and PyTorch Geometric. "
"Install with: pip install torch torch-geometric pytorch-lightning torchmetrics"
)

__all__.append("PyGLightningCrystalGraphClassifier")
__all__.append("PyGLightningCrystalGraphClassifier")