Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: logging 5 - remove prints from local_modules directory #179

Merged
merged 39 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
01fce88
chore: replace print with logging in JONSWAP_gamma.py
hollandjg Mar 4, 2024
7430f57
chore: replace print with logging in m3_colormanager_ph3.py
hollandjg Mar 4, 2024
9da6708
chore: replace print with logging in m_general_ph3.py
hollandjg Mar 4, 2024
2cefaf5
chore: replace print with logging in m_spectrum_ph3
hollandjg Mar 4, 2024
39babe5
chore: replace print with logging in m_tools_ph3.py
hollandjg Mar 4, 2024
ed8ee0c
Merge branch 'feat-logger/4-replace-print-logger-config' into feat-lo…
hollandjg Mar 11, 2024
f7b3a5c
Merge branch 'feat-logger/4-replace-print-logger-config' into feat-lo…
hollandjg Mar 11, 2024
7da5c7b
Merge branch 'feat-logger/4-replace-print-logger-config' into feat-lo…
hollandjg Mar 13, 2024
5d220d3
fix: update formatting in logging
hollandjg Mar 13, 2024
397c300
fix: reformat debugs from prints
hollandjg Mar 13, 2024
044db60
revert change to boot.ci call
hollandjg Mar 13, 2024
5911294
fix: replace evaluated strings
hollandjg Mar 13, 2024
063c21e
chore: remove unused from __future__ import
hollandjg Mar 13, 2024
f33a6fb
make updates from PR review
hollandjg Mar 13, 2024
277bca8
Added more context
hollandjg Mar 13, 2024
c3dcebd
Updates from PR review
hollandjg Mar 13, 2024
0399770
Updates from PR review
hollandjg Mar 13, 2024
b9360de
Updates from PR review
hollandjg Mar 13, 2024
278af16
Update src/icesat2waves/local_modules/m_general_ph3.py
hollandjg Mar 15, 2024
4417d8a
chore: add more context to debugger
hollandjg Mar 15, 2024
d2cdb6b
chore: add more context to debugger
hollandjg Mar 15, 2024
f67c66c
chore: add more context to debugger
hollandjg Mar 15, 2024
7799236
chore: reordered and deduplicated logging calls
hollandjg Mar 15, 2024
01cc041
chore: add more logging context
hollandjg Mar 15, 2024
5501bfc
Merge remote-tracking branch 'origin/feat-logger/5-replace-print-logg…
hollandjg Mar 15, 2024
63a00d0
Update src/icesat2waves/local_modules/m_colormanager_ph3.py
hollandjg Mar 15, 2024
07d2190
Update src/icesat2waves/local_modules/m_tools_ph3.py
hollandjg Mar 18, 2024
f514e3c
Update src/icesat2waves/local_modules/m_general_ph3.py
hollandjg Mar 18, 2024
d4b31bc
update debugging calls with iter.
hollandjg Mar 18, 2024
eda0e16
Merge branch 'feat-logger/5-replace-print-logger-local_modules' of ht…
hollandjg Mar 18, 2024
e105dde
Update src/icesat2waves/local_modules/m_general_ph3.py
hollandjg Mar 19, 2024
fa7b492
Update src/icesat2waves/local_modules/m_tools_ph3.py
hollandjg Mar 19, 2024
c80198d
Update src/icesat2waves/local_modules/m_tools_ph3.py
hollandjg Mar 19, 2024
52c7320
Update src/icesat2waves/local_modules/m_general_ph3.py
hollandjg Mar 19, 2024
ece4f27
Update src/icesat2waves/local_modules/m_general_ph3.py
hollandjg Mar 19, 2024
d2d12e0
Merge branch 'feat-logger/4-replace-print-logger-config' into feat-lo…
hollandjg Mar 19, 2024
8afc4a7
Merge branch 'feat-logger/4-replace-print-logger-config' into feat-lo…
hollandjg Mar 20, 2024
d2ab30e
Merge branch 'feat-logger/4-replace-print-logger-config' into feat-lo…
hollandjg Mar 21, 2024
2c472f8
Merge branch 'main' into feat-logger/5-replace-print-logger-local_mod…
hollandjg Mar 22, 2024
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
11 changes: 6 additions & 5 deletions src/icesat2waves/local_modules/jonswap_gamma.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

import logging
from scipy.constants import g

from lmfit import minimize, Parameters
import copy
import matplotlib.pyplot as plt
import numpy as np

_logger = logging.getLogger(__name__)

#
def normalize_time(time):
Expand Down Expand Up @@ -96,7 +97,7 @@ def JONSWAP_bulk(f, floc=0.04, famp=1e-2, gamma=3.3, peak_std=1e-1):

delta = np.exp(-((w - wp) ** 2) / (2 * peak_std**2 * wp**2))
peak_factor = gamma**delta

# units of m^2 / Hz
return alpha * w ** (-5) * np.exp(-stretch * (w / wp) ** -4) * peak_factor

Expand Down Expand Up @@ -127,7 +128,7 @@ def pierson_moskowitz_fetch_limit(f, X, U):
alpha = 0.076 * (g * X / U**2) ** (-0.22)

wp = 7.0 * np.pi * (g / U) * (g * X / U**2) ** (-0.33)
print("wp=" + str(wp))
_logger.debug("wp=%s", wp)

sigma_p = 0.07
sigma_pp = 0.09
Expand Down Expand Up @@ -170,7 +171,7 @@ def JONSWAP_default(f, X, U, gamma=3.3):

return (
alpha * g**2.0 * w ** (-5.0) * np.exp(-5.0 / 4.0 * (w / wp) ** -4) * peak_factor
) # Hz**-5 m**2 /s**4 = m**2 sec
) # Hz**-5 m**2 /s**4 = m**2 sec


""" add function for X_tilde(X, U10), alpha(f_max, U10) and f_max(U10, X_tilde) or f_max(U, X)"""
Expand Down Expand Up @@ -730,7 +731,7 @@ def reg_func(p0, pi, p_err_unit):
vd[k] = I * np.random.rand()

Jm = Jm_regulizer(vd, priors)
print(Jm)
_logger.debug("Jm from regulizer: %s", Jm)



Expand Down
5 changes: 2 additions & 3 deletions src/icesat2waves/local_modules/m_colormanager_ph3.py
hollandjg marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division

from matplotlib.colors import LinearSegmentedColormap
Expand Down Expand Up @@ -54,7 +53,7 @@ class color:
def __init__(self, path=None, name=None):
self.white=(1,1,1)
if (path is not None) & (name is not None):
_logger.debug("color theme: %s", name)
_logger.debug('color theme: %s', name)
try:
theme=json_load(name, path)
for k, v in theme.items():
Expand Down Expand Up @@ -173,7 +172,7 @@ def colormaps(self,n, gamma=None):

def show(self):
for key in self.__dict__.keys():
_logger.debug(key)
_logger.debug("key: %s", key)

_logger.debug(' rels dict keys:')
for key in self.rels.keys():
Expand Down
Loading