Make pyxel compatible with Python 3.9
Pyxel should be compatible with Python 3.9 at the time of version 1.0.
Currently there is an issue with PyGMO, which prevents calibration mode from working:
(from calibration tutorial notebook)
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
C:\Work\tools\Anaconda3\envs\pyxel39\lib\site-packages\dask\base.py in normalize_function(func)
868 try:
--> 869 return function_cache[func]
870 except KeyError:
KeyError: <numpy.vectorize object at 0x000002A4323A6460>
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
<timed exec> in <module>
c:\work\dev\pyxel\pyxel\run.py in calibration_mode(calibration, detector, pipeline, compute_and_save)
179 processor = Processor(detector=detector, pipeline=pipeline)
180
--> 181 ds_results, df_processors, df_all_logs = calibration.run_calibration(
182 processor=processor, output_dir=calibration_outputs.output_dir
183 )
c:\work\dev\pyxel\pyxel\calibration\calibration.py in run_calibration(self, processor, output_dir, with_progress_bar)
371 # Create a new archipelago
372 # This operation takes some time ...
--> 373 my_archipelago = MyArchipelago(
374 num_islands=self.num_islands,
375 udi=user_defined_island,
c:\work\dev\pyxel\pyxel\calibration\archipelago.py in __init__(self, num_islands, udi, algorithm, problem, pop_size, bfe, topology, seed, parallel, with_bar)
234
235 # Build the archipelago
--> 236 self._build()
237
238 def _build(self) -> None:
c:\work\dev\pyxel\pyxel\calibration\archipelago.py in _build(self)
267 it = executor.map(create_island, seeds)
268
--> 269 for island in tqdm(
270 it,
271 desc="Create islands",
C:\Work\tools\Anaconda3\envs\pyxel39\lib\site-packages\tqdm\notebook.py in __iter__(self)
255 def __iter__(self):
256 try:
--> 257 for obj in super(tqdm_notebook, self).__iter__():
258 # return super(tqdm...) will not catch exception
259 yield obj
C:\Work\tools\Anaconda3\envs\pyxel39\lib\site-packages\tqdm\std.py in __iter__(self)
1183
1184 try:
-> 1185 for obj in iterable:
1186 yield obj
1187 # Update and possibly print the progressbar.
C:\Work\tools\Anaconda3\envs\pyxel39\lib\concurrent\futures\_base.py in result_iterator()
606 # Careful not to keep a reference to the popped future
607 if timeout is None:
--> 608 yield fs.pop().result()
609 else:
610 yield fs.pop().result(end_time - time.monotonic())
C:\Work\tools\Anaconda3\envs\pyxel39\lib\concurrent\futures\_base.py in result(self, timeout)
436 raise CancelledError()
437 elif self._state == FINISHED:
--> 438 return self.__get_result()
439
440 self._condition.wait(timeout)
C:\Work\tools\Anaconda3\envs\pyxel39\lib\concurrent\futures\_base.py in __get_result(self)
388 if self._exception:
389 try:
--> 390 raise self._exception
391 finally:
392 # Break a reference cycle with the exception in self._exception
C:\Work\tools\Anaconda3\envs\pyxel39\lib\concurrent\futures\thread.py in run(self)
50
51 try:
---> 52 result = self.fn(*self.args, **self.kwargs)
53 except BaseException as exc:
54 self.future.set_exception(exc)
c:\work\dev\pyxel\pyxel\calibration\archipelago.py in create_island(seed)
243 def create_island(seed: t.Optional[int] = None) -> pg.island:
244 """Create a new island."""
--> 245 return pg.island(
246 udi=self.udi,
247 algo=self._pygmo_algo,
C:\Work\tools\Anaconda3\envs\pyxel39\lib\site-packages\pygmo\__init__.py in _island_init(self, **kwargs)
352 pop = kwargs.pop('pop')
353 elif 'prob' in kwargs and 'size' in kwargs:
--> 354 pop = population(prob=kwargs.pop('prob'),
355 size=kwargs.pop('size'), seed=kwargs.pop('seed') if 'seed' in kwargs else None,
356 b=kwargs.pop('b') if 'b' in kwargs else None)
C:\Work\tools\Anaconda3\envs\pyxel39\lib\site-packages\pygmo\__init__.py in _population_init(self, prob, size, b, seed)
298 else:
299 # A bfe was specified. Same as above with the problem.
--> 300 __original_population_init(self, prob, b if type(
301 b) == bfe else bfe(b), size, seed)
302
RuntimeError: instance allocation failed: new instance has no pybind11-registered base types
TODO:
-
Put info in the documentation
Edited by Frederic Lemmel