Skip to content

Commit

Permalink
fixed index type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tjlane committed Oct 30, 2024
1 parent dd33412 commit 7aee3da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions meteor/rsmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ def _assert_is_map(obj: Any, *, require_uncertainties: bool) -> None:
def extend_resolution(dataset: Map, *, extend_by: float, anomalous: bool = False) -> rs.DataSet:
# TODO: clean this up and unit test, should probably also work for DataSets (!)

Check failure on line 37 in meteor/rsmap.py

View workflow job for this annotation

GitHub Actions / build (3.11)

Ruff (FIX002)

meteor/rsmap.py:37:7: FIX002 Line contains TODO, consider resolving the issue
MINIMUM_POSSIBLE_RESOLUTION = 0.1

Check failure on line 38 in meteor/rsmap.py

View workflow job for this annotation

GitHub Actions / build (3.11)

Ruff (N806)

meteor/rsmap.py:38:5: N806 Variable `MINIMUM_POSSIBLE_RESOLUTION` in function should be lowercase

Check failure on line 39 in meteor/rsmap.py

View workflow job for this annotation

GitHub Actions / build (3.11)

Ruff (W293)

meteor/rsmap.py:39:1: W293 Blank line contains whitespace
_, old_dmin = dataset.resolution_limits
new_dmin = max(old_dmin - extend_by, MINIMUM_POSSIBLE_RESOLUTION)
new_hkls = generate_reciprocal_asu(dataset.cell, dataset.spacegroup, new_dmin, anomalous=anomalous)
new_hkls = pd.MultiIndex.from_arrays(new_hkls, names=("H", "K", "L"))
return dataset.reindex(dataset.index.union(new_hkls)).fillna(0)
new_hkls = pd.MultiIndex.from_arrays(new_hkls.T, names=("H", "K", "L"))

extended_hkls = dataset.index.union(new_hkls)
extended = dataset.copy().reindex(extended_hkls).fillna(0)
extended.infer_mtz_dtypes()

return extended


class Map(rs.DataSet):
Expand Down
2 changes: 1 addition & 1 deletion meteor/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def tv_denoise_difference_map(
*,
full_output: bool = False,
weights_to_scan: Sequence[float] | np.ndarray | None = None,
extend_resolution_by: float = 1.0,
extend_resolution_by: float = 0.5,
) -> Map | tuple[Map, TvDenoiseResult]:
"""Single-pass TV denoising of a difference map.
Expand Down

0 comments on commit 7aee3da

Please sign in to comment.