[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: |
Tue, 2 Mar 2021 16:08:12 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0 |
Follow-up Comment #24, task #15799 (project gnuastro):
Hello again Mohammad :) I have pushed 6 new atomic commits
<https://codeberg.org/gnuastro/gnuastro/compare/b001e7c27296240c25942365fe2d6753daaada14...2df2c6aff03a2fb17c940dc02bdb3ef0414900db>,
so you can cherry pick if need be. I will try to work on your previous
suggestions soon :)
Cheers
----
P.S.Commit Message
Auto-completion: Refactor FITS related functions
Until now, each function that had something to do with fits file had a
different approach of making sure the input file is actually a fits file.
However, Mohammad wrote a special function that checks if an input file
is an actual existing FITS file, regardless of its extension. With this
commit, I moved those functions below the '..._is_fits' function.
>From now on, we should be careful to feed only valid FITS file to fits
accepting functions, or there will be confusing errors.
Also, I revised some comments on different functions and replaced some
variables with their human-readable substitutes.
----
Auto-completion: return value from last table
Until now, the _gnuastro_autocomplete_last_table function would not
return anything. It would just set a global variable. However, it might
be a better idea to use return values instead of breaking the loops.
Because later we can use the return value as a signal if need be.
----
Auto-completion: Rename boolean query functions
Until now, functions that validated if a file is FITS or a plaintext
table were named like: _gnuastro_autocomplete_x_is_extension
However, it might be a better naming style as if we were asking the
functions whether the input file is the extension we want or not as:
_gnuastro_autocomplete_is_x_extension (?) and we'd expect a 0 or 1 as
return. With this commit, I have renamed two functions accordingly.
----
Auto-completion: Human readable arguments
Until now, some functions just used the raw '$1', '$2', etc. to refer to
given arguments. With this commit, some of these arguments are given more
specific names to improve and maintain code readability.
Also, I moved some comment blocks out of functions to respect the coding
standards as Mohammad mentioned previously.
----
Auto-completion: Suggest plaintext tables too
Until now, autocomplete only suggested FITS files as input. With this
commit, plaintext files will be shown too.
Also, I have added the _gnuastro_autocomplete_list_all_valid_files
function to prevent redundant iteration over a list of files to check
for all acceptable file types.
----
Auto-completion: Call astfits/asttable consistently
With this commit, the auto-completion script calls for astfits and
asttable only using their stored name in the script beginning. They are
'$_gnuastro_astfits' and '$_gnuastro_asttable'.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/task/?15799>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/