Skip to content

Conversation

@jchu-sandag
Copy link

@jchu-sandag jchu-sandag commented Nov 4, 2025

Proposed changes

Based on issue #374. Copying model data from C: drive back to T: drive has been taking longer and occasionally failing. This PR modifies the script to improve copy speed of all non-EMME specific files and prioritizes copy of all non-EMME specific files over EMME files and directories.

Impact

Replaces xcopy DOS command with robocopy (with a copy speed of ~7,500 MegaBytes/min).

Types of changes

What types of changes does your code introduce to ABM?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

How has this been tested?

Please describe the tests that you ran to verify your changes.

  • Ran a partial 2050 run with data export step included.
  • Ran full 2022 run with all steps.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Further comments

The new copy method has different error codes when compared to the previous method. A return code other than 0 or 1 is not an immediate flag and is coded to not raise an error but should be examined. Error code 16 (no files were copied over) will be raised.

> Based on issue SANDAG#374 (SANDAG#374). Copying model data from C: drive back to T: drive has been taking longer and occasionally failing. This PR modifies the script to improve copy speed of all non-EMME specific files and prioritizes copy of all non-EMME specific files over EMME files and directories.

> ## Types of changes
> What types of changes does your code introduce? _Put an `x` in the boxes that apply_
>
> * [ ]  Bugfix (non-breaking change which fixes an issue)
> * [x]  New feature (non-breaking change which adds functionality)
> * [ ]  Breaking change (fix or feature that would cause existing functionality to not work as expected)
> * [ ]  Documentation Update (if none of the other choices apply)
>
> ## How has this been tested?
> Please describe the tests that you ran to verify your changes.
>
> * [x] Ran a partial 2050 run with data export step included.
>
> ## Checklist:
> * [x]  My code follows the style guidelines of this project
> * [x]  I have performed a self-review of my own code
> * [x]  I have commented my code, particularly in hard-to-understand areas
> * [ ]  I have made corresponding changes to the documentation
> * [ ]  My changes generate no new warnings
>
> ## Further comments
> The new copy method has different error codes when compared to the previous method. A return code other than 0 or 1 is not an immediate flag, but should be examined.
@jchu-sandag jchu-sandag marked this pull request as ready for review November 5, 2025 01:35
@jchu-sandag jchu-sandag marked this pull request as draft November 5, 2025 01:36
@jchu-sandag jchu-sandag marked this pull request as ready for review November 5, 2025 01:36
@JiaXu1024 JiaXu1024 requested a review from aber-sandag November 5, 2025 19:57
# windows xcopy is much faster than shutil
# upgrading xcopy to a faster robocopy
self._report.append(_time.strftime("%c"))
exclude_filename = "TEMP_file_manager_exclude.txt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exclude_file and exclude_filename can be removed, as these were only needed for xcopy. Only need exclude_file_list for robocopy

self.log_report()
raise
self._report.append(output)
if (error.returncode < 16) and (error.returncode > 0):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check return code >=8 to indicate an error, remove duplicate report append

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

Successfully merging this pull request may close these issues.

3 participants