Make DATAPATH configurable and fix path joins (fixes #3)#5
Open
mkzung wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
preprocess_glass.pyandpreprocess_sub2vec.pyhardcodeDATAPATH = "./dataset/"and the README tells users to edit it by hand (issue #3). Paths are built by string concatenation with an inconsistent leading slash (DATAPATH+"/background_nodes.csv"vsDATAPATH+"connected_components.csv"), so both groups only work because the default value ends in/. If a user sets the naturalDATAPATH="./dataset"(no trailing slash), the second group produces./datasetconnected_components.csvand the scripts crash withFileNotFoundError.Fix
--datapathargument (falls back to$ELLIPTIC2_DATAPATH, default./dataset) so the folder no longer needs hand-editing (closes Ease of use #3).os.path.join, removing the trailing-slash dependency and the./dataset//...double slash.n2id[c1]->n2id[c2]in thec2branch).train/valvariables are removed).Verified without downloading the full dataset: both
./datasetand./dataset/now resolve correctly, and both scripts compile.