-
Notifications
You must be signed in to change notification settings - Fork 214
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
Standarize names for virtual files #2755
Comments
I feel that, in general, a bit longer but readable is better than short and difficult to understand. For me, especially I think |
I'm using |
Generally speaking, we're using consistent names for input/output tables/grids. For example, we have
data
parameter for most modules that read a table (with a few exceptions)outfile
parameter (and alsooutput_type
parameter) for modules that write a tablegrid
parameter for modules that read a gridoutgrid
parameter for modules that write a gridBut for virtual files, w're using different names like
infile
,fname
,grdfile
, andcsvfile
. For example,pygmt/pygmt/src/binstats.py
Line 117 in 00dccb4
pygmt/pygmt/src/contour.py
Line 121 in 00dccb4
pygmt/pygmt/src/grdtrack.py
Line 299 in 00dccb4
pygmt/pygmt/src/grdtrack.py
Line 301 in 00dccb4
Things become more complicated when we try to fully get rid of temporary files (#2730) using virtual files. For example, the
grdtrack
function takes a grid file and a table file as input, and writes to a table file. For the three files:grid
[consistent with other modules]points
[good name for this module]outfile
[consistent with other modules]Since we're using virtual files, we also need three virtual file names. In the current grdtrack codes, we use
grdfile
andcsvfile
. They're not good names, so I decided to useingrid
,infile
andoutvfile
in PR #2733, but these three names are also bad, especially thatoutvfile
andoutfile
are very similar and sometimes makes me lost.I believe we will benefit a lot if we can have consistent (exceptions are allowed) and meaningful names for virtual files. IMO, a good name should make it clear that the name is linked to a virtual file, is a input or output file, and is a grid or a table. I think it makes sense to use a leading
v
for virtual files.Maybe names like
vingrid
,vintable
,voutgrid
,vouttable
(a little too long) orvigrid
,vogrid
,votbl
,vitbl
(not readable)?Thoughts?
The text was updated successfully, but these errors were encountered: