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

Change the date format in the state filename & support state variable of type numpy.ndarray #12

Merged
merged 2 commits into from
Jun 24, 2016

Conversation

h4k1m0u
Copy link
Contributor

@h4k1m0u h4k1m0u commented Jun 23, 2016

  • Windows doesn't accept colons in the filenames, and couldn't create the state file.

Here is the error I'm getting when I run the salesman.py example:

File "c:\github\simanneal\simanneal\anneal.py", line 63, in save_state
    with open(fname, "w") as fh:
IOError: [Errno 22] invalid mode ('w') or filename: u'2016-06-23T01:13:58_energy_7060.97080007.state'
  • The second error concerns the case when a numpy.ndarray variable is used as a state variable, and is shown below:
File "c:\github\simanneal\simanneal\anneal.py", line 46, in __init__
    if initial_state:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Windows doesnt accept colons in the filenames, and ignore the created state file.
Fix the error with numpy arrays
@h4k1m0u h4k1m0u changed the title Change the date format in the state filename Change the date format in the state filename & support state variable of type numpy.ndarray Jun 23, 2016
@perrygeo
Copy link
Owner

Thanks, this looks great @h4k1m0u

@perrygeo perrygeo merged commit ee2247b into perrygeo:master Jun 24, 2016
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.

2 participants