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

TypeError: combine_atlas_model() got an unexpected keyword argument 'variable' #119

Closed
robbibt opened this issue Nov 7, 2022 · 4 comments

Comments

@robbibt
Copy link
Contributor

robbibt commented Nov 7, 2022

Hi @tsutterley, I've been getting this error when trying to model tides using TPXO8-atlas on 1.1.1:

~/Robbi/dea-notebooks/Frequently_used_code/../Tools/dea_tools/coastal.py in model_tides(x, y, time, model, directory, epsg, method, extrapolate, cutoff)
    792     # Read tidal constants and interpolate to grid points
    793     if model.format in ("OTIS", "ATLAS"):
--> 794         amp, ph, D, c = extract_tidal_constants(
    795             lon,
    796             lat,

/env/lib/python3.8/site-packages/pyTMD/read_tide_model.py in extract_tidal_constants(ilon, ilat, grid_file, model_file, EPSG, **kwargs)
    318             if (kwargs['grid'] == 'ATLAS'):
    319                 z0,zlocal = read_atlas_elevation(model_file, i, c)
--> 320                 xi,yi,z = combine_atlas_model(x0, y0, z0, pmask, zlocal,
    321                     variable='z')
    322             elif (kwargs['grid'] == 'ESR'):

TypeError: combine_atlas_model() got an unexpected keyword argument 'variable'

This only occurs in versions > 1.0.6. I think it may be because the extract_tidal_constants code here passes a lowercase variable param to the combine_atlas_model func:
https://github.com/tsutterley/pyTMD/blob/main/pyTMD/read_tide_model.py#L330-L331
https://github.com/tsutterley/pyTMD/blob/main/pyTMD/read_tide_model.py#L399-L400
https://github.com/tsutterley/pyTMD/blob/main/pyTMD/read_tide_model.py#L465-L466

But combine_atlas_model actually accepts an all-caps param VARIABLE:
https://github.com/tsutterley/pyTMD/blob/main/pyTMD/read_tide_model.py#L1259

(it's correctly passed here: https://github.com/tsutterley/pyTMD/blob/main/pyTMD/read_tide_model.py#L211)

@tsutterley
Copy link
Owner

Yep this is a bug from when I tried to address #100. I'll fix it today.

@tsutterley
Copy link
Owner

Thanks for catching it!

tsutterley added a commit that referenced this issue Nov 7, 2022
feat: add IERS https deltat sync
feat: add IERS bulletin-A download
ci: add workflow for appending delta times
chore: update leap seconds list
chore: update deltat file
chore: update mean pole table
chore: update finals file
tsutterley added a commit that referenced this issue Nov 7, 2022
feat: add IERS https deltat sync
feat: add IERS bulletin-A download
ci: add workflow for appending delta times
chore: update leap seconds list
chore: update deltat file
chore: update mean pole table
chore: update finals file
tsutterley added a commit that referenced this issue Nov 7, 2022
feat: add IERS https deltat sync
feat: add IERS bulletin-A download
ci: add workflow for appending delta times
chore: update leap seconds list
chore: update deltat file
chore: update mean pole table
chore: update finals file
@tsutterley
Copy link
Owner

Hopefully everything's good now @robbibt. Let me know if you have any more problems. I'll put together a new release tomorrow so that these fixes are on pypi and conda-forge. thanks again!

@robbibt
Copy link
Contributor Author

robbibt commented Nov 8, 2022

Winner, thankyou! Looking forward to updating to the latest version 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants