Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEP: drop lick as a hard dependency #379

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion nonos/api/satellite.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import warnings
from importlib.util import find_spec
from pathlib import Path
from typing import TYPE_CHECKING, Optional

import numpy as np
from lick.lick import lick_box

from nonos.api.analysis import Coordinates, GasField, Plotable
from nonos.loaders import Recipe, loader_from, recipe_from
Expand Down Expand Up @@ -97,6 +97,13 @@ def __init__(
method_background: str = "nearest",
light_source: bool = True,
):
if find_spec("lick") is None:
raise RuntimeError(
"NonosLick cannot be instantiated because lick is not installed"
)

from lick.lick import lick_box

self.xmin = xmin
self.xmax = xmax
self.ymin = ymin
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ requires-python = ">=3.9"
dependencies = [
"cblind>=2.3.0",
"inifix>=3.0.0",
"lick>=0.5.1",
"loguru>=0.5.3",
"matplotlib>=3.5.0",
"numpy>=1.19.3",
Expand Down
1 change: 1 addition & 0 deletions requirements/tests_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
cblind>=2.3.0
cmocean>=3.0.3
cmyt>=2.0.0
lick>=0.5.1
numexpr>=2.8.3
2 changes: 2 additions & 0 deletions tests/test_image_comp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from copy import deepcopy
from importlib.util import find_spec

import inifix
import matplotlib as mpl
Expand Down Expand Up @@ -95,6 +96,7 @@ def test_3D_vm_xy(test_data_dir, temp_figure_and_axis):
return fig


@pytest.mark.skipif(find_spec("lick") is None, reason="lick is not installed")
@pytest.mark.parametrize("method", ["nearest", "linear"])
@pytest.mark.mpl_image_compare()
def test_nonoslick_method(method, tmp_path):
Expand Down