Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upChange approach to input and output paths. Issue 47 #63
Conversation
greebie
added some commits
Sep 20, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianmilligan1
Sep 24, 2018
Member
Thanks for re-staging the PR @greebie. Looking good! Two quick queries.
First – just tested on an Ubuntu machine with syntax like:
./graphpass /mnt/vol1/data_sets/auk_datasets/graphpass_test/9717-gephi.graphml ./9717-gephi.gexf -qg
Seems to be working but this popped up as an error before SUCCESS:
non-option ARGV-elements: OUTARG:./9717-gephi.gexf
Is this expected behaviour?
Second, if I don't provide a relative path but just the filename, i.e.
./graphpass /mnt/vol1/data_sets/auk_datasets/graphpass_test/9717-gephi.graphml 9717-gephi2.gexf -qg
I get
non-option ARGV-elements: OUTARG:9717-gephi2.gexf
Segmentation fault (core dumped)
Is this expected behaviour?
Thanks for re-staging the PR @greebie. Looking good! Two quick queries. First – just tested on an Ubuntu machine with syntax like:
Seems to be working but this popped up as an error before SUCCESS:
Is this expected behaviour? Second, if I don't provide a relative path but just the filename, i.e.
I get
Is this expected behaviour? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianmilligan1
Sep 24, 2018
Member
Also, circling back to the outstanding comments on #62. @ruebot noted:
It will only try to create the output directory if stdout does not exist. Otherwise it will just use stdout.
That's not how stdout works. We shouldn't be clobbering an existing file if an option isn't given, nor creating a new directory.
and
Can you explain the rationale here? It's my understanding that stdout should just be stdout. I don't understand the use case of forcing the creation of an output dir.
Is it possible to move forward on making this straightforward stdin stdout syntax? Thanks @greebie!
Also, circling back to the outstanding comments on #62. @ruebot noted:
and
Is it possible to move forward on making this straightforward stdin stdout syntax? Thanks @greebie! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
greebie
Sep 25, 2018
Collaborator
First – just tested on an Ubuntu machine with syntax like:
./graphpass /mnt/vol1/data_sets/auk_datasets/graphpass_test/9717-gephi.graphml ./9717-gephi.gexf -qg
Seems to be working but this popped up as an error before SUCCESS:
non-option ARGV-elements: OUTARG:./9717-gephi.gexf
This is the same as the previous behavior, but I would like to change it.
Is this expected behaviour?
Second, if I don't provide a relative path but just the filename, i.e.
./graphpass /mnt/vol1/data_sets/auk_datasets/graphpass_test/9717-gephi.graphml 9717-gephi2.gexf -qg
I get
non-option ARGV-elements: OUTARG:9717-gephi2.gexf Segmentation fault (core dumped)
Is this expected behaviour?
This is not the expected behavior. I will fix.
This is the same as the previous behavior, but I would like to change it.
This is not the expected behavior. I will fix. |
greebie
added some commits
Sep 25, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
greebie
Sep 25, 2018
Collaborator
Also, circling back to the outstanding comments on #62. @ruebot noted:
It will only try to create the output directory if stdout does not exist. Otherwise it will just use stdout.
That's not how stdout works. We shouldn't be clobbering an existing file if an option isn't given, nor creating a new directory.
and
Can you explain the rationale here? It's my understanding that stdout should just be stdout. I don't understand the use case of forcing the creation of an output dir.
Is it possible to move forward on making this straightforward stdin stdout syntax? Thanks @greebie!
I think I have this resolved in the current push. However, in doing so I broke a test (as per Travis fail).
I would also like to create some tests (tomorrow) before this merges.
I think I have this resolved in the current push. However, in doing so I broke a test (as per Travis fail). I would also like to create some tests (tomorrow) before this merges. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianmilligan1
Sep 25, 2018
Member
OK, can you ping me @greebie when you want me to test this. I'm out of office tomorrow afternoon and Thursday morning so might be a delay.
OK, can you ping me @greebie when you want me to test this. I'm out of office tomorrow afternoon and Thursday morning so might be a delay. |
greebie
added some commits
Sep 25, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
greebie
Sep 26, 2018
Collaborator
Assuming the latest build passes Travis, it should complete all the outstanding issues mentioned.
- graphpass does not create a new directory, other than for unit tests (which are deleted after build).
- will not create an out file if stdout and stdin paths are the same.
- will work for test case where stdout is just a file, defaulting to "./".
- created test suite for the new functions, get_directory and get_filename to try and capture issues before they hatch.
Assuming the latest build passes Travis, it should complete all the outstanding issues mentioned.
|
ianmilligan1
requested changes
Sep 27, 2018
ruebot
requested changes
Sep 28, 2018
First pass review. There will be more to come.
First, please use stderr instead of manually creating errors.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianmilligan1
Sep 28, 2018
Member
@greebie since you pinged me to say you weren't able to reproduce the overwriting files.
On rho if I run:
./graphpass /mnt/vol1/data_sets/auk_datasets/graphpass_test/9717-gephi.graphml 9717-gephi2.gexf -qg
It overwrites the existing file.
@greebie since you pinged me to say you weren't able to reproduce the overwriting files. On rho if I run:
It overwrites the existing file. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
greebie
Oct 1, 2018
Collaborator
Hi Ian - when you say it overwrites the existing file, do you mean 9719-gephi2.gexf
or 9717-gephi.graphml
? I was worried about the latter and the former would (currently) be the expected behavior. I hadn't considered the possibility of preventing over-write if it's not desired.
I can add an over-write flag and make it so that 9717-gephi2.gexf
becomes 9717-gephi.gexf0
(or 9717-gephi.gexf1
and so on) if that's the desired behavior you are looking for?
Hi Ian - when you say it overwrites the existing file, do you mean I can add an over-write flag and make it so that |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianmilligan1
Oct 1, 2018
Member
I can add an over-write flag and make it so that 9717-gephi2.gexf becomes 9717-gephi.gexf0 (or 9717-gephi.gexf1 and so on) if that's the desired behavior you are looking for?
That sounds good to me. What do you think @ruebot ?
That sounds good to me. What do you think @ruebot ? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
greebie
Oct 1, 2018
Collaborator
Okay - is it okay if we put that in another issue? It's possible that I can break things while building this functionality, so I'd like to be able to track it.
Okay - is it okay if we put that in another issue? It's possible that I can break things while building this functionality, so I'd like to be able to track it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ruebot
Oct 1, 2018
Member
@greebie I'm noticing FAILURE
messages in the build, but the tests don't fail. Is this expected behaviour? I see it here, and locally.
[nruest@wombat:graphpass] (git)-[issue-47]-$ make clean all
rm -f qp
rm -f ana
rm -f io
rm -rf TEST_OUT_FOLDER
rm -rf build/
rm -f graphpass
gcc ./vendor/unity/unity.c ./src/tests/runner_test_qp.c -I./src/headers -I/usr/local/include/igraph -I./vendor/unity ./src/tests/quickrun_test.c src/main/analyze.c src/main/filter.c src/main/gexf.c src/main/io.c src/main/quickrun.c src/main/reports.c src/main/rnd.c src/main/viz.c -L/usr/local/lib -ligraph -lm -o qp
gcc ./vendor/unity/unity.c ./src/tests/runner_test_ana.c -I./src/headers -I/usr/local/include/igraph -I./vendor/unity ./src/tests/analyze_test.c src/main/analyze.c src/main/filter.c src/main/gexf.c src/main/io.c src/main/quickrun.c src/main/reports.c src/main/rnd.c src/main/viz.c -L/usr/local/lib -ligraph -lm -o ana
gcc ./vendor/unity/unity.c ./src/tests/runner_test_io.c -I./src/headers -I/usr/local/include/igraph -I./vendor/unity ./src/tests/io_test.c src/main/analyze.c src/main/filter.c src/main/gexf.c src/main/io.c src/main/quickrun.c src/main/reports.c src/main/rnd.c src/main/viz.c -L/usr/local/lib -ligraph -lm -o io
./ana
src/tests/analyze_test.c:14:TEST_DEGREE_ALGORITHM:PASS
src/tests/analyze_test.c:25:TEST_INDEGREE_ALGORITHM:PASS
src/tests/analyze_test.c:36:TEST_OUTDEGREE_ALGORITHM:PASS
src/tests/analyze_test.c:47:TEST_BETWEENNESS_ALGORITHM:PASS
src/tests/analyze_test.c:58:TEST_AUTHORITY_ALGORITHM:PASS
src/tests/analyze_test.c:69:TEST_HUB_ALGORITHM:PASS
src/tests/analyze_test.c:99:TEST_EIGENVECTOR_ALGORITHM:IGNORE: Eigenvector has some random elements that need to be seeded
src/tests/analyze_test.c:91:TEST_PAGERANK_ALGORITHM:PASS
src/tests/analyze_test.c:102:TEST_MODULARITY:PASS
src/tests/analyze_test.c:113:TEST_RANKORDER:PASS
src/tests/analyze_test.c:138:TEST_MEAN:PASS
src/tests/analyze_test.c:151:TEST_VARIANCE:PASS
src/tests/analyze_test.c:164:TEST_STD:PASS
src/tests/analyze_test.c:177:TEST_STDERROR:PASS
src/tests/analyze_test.c:190:TEST_TTEST:PASS
src/tests/analyze_test.c:203:TEST_TPVALUE:PASS
-----------------------
16 Tests 0 Failures 1 Ignored
OK
./qp
src/tests/quickrun_test.c:22:TEST_QUICKRUN_NOSAVE:PASS
src/tests/quickrun_test.c:29:TEST_QUICKRUN_DEGREE:PASS
src/tests/quickrun_test.c:51:TEST_QUICKRUN_COLOR:PASS
src/tests/quickrun_test.c:40:TEST_QUICKRUN_SIZE:PASS
src/tests/quickrun_test.c:72:TEST_QUICKRUN_GEXF:PASS
src/tests/quickrun_test.c:80:TEST_QUICKRUN_GRAPHML:PASS
-----------------------
6 Tests 0 Failures 0 Ignored
OK
./io
src/tests/io_test.c:43:TEST_GET_DIRECTORY:PASS
src/tests/io_test.c:55:TEST_GET_FILE:PASS
src/tests/io_test.c:68:TEST_STRIP_EXT:PASS
>>> FAILURE - Could not find graphML file at filepath location.
src/tests/io_test.c:74:TEST_LOAD_GRAPH:PASS
>>> FAILURE - Could not create file at selected output location.
>>> - Ensure that your assigned output folder exists.
src/tests/io_test.c:85:TEST_WRITE_GRAPH:PASS
-----------------------
5 Tests 0 Failures 0 Ignored
OK
gcc src/main/*.c -I./src/headers -I/usr/local/include/igraph -I./vendor/unity -L/usr/local/lib -ligraph -lm -o graphpass
./graphpass -qnv
>>>>>>> GRAPHPASSING >>>>>>>>
FILEPATH: src/resources/cpp2.graphml
OUTPUT DIRECTORY: ./
PERCENTAGE: 0.000000
FILE: cpp2.graphml
METHODS STRING: d
QUICKRUN: 1
REPORT: 0
SAVE: 0
Running graphpass on file: src/resources/cpp2.graphml
Successfully ingested graph with 218 nodes and 220 edges.
Quickrun requested.
Quickrun does no filtering, and provides layout information
based on Degree (nodesize), Walktrap Modularity (color), and
the Fructerman-Rheingold algorithm to maximize space between
nodes.
Quickrun is quicker, but less informative in terms of output.
Calculating Degree...
Calculating Modularity...
Assigning Colors...
Assigning Degree values...
Scaling graph with degree values...
Producing layout details...
>>>> SUCCESS!- NO_SAVE requested, so no output.
You'll also need to update .gitignore
to include the new items to the build process:
TEST_OUT_FOLDER/
ana
io
qp
@greebie I'm noticing
You'll also need to update
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
greebie
Oct 1, 2018
Collaborator
@ruebot That is the expected behavior because I created tests that check that graphpass fails when it is supposed to, but I do not think this is desired behavior. Let me see if I can test those features more gracefully.
@ruebot That is the expected behavior because I created tests that check that graphpass fails when it is supposed to, but I do not think this is desired behavior. Let me see if I can test those features more gracefully. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ruebot
Oct 1, 2018
Member
@ianmilligan1 with the overwrite. Can you add the steps you took? If the gexf
file already exists and the output location, it is going get clobbered. That's how cat
or any utility is going to work.
@ianmilligan1 with the overwrite. Can you add the steps you took? If the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ianmilligan1
Oct 1, 2018
Member
I'm happy with the overwriting if you are, @ruebot, as I was just noting as you said above "If the gexf file already exists and the output location, it is going get clobbered." If we're cool with that happy to move forward.
I'm happy with the overwriting if you are, @ruebot, as I was just noting as you said above "If the gexf file already exists and the output location, it is going get clobbered." If we're cool with that happy to move forward. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ruebot
Oct 1, 2018
Member
Ah, yeah. I see what you mean. I was talking about the OUTPUT
directory getting created, and everything that went with that. Sorry for the confusion there.
Ah, yeah. I see what you mean. I was talking about the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
greebie
Oct 1, 2018
Collaborator
Okay great. The current issues I will address are:
- add new test files to .gitIgnore
- try to avoid fail messages on tests, probably by creating a TEST flag.
Okay great. The current issues I will address are:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ruebot
requested changes
Oct 2, 2018
Functionality appears to be good to go. Lots of cleanup here, and after that I believe we should be good to go.
ruebot
requested changes
Oct 4, 2018
Couple tiny things, then I think we're good to go.
greebie commentedSep 20, 2018
GitHub issue(s):
#47
What does this Pull Request do?
./graphpass {input path} {output path} -flags --optionA {data}
How should this be tested?
./graphpass {/path/to/file.graphml} {/path/to/output} -q
should do a quickpass tooutput.graphml.
./graphpass {/path/to/file.graphml} {/path/to/output/} -qg
should do a quickpass tofile.gexf
Additional Notes:
./graphpass {/path/to/file.graphml} {/path/to/} -q
may replace the input filefile.graphml
in current commits. This will need to be repaired or managed (see comments in #62).Interested parties
@ianmilligan1 @ruebot
Thanks in advance for your help with the Archives Unleashed Project!