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

[Bug report] cocopp stalls when using online data #2023

Closed
nikohansen opened this issue Oct 11, 2021 · 3 comments
Closed

[Bug report] cocopp stalls when using online data #2023

nikohansen opened this issue Oct 11, 2021 · 3 comments
Labels

Comments

@nikohansen
Copy link
Contributor

The previous url for the "official data archive" is offline. Hence the code may stall like

import cocopp
cocopp.main('glas')
Post-processing (1)
  downloading http://coco.gforge.inria.fr/data-archive/bbob/2020/HE-ES_Glasmachers.tgz to ...

and bail after a while like

TimeoutError                              Traceback (most recent call last)
~/opt/anaconda3/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
   1318                 h.request(req.get_method(), req.selector, req.data, headers,
-> 1319                           encode_chunked=req.has_header('Transfer-encoding'))
   1320             except OSError as err: # timeout error

~/opt/anaconda3/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked)
   1251         """Send a complete request to the server."""
-> 1252         self._send_request(method, url, body, headers, encode_chunked)
   1253 

[...]

   1346     def http_open(self, req):
-> 1347         return self.do_open(http.client.HTTPConnection, req)
   1348 
   1349     http_request = AbstractHTTPHandler.do_request_

~/opt/anaconda3/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
   1319                           encode_chunked=req.has_header('Transfer-encoding'))
   1320             except OSError as err: # timeout error
-> 1321                 raise URLError(err)
   1322             r = h.getresponse()
   1323         except:

URLError: <urlopen error [Errno 60] Operation timed out>
@nikohansen nikohansen added the bug label Oct 11, 2021
@nikohansen
Copy link
Contributor Author

The following workaround should be good for users who have cocopp already installed:

import cocopp
cocopp.archiving.coco_url = 'https://numbbo.github.io/gforge'
cocopp.archives = cocopp.archiving.official_archives = cocopp.archiving.OfficialArchives()
cocopp.archives.set_as_attributes_in() 

After executing these lines, the original functionality should be back. Previously downloaded data will be downloaded again when necessary.

@nikohansen
Copy link
Contributor Author

nikohansen commented Oct 13, 2021

Installing the latest cocopp module like

pip install --upgrade cocopp

should also fix this issue.

@brockho
Copy link
Contributor

brockho commented Oct 14, 2021

Small note: The above did not work for me as I had already the cocopp module installed with the same version number. If you, upon typing the above, also get something like:

Requirement already satisfied: cocopp in c:\users\dimo\anaconda3\lib\site-packages\cocopp-2.4.28-py3.7.egg (2.4.28)

you should try a pip uninstall cocopp --yes before. This worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants