Truncated upgrade_dir_name ending with space conflicts with directory path

Open
#110 0 comments 0 reactions 1 assignee View on GitHub

@ChristopherCaradonna is already working on this.

Since Mar 12, 2025.

Assessment

This issue has not been assessed yet.

Description

bug postprocessing

Bug found in comstock_measure_comparison.py under comstockpostproc

Description

When the upgrade dir name exceeeds 20 char and triggers the truncating operation in:
https://github.com/NREL/ComStock/blob/eea3ae0308c0659517390f9872f400f0184952c2/postprocessing/comstockpostproc/comstock_measure_comparison.py#L41
it might end with space if the last char in upgrade_dir_name is space. The space tail will be automatically dumped in the generated directory but will stay in the path name and this conflict will cause "FileNotFoundError: [Errno 2] No such file or directory:".

Suggestion

Logic needs to be added to handle this scenario, so that the last space in truncated upgrade_dir_name would be removed to match the generated directory.

Dominant language
Ruby
Stars
54
Forks
28
Avg merge
3d 23h
Merged PRs (30d)
5

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NatLabRockies/ComStock

All issues in NatLabRockies/ComStock

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.