Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opencsp/app/sofast/lib/calculation_data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class CalculationFacetEnsemble(hdf5_tools.HDF5_SaveAbstract):
"""

trans_facet_ensemble: TransformXYZ = None
slopes_ensemble_xy: npt.NDArray[np.float_] = None
slopes_ensemble_xy: npt.NDArray[np.float64] = None
v_surf_points_ensemble: Vxyz = None
v_facet_pointing_ensemble: Vxyz = None

Expand Down
4 changes: 2 additions & 2 deletions opencsp/common/lib/cv/spot_analysis/SpotAnalysisOperable.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def best_primary_pathnameext(self) -> str:
return os.path.join(*self.get_primary_path_nameext())

@property
def max_popf(self) -> npt.NDArray[np.float_]:
def max_popf(self) -> npt.NDArray[np.float64]:
"""Returns the maximum population float value, if it exists. Otherwise
returns the maximum value for this instance's primary image."""
if self.population_statistics is not None:
Expand All @@ -322,7 +322,7 @@ def max_popf(self) -> npt.NDArray[np.float_]:
return np.max(self.primary_image.nparray)

@property
def min_popf(self) -> npt.NDArray[np.float_]:
def min_popf(self) -> npt.NDArray[np.float64]:
"""Returns the minimum population float value, if it exists. Otherwise
returns the minimum value for this instance's primary image."""
if self.population_statistics is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

@dataclass
class SpotAnalysisPopulationStatistics:
maxf: npt.NDArray[np.float_] = None
maxf: npt.NDArray[np.float64] = None
""" Maximum value seen across images. None if not yet calculated. """
minf: npt.NDArray[np.float_] = None
minf: npt.NDArray[np.float64] = None
""" Minimum value seen across images. None if not yet calculated. """
avgf_rolling_window: npt.NDArray[np.float_] = None
avgf_rolling_window: npt.NDArray[np.float64] = None
""" Average value seen across images. None if not yet calculated. """

window_size: int = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _execute_aggregate(
+ f"First image is '{operables[0].primary_image_source_path}', current image is '{operable.primary_image_source_path}'.",
)
averaged_image += other_image
averaged_image = averaged_image.astype(np.float_)
averaged_image = averaged_image.astype(np.float64)
averaged_image /= len(operables)
averaged_image = averaged_image.astype(operables[0].primary_image.nparray.dtype)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_single_image(self):
self.assertEqual(1, len(operables))

