vallis / libstempo

libstempo — a Python wrapper for tempo2
MIT License
29 stars 34 forks source link

Fix issue with free spectrum GWB injection in python3 #25

Closed bencebecsy closed 4 years ago

bencebecsy commented 4 years ago

The free spectrum injection of a GWB (userSpec option of createGWB) uses extrap1d which extends an interpolator to use for extrapolations too. When doing so it converts a map to a numpy array and returns it.

This worked well in python2, where map returned a list, but in python3 map returns an iterator which cannot be converted to a numpy array directly and gives this error: TypeError: unsupported operand type(s) for ** or pow(): 'float' and 'map'

This can be easily solved by just converting the map object to a list before converting it to a numpy array, as it is done in this pull request.