diff --git a/.ruff.toml b/.ruff.toml index c9185ab8c03f..936384c83064 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -265,7 +265,6 @@ lint.unfixable = [ ] "astropy/logger.py" = ["C408", "RET505"] "astropy/modeling/*" = [ - "ANN201", # Public function without return type annotation "PLR0911", # too-many-return-statements "RET505", # superfluous-else-return "RET506", # superfluous-else-raise diff --git a/astropy/modeling/bounding_box.py b/astropy/modeling/bounding_box.py index a660cdeb4892..1b8aa9b1e52f 100644 --- a/astropy/modeling/bounding_box.py +++ b/astropy/modeling/bounding_box.py @@ -684,7 +684,9 @@ def __getitem__(self, key): else: return self._intervals[self._get_index(key)] - def bounding_box(self, order: str | None = None): + def bounding_box( + self, order: str | None = None + ) -> tuple[float, float] | tuple[tuple[float, float], ...]: """ Return the old tuple of tuples representation of the bounding_box order='C' corresponds to the old bounding_box ordering @@ -817,7 +819,7 @@ def validate( return new - def fix_inputs(self, model, fixed_inputs: dict, _keep_ignored=False): + def fix_inputs(self, model, fixed_inputs: dict, _keep_ignored=False) -> Self: """ Fix the bounding_box for a `fix_inputs` compound model. @@ -848,7 +850,7 @@ def fix_inputs(self, model, fixed_inputs: dict, _keep_ignored=False): def dimension(self): return len(self) - def domain(self, resolution, order: str | None = None): + def domain(self, resolution, order: str | None = None) -> list[np.ndarray]: inputs = self._model.inputs order = self._get_order(order) if order == "C": @@ -1606,7 +1608,7 @@ def _fix_input_bbox_arg(self, argument, value): self.selector_args.add_ignore(self._model, argument), ) - def fix_inputs(self, model, fixed_inputs: dict): + def fix_inputs(self, model, fixed_inputs: dict) -> Self: """ Fix the bounding_box for a `fix_inputs` compound model.