center-randomize icon indicating copy to clipboard operation
center-randomize copied to clipboard

fix/output directory generation not working as expected.

Open padam-ghimire opened this issue 10 months ago • 1 comments

It appears that OUTPUT_DIR is the base directory, and you're trying to create two files within it. However, when you're specifying the file paths for writing, you're not directly referencing OUTPUT_DIR for the second file.

You're using args.output, which only contains the filename, not the full path. To ensure that both files are created within the OUTPUT_DIR, you should use os.path.join() to construct the full file paths

create_dir(OUTPUT_DIR) # Create the output directory if not exists
with open(os.path.join(OUTPUT_DIR, 'school-center-distance.tsv'), 'w', encoding='utf-8') as intermediate_file, \
open(os.path.join(OUTPUT_DIR, args.output), 'w', encoding='utf-8') as a_file:

This way, both files will be created within the OUTPUT_DIR, resolving the issue with the output directory generation.

padam-ghimire avatar Apr 24 '24 16:04 padam-ghimire

There are already 2 more PRs (#45 & #54 ) resolving the same issue. You should collaborate with any of them to come with common solution.

ashiishme avatar Apr 24 '24 16:04 ashiishme

thank you for you time on this. #45 has been merged for this issue

sumanashrestha avatar Apr 25 '24 06:04 sumanashrestha