Skip to content

Commit

Permalink
Add import for annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
camposandro committed Sep 27, 2024
1 parent 6f04e52 commit 0330f84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def time_pcf_natural_estimator(self):

def time_pccf_davis_peebles_estimator(self):
"""Times the Davis-Peebles estimator for a projected cross-correlation"""
estimator = DavisPeeblesEstimator(ProjectedCorrelation(params=generate_pcf_params(), use_weights=True))
estimator = DavisPeeblesEstimator(
ProjectedCorrelation(params=generate_pcf_params(), use_weights=True)
)
estimator.compute_crosscorrelation_counts(
GALS_WEIGHT_DIR,
GALS1_WEIGHT_DIR,
Expand Down
3 changes: 3 additions & 0 deletions src/corrgi/alignment.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import itertools
import pickle

Expand Down Expand Up @@ -57,6 +58,7 @@ def crosscorrelation_alignment(catalog_left: Catalog, catalog_right: Catalog) ->
result_mapping = pd.DataFrame(full_product, columns=column_names)
return PixelAlignment(catalog_left.pixel_tree, result_mapping, PixelAlignmentType.OUTER)


def read_alignment(path: str) -> dict | list:
"""Reads the alignment pixels from a file.
Expand All @@ -71,6 +73,7 @@ def read_alignment(path: str) -> dict | list:
with open(path, "rb") as alignment_file:
return pickle.load(alignment_file)

Check warning on line 74 in src/corrgi/alignment.py

View check run for this annotation

Codecov / codecov/patch

src/corrgi/alignment.py#L73-L74

Added lines #L73 - L74 were not covered by tests


def write_alignment(path: str, pixels: dict | list):
"""Writes the alignment pixels to a file.
Expand Down

0 comments on commit 0330f84

Please sign in to comment.