tvelden / communities

Network analysis of scientific community structures
3 stars 3 forks source link

parameter directory path #4

Closed SkotBotCambo closed 12 years ago

SkotBotCambo commented 12 years ago

I think that this issue of not universally being able to find the parameter path could be best fixed by using the relative path "../../../parameters/parameters-global.txt"

If all of our directory structures are as we discussed, this should always work, right?

sa738 commented 12 years ago

The problem was with Scott's Dropbox and now that has been resolved.

tvelden commented 12 years ago

What I am still puzzled by is why networkbuild.py would make use of the system level pwd command to get the absolute path. To me this seems unnecessarily fragile. If the absolute path is not needed, why introduce it? All that networkbuild.py needs to care about is a) where the parameter file sits relative to the directory in which networkbuild.py is run - and that is known by convention: from communities/code/build-networks/co-author/ the parameter file can be reached by ../../../parameters/parameters-global.txt, and b) the relative paths to the input and output directories that may be sitting anywhere. These paths are specified starting from the top level directory of the git repo (i.e. communities) in the parameter file. Where the python script is relative to the top level directory of the git repo is, namely communities/code/build-networks/co-author/, is again known by convention, so the place where the input comes from or the output is written to can be deduced from stitching together the location of the python script within the git repository and the fragment of the relative path from the repository top level directory to the input/output locations as specified in the parameter file.

Am I perhaps missing something?

tvelden commented 12 years ago

On second thought, perhaps the idea is that this way (using pwd) the screen output that the script produces, incl. error messages, specifies the absolute paths on the local system, thereby making it easier for the user to figure out why a path may be broken? In which case, unless the call to the system level command is fragile, this might be a good idea!

sa738 commented 12 years ago

This system is working well so far. I think we will think about changing this if we face any major problem. From my python code, it should not be a big problem, I believe :-)

tvelden commented 12 years ago

So let's leave it as is for now. Closing issue.