operable = operables[0]
np.testing.assert_array_equal(operable.primary_image.nparray, self.a1_img.nparray.astype(np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, self.a1_img.nparray.astype(np.float64))

def test_two_images_one_group(self):
operables = self.processor.process_operable(self.a1)
Expand All @@ -60,7 +60,7 @@ def test_two_images_one_group(self):
self.assertEqual(1, len(operables))

operable = operables[0]
np.testing.assert_array_equal(operable.primary_image.nparray, np.array([15], dtype=np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, np.array([15], dtype=np.float64))

def test_two_images_two_groups(self):
operables = self.processor.process_operable(self.a1)
Expand All @@ -71,9 +71,9 @@ def test_two_images_two_groups(self):
self.assertEqual(1, len(operables_b))

operable = operables_a[0]
np.testing.assert_array_equal(operable.primary_image.nparray, self.a1_img.nparray.astype(np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, self.a1_img.nparray.astype(np.float64))
operable = operables_b[0]
np.testing.assert_array_equal(operable.primary_image.nparray, self.b1_img.nparray.astype(np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, self.b1_img.nparray.astype(np.float64))

def test_three_images_two_groups(self):
operables = self.processor.process_operable(self.a1)
Expand All @@ -86,9 +86,9 @@ def test_three_images_two_groups(self):
self.assertEqual(1, len(operables_b))

operable = operables_a[0]
np.testing.assert_array_equal(operable.primary_image.nparray, np.array([15], dtype=np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, np.array([15], dtype=np.float64))
operable = operables_b[0]
np.testing.assert_array_equal(operable.primary_image.nparray, self.b1_img.nparray.astype(np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, self.b1_img.nparray.astype(np.float64))

def test_four_images_two_groups(self):
operables = self.processor.process_operable(self.a1)
Expand All @@ -103,9 +103,9 @@ def test_four_images_two_groups(self):
self.assertEqual(1, len(operables_b))

operable = operables_a[0]
np.testing.assert_array_equal(operable.primary_image.nparray, np.array([15], dtype=np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, np.array([15], dtype=np.float64))
operable = operables_b[0]
np.testing.assert_array_equal(operable.primary_image.nparray, np.array([35], dtype=np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, np.array([35], dtype=np.float64))

def test_four_images_alternating_group(self):
operables = self.processor.process_operable(self.a1)
Expand All @@ -120,13 +120,13 @@ def test_four_images_alternating_group(self):
self.assertEqual(1, len(operables_b2))

operable = operables_a1[0]
np.testing.assert_array_equal(operable.primary_image.nparray, self.a1_img.nparray.astype(np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, self.a1_img.nparray.astype(np.float64))
operable = operables_a2[0]
np.testing.assert_array_equal(operable.primary_image.nparray, self.a2_img.nparray.astype(np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, self.a2_img.nparray.astype(np.float64))
operable = operables_b1[0]
np.testing.assert_array_equal(operable.primary_image.nparray, self.b1_img.nparray.astype(np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, self.b1_img.nparray.astype(np.float64))
operable = operables_b2[0]
np.testing.assert_array_equal(operable.primary_image.nparray, self.b2_img.nparray.astype(np.float_))
np.testing.assert_array_equal(operable.primary_image.nparray, self.b2_img.nparray.astype(np.float64))


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion opencsp/common/lib/geometry/Vxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def normalize_in_place(self) -> None:
"""
self._data /= self._magnitude_with_zero_check()

def magnitude(self) -> npt.NDArray[np.float_]:
def magnitude(self) -> npt.NDArray[np.float64]:
"""
Returns magnitude of each vector.

Expand Down
2 changes: 1 addition & 1 deletion opencsp/common/lib/geometry/Vxyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def normalize_in_place(self) -> None:
"""
self._data /= self._magnitude_with_zero_check()

def magnitude(self) -> npt.NDArray[np.float_]:
def magnitude(self) -> npt.NDArray[np.float64]:
"""
Returns magnitude of each vector as a new array.

Expand Down
8 changes: 4 additions & 4 deletions opencsp/common/lib/geometry/angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ def normalize(angle: float) -> float:


@overload
def normalize(angles: npt.NDArray[np.float_] | Iterable) -> npt.NDArray[np.float_]:
def normalize(angles: npt.NDArray[np.float64] | Iterable) -> npt.NDArray[np.float64]:
"""Normalizes an array of angles to the range [0, 2π]."""
# "ChatGPT 4o" assisted with generating this docstring.


def normalize(angle_or_angles: float | npt.NDArray[np.float_] | Iterable) -> float | npt.NDArray[np.float_]:
def normalize(angle_or_angles: float | npt.NDArray[np.float64] | Iterable) -> float | npt.NDArray[np.float64]:
"""
Adjusts the given angle or angles to be in the range [0, 2π].

Expand All @@ -181,12 +181,12 @@ def normalize(angle_or_angles: float | npt.NDArray[np.float_] | Iterable) -> flo

Parameters
----------
angle_or_angles : float or :py:meth:`npt.NDArray[np.float_]` or Iterable
angle_or_angles : float or :py:meth:`npt.NDArray[np.float64]` or Iterable
A single angle or an array/iterable of angles to normalize.

Returns
-------
float or py:meth:`npt.NDArray[np.float_]`
float or py:meth:`npt.NDArray[np.float64]`
The normalized angle or array of normalized angles.
"""
# "ChatGPT 4o" assisted with generating this docstring.
Expand Down
2 changes: 1 addition & 1 deletion opencsp/common/lib/tool/math_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def gaussian_convolution(num_points: int):
return y_vals


def rolling_average(data: list[float] | npt.NDArray[np.float_], window_size: int):
def rolling_average(data: list[float] | npt.NDArray[np.float64], window_size: int):
"""Compute the rolling average over all values in the given list.

For each point x at index i, assign a new value equal to sum([i-w/2:i+w/2]) / 2.
Expand Down