-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revise circ_diff function * fixing type hints for poe * add test_within_bin() * update test_calc_wsratio_v_wd_scen expected result is different due to new circ_diff function * bump version increase version because results can be slightly different with new circ_diff method * update smarteole_example.ipynb ensure outputs are up to date with new circ_diff minor improvements to plots * Update smarteole_example.ipynb --------- Co-authored-by: aclerc <[email protected]>
- Loading branch information
Showing
13 changed files
with
287 additions
and
298 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "res-wind-up" | ||
version = "0.1.6" | ||
version = "0.1.7" | ||
authors = [ | ||
{ name = "Alex Clerc", email = "[email protected]" } | ||
] | ||
|
Binary file modified
BIN
+9 Bytes
(100%)
tests/test_data/LSA_T13_LSA_T12_check_pre_wsratio_v_dir_scen.parquet
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
RANDOM_SEED = 0 | ||
SCATTER_S = 1 | ||
SCATTER_ALPHA = 0.2 | ||
SCATTER_MARKERSCALE = 4 | ||
|
||
|
||
class DataColumns: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
import numpy as np | ||
import numpy.typing as npt | ||
|
||
|
||
def circ_diff(angle1: float | np.generic, angle2: float | np.generic) -> float | np.generic: | ||
angle1_rad = np.radians(angle1) | ||
angle2_rad = np.radians(angle2) | ||
sin_angle1 = np.sin(angle1_rad) | ||
cos_angle1 = np.cos(angle1_rad) | ||
sin_angle2 = np.sin(angle2_rad) | ||
cos_angle2 = np.cos(angle2_rad) | ||
denominator = cos_angle2 * cos_angle2 + sin_angle2 * sin_angle2 | ||
temp1 = (cos_angle1 * cos_angle2 + sin_angle1 * sin_angle2) / denominator | ||
temp2 = (sin_angle1 * cos_angle2 - cos_angle1 * sin_angle2) / denominator | ||
return np.degrees(np.arctan2(temp2, temp1)) | ||
def circ_diff(angle1: float | npt.NDArray | list, angle2: float | npt.NDArray | list) -> float | npt.NDArray: | ||
"""Calculate the circular difference between two angles. | ||
Args: | ||
angle1: First angle in degrees. | ||
angle2: Second angle in degrees. | ||
Returns: | ||
Circular difference between the two angles in degrees | ||
""" | ||
|
||
# Convert list to numpy array | ||
if isinstance(angle1, list): | ||
angle1 = np.array(angle1) | ||
if isinstance(angle2, list): | ||
angle2 = np.array(angle2) | ||
|
||
return np.mod(angle1 - angle2 + 180, 360) - 180 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters