Skip to content

Commit

Permalink
fix: verify case of constituents in comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutterley committed Jan 13, 2024
1 parent f33587e commit d6b6413
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pyTMD/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def arguments(
G = np.zeros((nt,nc))
for i,c in enumerate(constituents):
# map between given constituents and supported in tidal program
j, = [j for j,val in enumerate(cindex) if (val == c)]
j, = [j for j,val in enumerate(cindex) if (val == c.lower())]
pu[:,i] = u[:,j]*dtr
pf[:,i] = f[:,j]
G[:,i] = arg[:,j]
Expand Down Expand Up @@ -688,8 +688,8 @@ def doodson_number(
formalism: str, default 'Doodson'
constituent identifier formalism
- ``'Doodson'``
- ``'Cartwright'``
- ``'Doodson'``
Returns
-------
Expand Down Expand Up @@ -719,7 +719,7 @@ def doodson_number(
coefficients = _arguments_table(**kwargs)
if isinstance(constituents, str):
# map between given constituents and supported in tidal program
j, = [j for j,val in enumerate(cindex) if (val == constituents)]
j, = [j for j,val in enumerate(cindex) if (val == constituents.lower())]
# extract identifier in formalism
if (kwargs['formalism'] == 'Cartwright'):
# extract Cartwright number
Expand All @@ -733,7 +733,7 @@ def doodson_number(
# for each input constituent
for i,c in enumerate(constituents):
# map between given constituents and supported in tidal program
j, = [j for j,val in enumerate(cindex) if (val == c)]
j, = [j for j,val in enumerate(cindex) if (val == c.lower())]
# convert from coefficients to Doodson number
if (kwargs['formalism'] == 'Cartwright'):
# extract Cartwright number
Expand Down
2 changes: 1 addition & 1 deletion pyTMD/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def infer_minor(
z = np.ma.zeros((n,9),dtype=np.complex64)
nz = 0
for i,c in enumerate(cindex):
j = [j for j,val in enumerate(constituents) if (val == c)]
j = [j for j,val in enumerate(constituents) if (val.lower() == c)]
if j:
j1, = j
z[:,i] = zmajor[:,j1]
Expand Down

0 comments on commit d6b6413

Please sign in to comment.