Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taranu committed Apr 10, 2024
1 parent eaba10b commit 64543fc
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions python/lsst/meas/astrom/matcher_probabilistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def _radec_to_xyz(ra, dec):
vectors : `numpy.ndarray`, (N, 3)
Output unit vectors.
"""

if ra.size != dec.size:
raise ValueError('ra and dec must be same size')
ras = np.radians(ra)
Expand All @@ -69,6 +70,7 @@ def _radec_to_xyz(ra, dec):

@dataclass
class CatalogExtras:

"""Store frequently-reference (meta)data relevant for matching a catalog.
Parameters
Expand Down Expand Up @@ -109,6 +111,7 @@ class ComparableCatalog:
extras : `CatalogExtras`
Extra cached (meta)data for the `catalog`.
"""

catalog: pd.DataFrame
column_coord1: str
column_coord2: str
Expand All @@ -118,8 +121,8 @@ class ComparableCatalog:


class ConvertCatalogCoordinatesConfig(pexConfig.Config):
"""Configuration for the MatchProbabilistic matcher.
"""
"""Configuration for the MatchProbabilistic matcher."""

column_ref_coord1 = pexConfig.Field(
dtype=str,
default='ra',
Expand Down Expand Up @@ -215,6 +218,7 @@ def format_catalogs(
Comparable catalogs corresponding to the input reference and target.
"""

convert_ref = self.coords_ref_to_convert
if convert_ref and not callable(radec_to_xy_func):
raise TypeError('radec_to_xy_func must be callable if converting ref coords')
Expand Down Expand Up @@ -262,14 +266,14 @@ def format_catalogs(


class MatchProbabilisticConfig(pexConfig.Config):
"""Configuration for the MatchProbabilistic matcher.
"""
"""Configuration for the MatchProbabilistic matcher."""

column_ref_order = pexConfig.Field(
dtype=str,
default=None,
optional=True,
doc="Name of column in reference catalog specifying order for matching."
" Derived from columns_ref_flux if not set.",
doc='Name of column in reference catalog specifying order for matching'
' Derived from columns_ref_flux if not set.',
)

@property
Expand Down Expand Up @@ -439,6 +443,7 @@ class MatcherProbabilistic:
config: `MatchProbabilisticConfig`
A configuration instance.
"""

config: MatchProbabilisticConfig

def __init__(
Expand Down Expand Up @@ -487,6 +492,7 @@ def match(
exceptions : `dict` [`int`, `Exception`]
A dictionary keyed by `catalog_target` row number of the first exception caught when matching.
"""

if logger is None:
logger = logger_default

Expand Down Expand Up @@ -646,7 +652,7 @@ def match(
ref,
target,
target_row_match,
"reference",
'reference',
),
(
self.config.columns_target_copy,
Expand All @@ -655,7 +661,7 @@ def match(
target,
ref,
ref_row_match,
"target",
'target',
),
):
matched = matches >= 0
Expand Down

0 comments on commit 64543fc

Please sign in to comment.