Skip to content

Commit

Permalink
Merge pull request #74 from MET-OM/dev_ex
Browse files Browse the repository at this point in the history
Dev ex
  • Loading branch information
KonstantinChri authored Dec 17, 2024
2 parents a5624a9 + f659fe5 commit c748ce5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metocean_stats/tables/extreme.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def table_monthly_return_periods(data, var='hs', periods=[1, 10, 100, 10000],dis
shape = ['-'] + [round(shape, 3) if isinstance(shape, (int, float)) else shape for shape, _, _ in params]
scale = [units] + [round(scale, 3) if isinstance(scale, (int, float)) else scale for _, _, scale in params]
location = [units] + [round(loc, 2) if isinstance(loc, (int, float)) else loc for _, loc, _ in params]
shape = ['-' if element == [] else element for element in shape]
shape = ['-' if (isinstance(element, (list, np.ndarray)) and len(element) == 0) else element for element in shape]

table_data = {
'Month': months,
Expand Down Expand Up @@ -98,7 +98,7 @@ def table_directional_return_periods(data: pd.DataFrame, var='hs', var_dir='dir'
shape = ['-'] + [round(shape, 3) if isinstance(shape, (int, float)) else shape for shape, _, _ in params]
scale = [units] + [round(scale, 3) if isinstance(scale, (int, float)) else scale for _, _, scale in params]
location = [units] + [round(loc, 2) if isinstance(loc, (int, float)) else loc for _, loc, _ in params]
shape = ['-' if element == [] else element for element in shape]
shape = ['-' if (isinstance(element, (list, np.ndarray)) and len(element) == 0) else element for element in shape]

# Create the table data dictionary
table_data = {
Expand Down

0 comments on commit c748ce5

Please sign in to comment.