Skip to content

Commit

Permalink
Rename neighbour_finding_method_name to get_neighbour_finding_method_…
Browse files Browse the repository at this point in the history
…name.
  • Loading branch information
bayliffe committed May 23, 2024
1 parent 2b83537 commit f96cba7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions improver/calibration/dz_rescaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from improver.calibration.utilities import filter_non_matching_cubes
from improver.constants import SECONDS_IN_HOUR
from improver.metadata.constants.time_types import TIME_COORDS
from improver.spotdata.utilities import neighbour_finding_method_name
from improver.spotdata.utilities import get_neighbour_finding_method_name


class EstimateDzRescaling(PostProcessingPlugin):
Expand Down Expand Up @@ -74,7 +74,7 @@ def __init__(
# Please see numpy.polynomial.polynomial.Polynomial.fit for further information.
self.polyfit_deg = 1

self.neighbour_selection_method = neighbour_finding_method_name(
self.neighbour_selection_method = get_neighbour_finding_method_name(
land_constraint=land_constraint, minimum_dz=similar_altitude
)
self.site_id_coord = site_id_coord
Expand Down
4 changes: 2 additions & 2 deletions improver/cli/apply_height_adjustment.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def process(
height
"""
from improver.spotdata.height_adjustment import SpotHeightAdjustment
from improver.spotdata.utilities import neighbour_finding_method_name
from improver.spotdata.utilities import get_neighbour_finding_method_name

neighbour_selection_method = neighbour_finding_method_name(
neighbour_selection_method = get_neighbour_finding_method_name(
land_constraint=land_constraint, minimum_dz=similar_altitude
)

Expand Down
4 changes: 2 additions & 2 deletions improver/spotdata/neighbour_finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from improver.spotdata.build_spotdata_cube import build_spotdata_cube
from improver.utilities.cube_manipulation import enforce_coordinate_ordering

from .utilities import neighbour_finding_method_name
from .utilities import get_neighbour_finding_method_name


class NeighbourSelection(BasePlugin):
Expand Down Expand Up @@ -596,7 +596,7 @@ def process(
)

# Construct a name to describe the neighbour finding method employed
method_name = neighbour_finding_method_name(
method_name = get_neighbour_finding_method_name(
self.land_constraint, self.minimum_dz
)

Expand Down
4 changes: 2 additions & 2 deletions improver/spotdata/spot_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

from .apply_lapse_rate import SpotLapseRateAdjust
from .spot_extraction import SpotExtraction
from .utilities import neighbour_finding_method_name
from .utilities import get_neighbour_finding_method_name


class SpotManipulation(BasePlugin):
Expand Down Expand Up @@ -141,7 +141,7 @@ def __init__(
Triggers equal-weighting blending of the realization coord if required.
Use this if a threshold coord is also present on the input cube.
"""
self.neighbour_selection_method = neighbour_finding_method_name(
self.neighbour_selection_method = get_neighbour_finding_method_name(
land_constraint, similar_altitude
)
self.apply_lapse_rate_correction = apply_lapse_rate_correction
Expand Down
2 changes: 1 addition & 1 deletion improver/spotdata/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"""Spot data utilities."""


def neighbour_finding_method_name(land_constraint: bool, minimum_dz: bool) -> str:
def get_neighbour_finding_method_name(land_constraint: bool, minimum_dz: bool) -> str:
"""
Create a name to describe the neighbour method based on the constraints
provided.
Expand Down
6 changes: 3 additions & 3 deletions improver_tests/spotdata/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import pytest

from improver.spotdata.utilities import neighbour_finding_method_name
from improver.spotdata.utilities import get_neighbour_finding_method_name


@pytest.mark.parametrize(
Expand All @@ -45,9 +45,9 @@
(False, True, "nearest_minimum_dz"),
),
)
def test_neighbour_finding_method_name(land_constraint, minimum_dz, expected):
def test_get_neighbour_finding_method_name(land_constraint, minimum_dz, expected):
"""Test the function for generating the name that describes the neighbour
finding method."""

result = neighbour_finding_method_name(land_constraint, minimum_dz)
result = get_neighbour_finding_method_name(land_constraint, minimum_dz)
assert result == expected

0 comments on commit f96cba7

Please sign in to comment.