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

sct expected at most 15 arguments, got 16 #25

Open
gpbalsamo opened this issue Jun 12, 2023 · 4 comments
Open

sct expected at most 15 arguments, got 16 #25

gpbalsamo opened this issue Jun 12, 2023 · 4 comments

Comments

@gpbalsamo
Copy link

Hi, In the example posted here
https://tnipen.github.io/2020/06/15/titanlib-gridpp.html
the call to sct generates an error and I report here a log:

TypeError Traceback (most recent call last)
Cell In[142], line 14
11 t2neg = np.full(len(obs), 4)
12 eps2 = np.full(len(obs), 0.5)
---> 14 flags, sct, rep = titanlib.sct(obs_lats, obs_lons1, obs_elevs, obs, num_min, num_max, inner_radius, outer_radius, num_iterations, num_min_prof, dzmin, dhmin , dz, t2pos, t2neg, eps2)

File ~/.local/lib/python3.10/site-packages/titanlib.py:883, in sct(*args)
882 def sct(*args):
--> 883 return _titanlib.sct(*args)

TypeError: sct expected at most 15 arguments, got 16
Additional information:
Wrong number or type of arguments for overloaded function 'sct'.
Possible C/C++ prototypes are:
titanlib::sct(titanlib::Points const &,titanlib::vec const &,int,int,float,float,int,int,float,float,float,titanlib::vec const &,titanlib::vec const &,titanlib::vec const &,titanlib::vec &,titanlib::vec &,titanlib::ivec const &)
titanlib::sct(titanlib::Points const &,titanlib::vec const &,int,int,float,float,int,int,float,float,float,titanlib::vec const &,titanlib::vec const &,titanlib::vec const &,titanlib::vec &,titanlib::vec &)

@cristianlussana
Copy link
Collaborator

Hi Gianpaolo,

I believe we changed the function signature for titanlib.sct() since that example has been posted. Thomas Nipen (@tnipen) can confirm this.
I suggest you look more into the examples in the two repositories:

https://github.com/metno/gridpp
(wiki https://github.com/metno/gridpp/wiki)
tests: https://github.com/metno/gridpp/tree/master/tests

https://github.com/metno/titanlib
(wiki https://github.com/metno/titanlib/wiki)
queste due pagine sono sicuro che sono aggiornate.
tests: https://github.com/metno/titanlib/tree/master/tests

For instance, in the file
https://github.com/metno/titanlib/blob/master/tests/sct_test.py
you may find an example of how to use titanlib.sct(), which is updated with the most recent version of the function. See here:
https://github.com/metno/titanlib/blob/master/include/titanlib.h
(from line 67 to line 102)

Hope this helps,
Cristian

@gpbalsamo
Copy link
Author

gpbalsamo commented Jun 13, 2023 via email

@gpbalsamo
Copy link
Author

gpbalsamo commented Jun 15, 2023 via email

@tnipen
Copy link
Member

tnipen commented Jun 20, 2023

Dear Gianpaolo.

Thanks for letting us know about the incorrect code in the blog post. I have updated it to reflect the changes that were made to titanlib.

Thomas

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

3 participants