Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Updated the shgrav.py package so that it can be activated during docu…
Browse files Browse the repository at this point in the history
…mentation building
  • Loading branch information
daminton committed Mar 1, 2024
1 parent dc8511b commit 7d48edb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ build:
jobs:
pre_build:
- ford fortran_docs.md
- pip install pyshtools
- DOC_BUILD=1 pip install .
python:
install:
Expand Down
17 changes: 12 additions & 5 deletions swiftest/shgrav.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@
#

from .constants import GC
import os

try:
import pyshtools as pysh
PYSHTOOLS_AVAILABLE = False

if 'READTHEDOCS' in os.environ:
# Assume pyshtools is available when building on ReadTheDocs
PYSHTOOLS_AVAILABLE = True
except ModuleNotFoundError:
PYSHTOOLS_AVAILABLE = False
print("pyshtools is not installed. Some features will be unavailable.")
else:
try:
import pyshtools as pysh
PYSHTOOLS_AVAILABLE = True
except ModuleNotFoundError:
print("pyshtools is not installed. Some features will be unavailable.")


if PYSHTOOLS_AVAILABLE:

Expand Down

0 comments on commit 7d48edb

Please sign in to comment.