Closed yasu-sh closed 1 year ago
@yasu-sh Ah..I do see the bug! The .txt file should not be deleted on the second run. Ideally, if you run it the second time, it will overwrite the existing result files. Do you to have it keep the original result files? If so, I can append a number on the new result files.
@kvb2univpitt Thanks for your quick response and checks.
Do you to have it keep the original result files?
No. I do not have to keep the original result files. It is suitable and valid for me that the causal-cmd overwrites the result files if I specifiy the filename. I think most of users do not want to check the appeded new numbers in filenames every time in this case.
@yasu-sh It's now fixed in the new release causal-cmd-1.4.2.
@kvb2univpitt What's a lovely action! I have cloned the repository and built it. it is solved. I remembered the meaning of "prefix", out of consideration of "prefix" - "root" - "suffix" relationship.
fges_(numericdatetime).txt - fges(numeric_datetime)_graph.json ... "datetime" is root? (prefix).txt - (prefix)_graph.json ...
But my intention has been already accepted. Related arguments names may be changed if developes like!
I checked the behaviors and building at:
@yasu-sh I agree. It's a bit confusing with the --prefix flag. Initially, it was only meant for JSON graph output. But, I have extended to the text output. I should fix it so that the text output should look like this <prefix>_out.txt
when ---prefix
is used, otherwise <algorithm_name>_<numeric timestamp>_out.txt
. Any suggestions? By the way, I really appreciate your help in posting bugs. :)
@kvb2univpitt <prefix>_out.txt
would be reasonable for import programs to promise always latest output files. Intially users use interactive execution, then using the results from outside, for example converting to diagrams(node - edges).
I feel comfortable to name <prefix>_out.txt
since PrintStream
in defined in the code is subclass of OutputStream in java.io class.
@yasu-sh Sounds good. Instead of making another release, I'll just add it to the 1.4.2 release. I'll reopen this issue. You can close it once you verify that it's working.
@kvb2univpitt I see. I'll have a look after updated code is commited. Thanks for your kindness.
@yasu-sh OK. It's fixed. I also fixed the help description for the prefix command-line option so that people know what the prefix is replacing:
Replace the default output filename prefix in the format of <algorithm>_<numeric timestamp>.
@kvb2univpitt It works! Thanks a lot. I confirmed as below.
PS asia> dir c-tetrad*
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2022/12/14 11:15 43347 c-tetrad_graph.json
-a---- 2022/12/14 11:15 2306 c-tetrad_out.txt
PS asia> dir c-tetrad*
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2022/12/14 11:16 37942 c-tetrad_graph.json
-a---- 2022/12/14 11:16 2192 c-tetrad_out.txt
Hi,
I doubt if the existing json file suppreess the .txt file output when json-graph with prefix. Could you fix this issue without workarounds? it makes better.
I guess the process is as below:
So far, I have used the workaround:
asia.csv data: asia.csv (created from bnlearn, data(asia)) causal-cmd version 1.4.1, downloaded from https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/causal-cmd/1.4.1/