Skip to content

missing working directories #109

@chanokin

Description

@chanokin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions