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

don't force user to provide length of output string #115

Closed
michaelaye opened this issue Jul 28, 2015 · 3 comments
Closed

don't force user to provide length of output string #115

michaelaye opened this issue Jul 28, 2015 · 3 comments
Milestone

Comments

@michaelaye
Copy link
Contributor

This comes from C of course but is very un-pythonic.
See for example for getfov:

http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getfov_c.html

the required inputs are 4:

   VARIABLE  I/O  DESCRIPTION 
   --------  ---  -------------------------------------------------- 
   instid     I   NAIF ID of an instrument.
   room       I   Maximum number of vectors that can be returned. 
   shapelen   I   Space available in the string `shape'.
   framelen   I   Space available in the string `frame'.
   shape      O   Instrument FOV shape. 
   frame      O   Name of the frame in which FOV vectors are defined. 
   bsight     O   Boresight vector. 
   n          O   Number of boundary vectors returned. 
   bounds     O   FOV boundary vectors. 

but shapelen and framelen are just the lengths for the strings of shape and frame in the output. This is usually not required in Python and it would be nice if the user, especially the not-C versatile user who does not understand what is going on, would not need to provide this number.
How about setting it to something large like 100 that SpiceyPy sets internally whereever such length of a string is required?
What do people think? I think, but am not sure now, that we did that at PySPICE?

@AndrewAnnex
Copy link
Owner

So I think I will actually find time soon to tackle this, what I think makes sense is to keep the parameters but define a large enough default value so that users can optionally override that default.

@AndrewAnnex AndrewAnnex added this to the v0.7.0 milestone Oct 17, 2015
@michaelaye
Copy link
Contributor Author

I'm not sure the user ever needs or should need to set that default? In Python I don't need to know the length of a returning string, to require that knowledge is very un-pythonic and is a pure remnant from C/FORTRAN. If it's easier to /hide/ it for you by setting defaults, I can understand that as a reason, but I don't see why to keep it. Our pyspice implementation got rid of it completely, IIRC.

@AndrewAnnex
Copy link
Owner

yeah I will look into this, I wanted to keep those available adjustable in case whatever magic number I decided on was too much or too little.

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

No branches or pull requests

2 participants