Skip to content
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

modify regex in StandardProblem.parse so we can load .tsp files we wrote #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GGooeytoe
Copy link

StandardProblem.write places EOF at the end of the file. The TSPLIB standard specifies that EOF is a keyword and so is expected to be followed by a ":". StandardProblem.parse respected this aspect of the standard and so refused to match EOF unless it was followed by ":" or whitespace. We add that the file end ("\Z" in regex terms) is also acceptable so that the output of StandardProblem.write is acceptable input to StandardProblem.parse

StandardProblem.write places EOF at the end of the file. The TSPLIB standard
specifies that EOF is a keyword and so is expected to be followed by a ":".
StandardProblem.parse respected this aspect of the standard and so refused
to match EOF unless it was followed by ":" or whitespace. We add that the file
end ("\Z" in regex terms) is also acceptable so that the output of StandardProblem.write
is acceptable input to StandardProblem.parse
@GGooeytoe
Copy link
Author

GGooeytoe commented Dec 21, 2023

The CI tests don't appear to run anymore, but I ran both pytest (EDIT: and tox) on my local machine for py3.8 only and all tests passed.

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.

1 participant