-
Notifications
You must be signed in to change notification settings - Fork 22
Improve DOS copy for data exporter #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
> 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.
| # 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" |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
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
xcopyDOS command withrobocopy(with a copy speed of ~7,500 MegaBytes/min).Types of changes
What types of changes does your code introduce to ABM?
Put an
xin the boxes that applyHow has this been tested?
Please describe the tests that you ran to verify your changes.
Checklist:
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.