rivetTDA / rivet

RIVET is a tool for Topological Data Analysis, in particular two-parameter persistent homology.
GNU General Public License v3.0
73 stars 24 forks source link

RIVET GUI Doesn't load Precomputed Files / Suffix Issue #70

Closed mlesnick closed 7 years ago

mlesnick commented 7 years ago

Originally reported by: M L (GitHub: mlesnick)


I realized I'd never tried to actually save and load a precomputed file in the binary format.

I did a computation, saved it, and tried to load it, but the file I created had its name greyed out, so that it can't be selected.

This may be related to another inconvenient quirk of RIVET that I have not bothered to mention up until this point: When you create a RIVET input file for raw data, RIVET (on OSX at least) will not open that file unless it's suffix is .txt.

This seems suboptimal, since .txt is completely undescriptive of what the file is. I would suggest to remove this constraint.

Anyway, I'm guessing that the issue here causing this bug is that the same suffix-checking feature is preventing me from opening the file, because the generated suffix for the new binary format is empty or different than what RIVET expects.

Not sure though: just a guess.

mlesnick commented 7 years ago

Original comment by M L (GitHub: mlesnick):


Oops, I think this is a mistake--I was in the wrong branch. When I switched to the right branch this worked (but there were other new problems, described elsewhere).

mlesnick commented 7 years ago

Original comment by Matthew Wright (GitHub: mlwright84):


Mike, I think your previous comment got truncated somehow.

mlesnick commented 7 years ago

Original comment by M L (GitHub: mlesnick):


I tested this. The file names with no suffix are gret

mlesnick commented 7 years ago

Original comment by Bryn Keller (GitHub: xoltar):


OK, done, thanks!

mlesnick commented 7 years ago

Original comment by Matthew Wright (GitHub: mlwright84):


Bryn, your fix is more sophisticated than mine. It doesn't really matter to me whether the text files filter is included or not. Feel free to merge neptune into master and overwrite my fix.

mlesnick commented 7 years ago

Original comment by Bryn Keller (GitHub: xoltar):


Hi Matthew, looks like we were both working on this. I have an alternate fix in aa8bc81 (neptune branch):

[neptune aa8bc81] Made file dialogs remember last chosen directory. Save dialogs now suggest file names based on input parameters (and offset and angle in the case of .png files). Also, removed Text Files (*.txt) filter from selection dialog.

mlesnick commented 7 years ago

Original comment by Matthew Wright (GitHub: mlwright84):


I just pushed a fix in commit 67e7f17. Mike, please see if this fixes the problem.

mlesnick commented 7 years ago

Original comment by Matthew Wright (GitHub: mlwright84):


The file type selector in the "open file" dialog box is specified in line 83 of dataselectdialog.cpp. I think I see a problem in this line that likely causes the issue Mike experienced: the "all files" option may only display files that have a period in their filename. I think I can fix this easily.

(In fact, there is a second problem with this line: the default directory is a directory on the computer I used at the IMA. I will fix that, too.)

I am inclined to leave the "text files" filter as an option that the user may select. If they don't want to use that filter, then they don't have to.

I do not think that RIVET should require any suffix on file names. Furthermore, I don't think that any other line of RIVET code, other than the line I mentioned above, checks for such a suffix.

I will push a fix soon.

mlesnick commented 7 years ago

Original comment by M L (GitHub: mlesnick):


I am fine to remove the text file filter, if Matthew is.

So there are two possible routes to take: 1)Eliminate any constraints on the suffix for rivet files.

2)Explicitly require a certain suffix (like .txt, or .rivet, .riv), or even two separate suffixes for precomputed files and raw data files. Then make sure that RIVET always automatically saves precomputed files in the right format.

I don't know what is best; I'll leave it to the others to decide. My guess is that the easiest option is to just remove the constraint that RIVET only takes files with suffixes. But even if we do that, it might be good to have RIVET save with a default suffix.

mlesnick commented 7 years ago

Original comment by M L (GitHub: mlesnick):


For me, the file with no suffix is greyed out whether .txt files or all files is selected.

mlesnick commented 7 years ago

Original comment by M L (GitHub: mlesnick):


I just tried something simple before that I should have tried before writing this: I changed the suffix of the file manually to .txt. This solved the problem and the file opened without any issue. Then I changed the suffix to .rivet, and it was also fine. It is only with a blank suffix that the file becomes greyed out. However, the default save option for me does not append a suffix, and most OSX users will not think to provide their own suffix.

mlesnick commented 7 years ago

Original comment by Bryn Keller (GitHub: xoltar):


Actually, if I click "Options" at the bottom of the file chooser dialog, I get the choice to switch between All Files (*.*) (which is the default for me) and Text Files (*.txt). If I choose Text Files, I get the behavior described.

Do we want to remove the Text Files filter entirely?

mlesnick commented 7 years ago

Original comment by Bryn Keller (GitHub: xoltar):


I can't duplicate this one. My OS X RIVET lets me (try to) open any file with any suffix. In particular, I can save a file with .rivet extension from the GUI, and then relaunch the GUI and open that same file.