Skip to content

Commit

Permalink
MNT(healpy,ducc): add external dependency explainer (#171)
Browse files Browse the repository at this point in the history
Use the `external_dependency_explainer` helper in the `heracles.healpy`
and `heracles.ducc` module when optional external dependencies are
imported.

Closes: #170
  • Loading branch information
ntessore authored Aug 30, 2024
1 parent fe2006c commit ba11ffe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions heracles/ducc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@

from typing import TYPE_CHECKING

import ducc0
import numpy as np

from heracles.core import update_metadata
from heracles.core import external_dependency_explainer, update_metadata

with external_dependency_explainer:
import ducc0

if TYPE_CHECKING:
from collections.abc import Mapping
Expand Down
6 changes: 4 additions & 2 deletions heracles/healpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
from functools import cached_property, wraps
from typing import TYPE_CHECKING

import healpy as hp
import numpy as np
from numba import njit

from heracles.core import update_metadata
from heracles.core import external_dependency_explainer, update_metadata

with external_dependency_explainer:
import healpy as hp

if TYPE_CHECKING:
from collections.abc import Mapping
Expand Down

0 comments on commit ba11ffe

Please sign in to comment.