@@ -10,43 +10,27 @@ def get_git_revision_hash():
1010 Get the hash for the git commit currently being used.
1111
1212 @return The most recent commit hash or a suitable message
13-
1413 """
15-
1614 return __commit_id__
1715
1816
1917def get_build_type ():
20- if "dev" in __version__ :
21- return "Develop"
22- else :
23- return "Release"
18+ return 'Develop' if 'dev' in __version__ else 'Release'
2419
2520
26- def setup_output_directory (dirname : str = None , subdir_name : str = None ):
21+ def setup_output_directory (dirname : str ):
2722 """
2823 Create an output directory if one doesn't already exist. Place an info
2924 file in this directory which lists the date/time created, the version of
3025 pcpostprocess, the command-line arguments provided, and the most recent git
3126 commit. The two parameters allow for a user specified top-level directory and
3227 a script-defined name for a subdirectory.
3328
34- @param Optional directory name
35- @param Optional subdirectory name
29+ @param Directory name
3630
3731 @return The path to the created file directory (String)
3832 """
39-
40- if dirname is None :
41- if subdir_name :
42- dirname = os .path .join ("output" , f"{ subdir_name } " )
43- else :
44- dirname = os .path .join ("output" , "output" )
45-
46- if subdir_name is not None :
47- dirname = os .path .join (dirname , subdir_name )
48- if not os .path .exists (dirname ):
49- os .makedirs (dirname )
33+ os .makedirs (dirname , exist_ok = True )
5034
5135 with open (os .path .join (dirname , "pcpostprocess_info.txt" ), "w" ) as description_fout :
5236 git_hash = get_git_revision_hash ()
0 commit comments