SocialCognitiveSystems / PRIMO

GNU Lesser General Public License v3.0
4 stars 3 forks source link

Allow relativ loading of dbn networks from conf #14

Closed jpoeppel closed 6 years ago

jpoeppel commented 6 years ago

DBNSpec currently assumes that the network xbif-files for b0 and 2tbn are located in the working directory. This fix will always search for those files relative to the directory of the conf-file.

hbuschme commented 6 years ago

Looks good so far.

As an edge case we could check whether xbfi-files in the spec are referenced with an absolute path and, if so, use it as such. Or do you think that would be to much?

jpoeppel commented 6 years ago

How would you go about distinguishing absolut from relativ paths? Starting with "/"?

hbuschme commented 6 years ago

os.path has a function isabs that does this.

jpoeppel commented 6 years ago

I know, but this basically just means it starts with a "/" (for unix systems). I am fine with adding it when we document it somewhere explicitly (we should document the structure of the conf files anyways).

hbuschme commented 6 years ago

I agree, especially as I had problems explaining it myself yesterday. I created an issue: #18