Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing working directories #109

Open
chanokin opened this issue Dec 20, 2018 · 0 comments
Open

missing working directories #109

chanokin opened this issue Dec 20, 2018 · 0 comments

Comments

@chanokin
Copy link
Contributor

The following lines are creating multiple directories at the same level as the parent

if not os.path.exists(self.path + "jube_xml"):
os.makedirs(self.path + "jube_xml")
if not os.path.exists(self.path + "run_files"):
os.makedirs(self.path + "run_files")
if not os.path.exists(self.path + "ready_files"):
os.makedirs(self.path + "ready_files")
if not os.path.exists(self.path + "trajectories"):
os.makedirs(self.path + "trajectories")
if not os.path.exists(self.path + "results"):
os.makedirs(self.path + "results")

Paths should be generated using os.path.join(parent, child). For example,

xml_path = os.path.join(self.path, "jube_xml")
if not os.path.exists(xml_path):
    os.makedirs(xml_path)

The real issue is presented further down in the source code. This seems to be the same as the initial setting

self.filename = self.path + "jube_xml/_jube_" + str(self.generation) + ".xml"

but this is not (notice the leading forward slash after path)
f.write(" <do done_file=\"" + self.path + "/ready_files/ready_w_" + str(
self.generation) + "\">$submit_cmd $job_file </do> <!-- shell command -->\n")

The main issue is that, by manually generating the paths, we lose compatibility between OS-s and risk misplacing files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant