gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #15799] Add the autocomplete feature to gnuastro


From: Pedram Ashofteh Ardakani
Subject: [task #15799] Add the autocomplete feature to gnuastro
Date: Mon, 1 Mar 2021 16:55:12 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0

Follow-up Comment #23, task #15799 (project gnuastro):

My pleasure Mohammad! I sure learned some useful tricks coding with you :) I
pushed two commits, latest commit b001e7c272
<https://codeberg.org/gnuastro/gnuastro/commit/b001e7c27296240c25942365fe2d6753daaada14>.

I smartened up the way functions look inside directories for valid FITS files.
Of course, I used 'astfits' since it does its job pretty well! -- as mentioned
in 'Master Foo and the shell tools'
<http://www.catb.org/esr/writings/unix-koans/shell-tools.html> ;)
> For FITS files, you can use `astfits FILE.FITS -q` and look into the third
column [...]
I guess there is no need for that. I just use the 'astfits' return value as a
reference. Is this OK?
> [...] when listing options, files and directories, we separate them [...]
Nice idea! I will see what I can do ASAP :) It is fun to play around with
formatting options that make the outputs easier on the eye.
> [...] It is becoming EXTREMELY USEFUL and I am really excited to be so close
to implementing this in all the programs! [...]
Same here! Thank you for the fast response and helpful tweaks!

----
P.S. Commit Message:

Auto-completion: Faster fits parse, use 'local'

With this commit, I added the '-q' option to 'astfits' program so it will
print less information, hence, it looks might be a bit faster.

Since we can use the 'local' declaration, I removed the 'unset' at the
end of functions and declared their variables as 'local' instead.

Also, there was a misleading typo in comments about return value of the
_gnuastro_autocomplete_plaintext_is_table function. It said the function
would return '1' if the given file is a table, on the contrary, it
returns '0', as it should by the conventions.

----

Auto-completion: Smart list fits files, fix var

Until now, the function responsible for listing the fits files only
checked if the file extension ended with 'fits'. This is not a rebust
test, because other fits files -- that might have different extensions
or no extensions at all -- would be left out.

With this commit, I used 'astfits' program return value to check their
validity regardless of their name or extension. However, this has a bit
of overhead and slows response. We can ignore it if it is not that
significant, and will not ruin user experience.

Also, I replaced a hard-coded value with intended $inputfile variable.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?15799>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]